Extract formatter nodes

This commit is contained in:
2026-06-26 23:16:20 +02:00
parent e56e7173ea
commit c8c95db835
5 changed files with 299 additions and 217 deletions
+57
View File
@@ -2059,6 +2059,62 @@ def smoke_node_hardcore_position_registration() -> None:
_expect("blocked=" in filter_summary, "Hardcore Action Filter summary lost blocked-gate details")
def smoke_node_formatter_registration() -> None:
required_nodes = [
"SxCPCaptionNaturalizer",
"SxCPKrea2Formatter",
"SxCPSDXLFormatter",
]
for node_name in required_nodes:
_expect(node_name in sxcp_nodes.NODE_CLASS_MAPPINGS, f"{node_name} missing from node registry")
_expect(node_name in sxcp_nodes.NODE_DISPLAY_NAME_MAPPINGS, f"{node_name} missing from display registry")
krea_node = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPKrea2Formatter"]
krea_inputs = krea_node.INPUT_TYPES().get("required") or {}
_expect("source_text" in krea_inputs, "Krea2 Formatter lost source_text input")
_expect("tooltip" in krea_inputs["source_text"][1], "Krea2 Formatter tooltip injection missing")
caption, caption_method = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPCaptionNaturalizer"]().build(
"A woman standing by a window, best quality",
"caption_or_prompt",
"concise",
"drop_style_tail",
"sxcppnl7",
True,
)
_expect_text("node_formatter.caption", caption, 20)
_expect(caption.startswith("sxcppnl7"), "Caption Naturalizer did not prepend trigger")
_expect("text(" in caption_method, "Caption Naturalizer method changed unexpectedly")
krea_output = krea_node().build(
"sxcppnl7 A woman standing by a window",
"prompt",
"single",
"concise",
"preserve",
True,
)
_expect_text("node_formatter.krea_prompt", krea_output[0], 20)
_expect("sxcppnl7" in krea_output[0], "Krea2 Formatter did not preserve trigger when enabled")
_expect(krea_output[6].startswith("text("), "Krea2 Formatter method changed unexpectedly")
sdxl_output = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPSDXLFormatter"]().build(
"A woman standing by a window",
"prompt",
"single",
"flat_vector_pony",
"pony_high",
"mythp0rt",
True,
False,
1.29,
)
_expect_text("node_formatter.sdxl_prompt", sdxl_output[0], 40)
_expect_trigger_once("node_formatter.sdxl_prompt", sdxl_output[0], "mythp0rt")
_expect_text("node_formatter.sdxl_negative", sdxl_output[1], 20)
_expect(sdxl_output[6].startswith("text("), "SDXL Formatter method changed unexpectedly")
def smoke_node_profile_filter_registration() -> None:
required_nodes = [
"SxCPGenerationProfile",
@@ -2168,6 +2224,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
("node_route_config_registration", smoke_node_route_config_registration),
("node_character_registration", smoke_node_character_registration),
("node_hardcore_position_registration", smoke_node_hardcore_position_registration),
("node_formatter_registration", smoke_node_formatter_registration),
("node_profile_filter_registration", smoke_node_profile_filter_registration),
]