Add v2 scene chain nodes

This commit is contained in:
2026-06-27 22:59:57 +02:00
parent 718da9a68d
commit 187940b45f
6 changed files with 1521 additions and 0 deletions
+169
View File
@@ -8790,6 +8790,174 @@ def smoke_node_insta_registration() -> None:
_expect(pair.get("options", {}).get("hardcore_cast") == "couple", "Insta/OF Prompt Pair lost options metadata")
def smoke_node_scene_chain_registration() -> None:
required_nodes = [
"SxCPSceneStart",
"SxCPSceneCast",
"SxCPSceneCharacter",
"SxCPSceneWardrobe",
"SxCPSceneLocation",
"SxCPSceneSetDressing",
"SxCPSceneBlocking",
"SxCPSceneAction",
"SxCPScenePerformance",
"SxCPSceneCamera",
"SxCPSceneComposition",
"SxCPSceneLighting",
"SxCPSceneBranchPair",
"SxCPSoftcoreBranchOptions",
"SxCPHardcoreBranchOptions",
"SxCPSceneOutput",
"SxCPScenePairOutput",
]
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")
nodes = sxcp_nodes.NODE_CLASS_MAPPINGS
scene, start_summary, _start_metadata = nodes["SxCPSceneStart"]().build(
1,
41,
777,
"raw",
"woman",
"random",
"balanced",
Trigger,
True,
)
_expect("scene v" in start_summary, "Scene Start summary changed unexpectedly")
parsed_scene = json.loads(scene)
_expect(parsed_scene.get("schema") == "sxcp_scene_v2", "Scene Start did not emit v2 schema")
scene, _cast_config, _cast_summary, _cast_metadata = nodes["SxCPSceneCast"]().build(
scene,
"mixed_couple",
1,
1,
"woman_a",
"none",
)
scene, character_cast, _slot, _summary, _metadata = nodes["SxCPSceneCharacter"]().build(
scene,
True,
"woman",
"A",
-1,
"25-year-old adult",
"random",
"random",
"random",
"medium",
True,
0.5,
"visible",
-1,
-1,
)
scene, character_cast, _slot, _summary, _metadata = nodes["SxCPSceneCharacter"]().build(
scene,
True,
"man",
"A",
-1,
"40-year-old adult",
"random",
"random",
"average",
"compact",
True,
0.5,
"visible",
-1,
-1,
)
scene, character_cast, _wardrobe_summary, _wardrobe_metadata = nodes["SxCPSceneWardrobe"]().build(
scene,
True,
"A",
"full",
"simple black dress",
"fully nude",
"",
)
slots = json.loads(character_cast).get("slots") or []
woman_slot = next(slot for slot in slots if slot.get("subject_type") == "woman")
_expect(woman_slot.get("softcore_outfit") == "simple black dress", "Scene Wardrobe did not update softcore outfit")
_expect(woman_slot.get("hardcore_clothing") == "fully nude", "Scene Wardrobe did not update hardcore clothing")
scene = nodes["SxCPSceneLocation"]().build(
scene,
True,
"replace",
"custom_only",
"quiet studio room with a large mirror",
"",
)[0]
scene = nodes["SxCPSceneSetDressing"]().build(scene, True, "mirror edge", "soft curtains", "small lamp", "")[0]
scene = nodes["SxCPSceneBlocking"]().build(scene, True, "standing", "woman near mirror", "man behind her", "")[0]
scene = nodes["SxCPScenePerformance"]().build(scene, True, "fixed", 0.4, "controlled eye contact")[0]
scene = nodes["SxCPSceneCamera"]().build(
scene,
True,
"standard",
"three_quarter",
"eye_level",
"auto",
"auto",
"auto",
"auto",
"strong",
"compact",
"",
)[0]
scene = nodes["SxCPSceneComposition"]().build(scene, True, "replace", "no_outfit_check", "mirror-aware three-quarter frame", "")[0]
scene = nodes["SxCPSceneLighting"]().build(scene, True, "practical_lamps", "soft", "medium", "warm", "")[0]
output = nodes["SxCPSceneOutput"]().build(scene)
_expect_text("node_scene_chain.prompt", output[0], 40)
_expect_trigger_once("node_scene_chain.prompt", output[0], Trigger)
row = json.loads(output[3])
_expect(row.get("scene_chain", {}).get("schema") == "sxcp_scene_v2", "Scene Output lost scene_chain metadata")
soft_scene, hard_scene, _branch_summary, _branch_metadata = nodes["SxCPSceneBranchPair"]().build(
scene,
"same_creator_same_room",
"hybrid",
)
soft_scene = nodes["SxCPSoftcoreBranchOptions"]().build(
soft_scene,
"same_as_hardcore",
"lingerie_tease",
True,
0.45,
"from_camera_config",
"compact",
"",
)[0]
hard_scene = nodes["SxCPHardcoreBranchOptions"]().build(
hard_scene,
"couple",
1,
1,
"hardcore",
True,
0.85,
"explicit_nude",
"from_camera_config",
"compact",
"balanced",
"",
)[0]
pair_output = nodes["SxCPScenePairOutput"]().build(soft_scene, hard_scene)
_expect_text("node_scene_chain.softcore_prompt", pair_output[0], 40)
_expect_text("node_scene_chain.hardcore_prompt", pair_output[1], 40)
pair = json.loads(pair_output[7])
_expect_pair(pair, "node_scene_chain_pair")
_expect(pair.get("options", {}).get("hardcore_cast") == "couple", "Scene Pair Output lost hardcore branch options")
_expect("scene_chain" in pair, "Scene Pair Output lost scene_chain metadata")
def smoke_node_builder_registration() -> None:
required_nodes = [
"SxCPPromptBuilder",
@@ -9018,6 +9186,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
("node_hardcore_position_registration", smoke_node_hardcore_position_registration),
("node_formatter_registration", smoke_node_formatter_registration),
("node_insta_registration", smoke_node_insta_registration),
("node_scene_chain_registration", smoke_node_scene_chain_registration),
("node_builder_registration", smoke_node_builder_registration),
("node_profile_filter_registration", smoke_node_profile_filter_registration),
]