Cover formatter node metadata parity
This commit is contained in:
@@ -884,6 +884,9 @@ pair metadata through the core Python APIs, then verifies:
|
|||||||
- profile-save and accumulator endpoint payload handlers are smoke-tested
|
- profile-save and accumulator endpoint payload handlers are smoke-tested
|
||||||
without importing ComfyUI, and the reversible index switch keeps pick/input
|
without importing ComfyUI, and the reversible index switch keeps pick/input
|
||||||
and route/output behavior stable.
|
and route/output behavior stable.
|
||||||
|
- Krea2, SDXL, and caption formatter nodes are checked against their public
|
||||||
|
Python formatter APIs for metadata-driven pair inputs, so ComfyUI wrappers
|
||||||
|
cannot silently drift from route behavior.
|
||||||
|
|
||||||
## Editing Cheatsheet
|
## Editing Cheatsheet
|
||||||
|
|
||||||
|
|||||||
@@ -5848,6 +5848,126 @@ def smoke_node_formatter_registration() -> None:
|
|||||||
_expect("formatter_profile" in sdxl_inputs, "SDXL Formatter lost formatter_profile input")
|
_expect("formatter_profile" in sdxl_inputs, "SDXL Formatter lost formatter_profile input")
|
||||||
_expect("tooltip" in sdxl_inputs["formatter_profile"][1], "SDXL formatter_profile tooltip injection missing")
|
_expect("tooltip" in sdxl_inputs["formatter_profile"][1], "SDXL formatter_profile tooltip injection missing")
|
||||||
|
|
||||||
|
pair = pb.build_insta_of_pair(
|
||||||
|
row_number=1,
|
||||||
|
start_index=1,
|
||||||
|
seed=4311,
|
||||||
|
ethnicity="any",
|
||||||
|
figure="random",
|
||||||
|
no_plus_women=False,
|
||||||
|
no_black=False,
|
||||||
|
trigger=Trigger,
|
||||||
|
prepend_trigger_to_prompt=True,
|
||||||
|
options_json=_insta_options(),
|
||||||
|
character_cast=_character_cast(),
|
||||||
|
hardcore_position_config=_action_filter("penetration_only"),
|
||||||
|
)
|
||||||
|
pair_metadata = _json(pair)
|
||||||
|
|
||||||
|
expected_krea_pair = krea_formatter.format_krea2_prompt(
|
||||||
|
"",
|
||||||
|
metadata_json=pair_metadata,
|
||||||
|
input_hint="metadata_json",
|
||||||
|
target="hardcore",
|
||||||
|
detail_level="balanced",
|
||||||
|
style_mode="preserve",
|
||||||
|
extra_positive="node krea pair marker",
|
||||||
|
extra_negative="node krea pair negative",
|
||||||
|
)
|
||||||
|
node_krea_pair = krea_node().build(
|
||||||
|
"",
|
||||||
|
"metadata_json",
|
||||||
|
"hardcore",
|
||||||
|
"balanced",
|
||||||
|
"preserve",
|
||||||
|
False,
|
||||||
|
metadata_json=pair_metadata,
|
||||||
|
extra_positive="node krea pair marker",
|
||||||
|
extra_negative="node krea pair negative",
|
||||||
|
)
|
||||||
|
_expect(
|
||||||
|
node_krea_pair
|
||||||
|
== (
|
||||||
|
expected_krea_pair["krea_prompt"],
|
||||||
|
expected_krea_pair["negative_prompt"],
|
||||||
|
expected_krea_pair["krea_softcore_prompt"],
|
||||||
|
expected_krea_pair["krea_hardcore_prompt"],
|
||||||
|
expected_krea_pair["softcore_negative_prompt"],
|
||||||
|
expected_krea_pair["hardcore_negative_prompt"],
|
||||||
|
expected_krea_pair["method"],
|
||||||
|
),
|
||||||
|
"Krea2 Formatter node output drifted from public metadata formatter",
|
||||||
|
)
|
||||||
|
|
||||||
|
expected_sdxl_pair = sdxl_formatter.format_sdxl_prompt(
|
||||||
|
"",
|
||||||
|
metadata_json=pair_metadata,
|
||||||
|
input_hint="metadata_json",
|
||||||
|
target="hardcore",
|
||||||
|
formatter_profile="manual_controls",
|
||||||
|
style_preset="flat_vector_pony",
|
||||||
|
quality_preset="pony_high",
|
||||||
|
trigger=SdxlTrigger,
|
||||||
|
prepend_trigger=True,
|
||||||
|
preserve_trigger=False,
|
||||||
|
nude_weight=1.29,
|
||||||
|
extra_positive="node sdxl pair marker",
|
||||||
|
extra_negative="node sdxl pair negative",
|
||||||
|
)
|
||||||
|
node_sdxl_pair = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPSDXLFormatter"]().build(
|
||||||
|
"",
|
||||||
|
"metadata_json",
|
||||||
|
"hardcore",
|
||||||
|
"manual_controls",
|
||||||
|
"flat_vector_pony",
|
||||||
|
"pony_high",
|
||||||
|
SdxlTrigger,
|
||||||
|
True,
|
||||||
|
False,
|
||||||
|
1.29,
|
||||||
|
metadata_json=pair_metadata,
|
||||||
|
extra_positive="node sdxl pair marker",
|
||||||
|
extra_negative="node sdxl pair negative",
|
||||||
|
)
|
||||||
|
_expect(
|
||||||
|
node_sdxl_pair
|
||||||
|
== (
|
||||||
|
expected_sdxl_pair["sdxl_prompt"],
|
||||||
|
expected_sdxl_pair["negative_prompt"],
|
||||||
|
expected_sdxl_pair["sdxl_softcore_prompt"],
|
||||||
|
expected_sdxl_pair["sdxl_hardcore_prompt"],
|
||||||
|
expected_sdxl_pair["softcore_negative_prompt"],
|
||||||
|
expected_sdxl_pair["hardcore_negative_prompt"],
|
||||||
|
expected_sdxl_pair["method"],
|
||||||
|
),
|
||||||
|
"SDXL Formatter node output drifted from public metadata formatter",
|
||||||
|
)
|
||||||
|
|
||||||
|
expected_caption_pair = caption_naturalizer.naturalize_caption(
|
||||||
|
"",
|
||||||
|
metadata_json=pair_metadata,
|
||||||
|
input_hint="metadata_json",
|
||||||
|
trigger=Trigger,
|
||||||
|
include_trigger=True,
|
||||||
|
detail_level="balanced",
|
||||||
|
style_policy="drop_style_tail",
|
||||||
|
caption_profile="training_dense",
|
||||||
|
)
|
||||||
|
node_caption_pair = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPCaptionNaturalizer"]().build(
|
||||||
|
"",
|
||||||
|
"metadata_json",
|
||||||
|
"training_dense",
|
||||||
|
"balanced",
|
||||||
|
"drop_style_tail",
|
||||||
|
Trigger,
|
||||||
|
True,
|
||||||
|
metadata_json=pair_metadata,
|
||||||
|
)
|
||||||
|
_expect(
|
||||||
|
node_caption_pair == expected_caption_pair,
|
||||||
|
"Caption Naturalizer node output drifted from public metadata formatter",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def smoke_node_insta_registration() -> None:
|
def smoke_node_insta_registration() -> None:
|
||||||
required_nodes = [
|
required_nodes = [
|
||||||
|
|||||||
Reference in New Issue
Block a user