Extract row camera policy

This commit is contained in:
2026-06-27 02:54:35 +02:00
parent 132d457bf7
commit 1cc65e35b5
5 changed files with 210 additions and 86 deletions
+30
View File
@@ -44,6 +44,7 @@ import loop_nodes # noqa: E402
import prompt_builder as pb # noqa: E402
import row_normalization # noqa: E402
import route_metadata # noqa: E402
import row_camera # noqa: E402
import server_routes # noqa: E402
import sdxl_formatter # noqa: E402
import sdxl_presets # noqa: E402
@@ -466,6 +467,34 @@ def smoke_camera_scene_single() -> None:
_expect_formatter_outputs(row, "camera_scene_single", target="single")
def smoke_row_camera_policy() -> None:
row = {
"prompt": "A generated adult prompt. Composition: vertical office-lobby walking composition. Avoid: low quality.",
"caption": "sxcppnl7, generated adult prompt, office-lobby walking composition, illustration",
"scene_text": "coworking lounge with tall windows, warm desks, and a polished outfit-check angle",
"composition": "office-lobby walking composition",
"subject_type": "configured_cast",
"women_count": 1,
"men_count": 1,
"pov_character_labels": ["Man A"],
}
updated = row_camera.apply_camera_config(
row,
_orbit_camera(horizontal_angle=45, vertical_angle=0, zoom=5.5),
compact_labels=pb.CAMERA_COMPACT_LABELS,
)
_expect(updated.get("camera_directive") == "", "POV row camera policy should suppress normal camera directive")
scene_directive = _expect_text("row_camera_policy.camera_scene_directive", updated.get("camera_scene_directive"), 40)
_expect("Coworking camera layout from POV" in scene_directive, "row camera policy missed POV coworking layout")
_expect("first-person spatial geometry" in scene_directive, "row camera policy lost POV geometry instruction")
_expect("Camera:" not in updated.get("prompt", ""), "row camera policy should not add normal Camera label")
_expect("45-degree front-right quarter view" not in updated.get("caption", ""), "POV row camera policy should not append camera caption")
_expect(
"coworking lounge frame with the couple near a desk edge" in updated.get("composition", ""),
"row camera policy did not adapt coworking composition for couple rows",
)
def smoke_config_route_location_theme() -> None:
location_config, composition_config = _classical_library_theme_configs()
row = pb.build_prompt_from_configs(
@@ -3380,6 +3409,7 @@ def smoke_node_profile_filter_registration() -> None:
SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
("builtin_single_woman", smoke_builtin_single),
("camera_scene_single", smoke_camera_scene_single),
("row_camera_policy", smoke_row_camera_policy),
("config_route_location_theme", smoke_config_route_location_theme),
("location_config_policy", smoke_location_config_policy),
("category_cast_config_policy", smoke_category_cast_config_policy),