Extract camera utility nodes
This commit is contained in:
@@ -1706,6 +1706,78 @@ def smoke_node_utility_registration() -> None:
|
||||
_expect(krea_config.get("width") == krea_width and krea_config.get("height") == krea_height, "Krea2 config_json dimensions mismatch")
|
||||
|
||||
|
||||
def smoke_node_camera_registration() -> None:
|
||||
required_nodes = [
|
||||
"SxCPCameraControl",
|
||||
"SxCPCameraOrbitControl",
|
||||
"SxCPQwenCameraTranslator",
|
||||
]
|
||||
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")
|
||||
|
||||
camera_control = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPCameraControl"]
|
||||
camera_inputs = camera_control.INPUT_TYPES().get("required") or {}
|
||||
_expect("camera_mode" in camera_inputs, "Camera Control lost camera_mode input")
|
||||
_expect("tooltip" in camera_inputs["camera_mode"][1], "Camera Control tooltip injection missing")
|
||||
camera_config = camera_control().build(
|
||||
"handheld_selfie",
|
||||
"three_quarter_body",
|
||||
"high_angle",
|
||||
"smartphone_wide",
|
||||
"arm_length",
|
||||
"vertical_story",
|
||||
"phone_visible",
|
||||
"locked",
|
||||
"compact",
|
||||
)[0]
|
||||
parsed_camera = json.loads(camera_config)
|
||||
_expect(parsed_camera.get("camera_mode") == "handheld_selfie", "Camera Control lost camera_mode")
|
||||
_expect(parsed_camera.get("phone_visibility") == "phone_visible", "Camera Control lost phone visibility")
|
||||
|
||||
orbit_config, orbit_prompt, orbit_info = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPCameraOrbitControl"]().build(
|
||||
True,
|
||||
"standard",
|
||||
45,
|
||||
0,
|
||||
5.5,
|
||||
"from_zoom",
|
||||
"auto",
|
||||
"auto",
|
||||
"auto",
|
||||
"auto",
|
||||
"soft_hint",
|
||||
"compact",
|
||||
True,
|
||||
)
|
||||
parsed_orbit = json.loads(orbit_config)
|
||||
_expect(parsed_orbit.get("camera_source") == "orbit", "Orbit camera lost source metadata")
|
||||
_expect("front-right quarter view" in orbit_prompt, "Orbit camera prompt lost direction")
|
||||
_expect(json.loads(orbit_info).get("orbit_azimuth") == 45, "Orbit info JSON lost azimuth")
|
||||
|
||||
qwen_node = sxcp_nodes.NODE_CLASS_MAPPINGS["SxCPQwenCameraTranslator"]
|
||||
qwen_inputs = qwen_node.INPUT_TYPES()
|
||||
_expect("camera_info" in (qwen_inputs.get("optional") or {}), "Qwen translator lost camera_info optional input")
|
||||
qwen_config, qwen_prompt, qwen_info = qwen_node().build(
|
||||
"<sks> front-right quarter view eye-level shot medium shot",
|
||||
True,
|
||||
"standard",
|
||||
"auto",
|
||||
"auto",
|
||||
"auto",
|
||||
"auto",
|
||||
"soft_hint",
|
||||
"compact",
|
||||
False,
|
||||
True,
|
||||
)
|
||||
parsed_qwen = json.loads(qwen_config)
|
||||
_expect(parsed_qwen.get("camera_source") == "qwen_multiangle_prompt", "Qwen translator lost source metadata")
|
||||
_expect(parsed_qwen.get("phone_visibility") == "auto", "Qwen translator should suppress phone visibility by default")
|
||||
_expect("front-right quarter view" in qwen_prompt, "Qwen camera prompt lost direction")
|
||||
_expect(json.loads(qwen_info).get("qwen_prompt", "").startswith("<sks>"), "Qwen info JSON lost original prompt")
|
||||
|
||||
|
||||
SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("builtin_single_woman", smoke_builtin_single),
|
||||
("camera_scene_single", smoke_camera_scene_single),
|
||||
@@ -1730,6 +1802,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("expression_disabled", smoke_no_expression_fallback),
|
||||
("formatter_metadata_fixtures", smoke_formatter_metadata_fixtures),
|
||||
("node_utility_registration", smoke_node_utility_registration),
|
||||
("node_camera_registration", smoke_node_camera_registration),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user