Expand semi-public camera scene profiles

This commit is contained in:
2026-06-27 16:23:51 +02:00
parent 002c3b79d4
commit c69274d2ee
5 changed files with 352 additions and 20 deletions
+74 -1
View File
@@ -406,10 +406,14 @@ def _coworking_location_config() -> str:
def _classical_library_theme_configs() -> tuple[str, str]:
return _thematic_location_configs("classical_library")
def _thematic_location_configs(theme: str) -> tuple[str, str]:
location_config, composition_config, _summary = pb.build_thematic_location_json(
enabled=True,
combine_mode="replace",
theme="classical_library",
theme=theme,
)
return location_config, composition_config
@@ -694,6 +698,39 @@ def smoke_row_camera_policy() -> None:
_expect("bag" not in library_composition.lower(), "row camera library composition leaked bag wording")
_expect("shoes" not in library_composition.lower(), "row camera library composition leaked shoes wording")
_expect("library" in library_composition.lower(), "row camera library composition did not become location-aware")
semi_public_row = {
"prompt": "A generated adult prompt. Composition: vertical polished mirror view with bag and shoes visible. Avoid: low quality.",
"caption": "sxcppnl7, generated adult prompt, polished mirror view with bag and shoes visible, illustration",
"scene_text": "upscale hotel corridor with repeating numbered doors, patterned carpet, brass wall lamps, luggage carts, and a secluded corner near a service alcove",
"scene_entry": {
"slug": "hotel_corridor_affair",
"prompt": "upscale hotel corridor with repeating numbered doors, patterned carpet, brass wall lamps, luggage carts, and a secluded corner near a service alcove",
"theme": "semi_public_affair",
},
"scene_theme": "semi_public_affair",
"composition": "polished mirror view with bag and shoes visible",
"subject_type": "configured_cast",
"women_count": 1,
"men_count": 1,
"pov_character_labels": ["Man A"],
}
updated_semi_public = row_camera.apply_camera_config(
semi_public_row,
_orbit_camera(horizontal_angle=180, vertical_angle=30, zoom=7.5),
compact_labels=pb.CAMERA_COMPACT_LABELS,
)
semi_public_scene = _expect_text("row_camera_policy.semi_public_scene", updated_semi_public.get("camera_scene_directive"), 40)
semi_public_composition = _expect_text(
"row_camera_policy.semi_public_composition",
updated_semi_public.get("composition"),
20,
)
_expect("Hotel corridor camera layout from POV" in semi_public_scene, "row camera semi-public scene did not use hotel corridor profile")
_expect("back view" in semi_public_scene, "row camera semi-public scene missed orbit direction")
_expect("first-person spatial geometry" in semi_public_scene, "row camera semi-public POV scene lost first-person geometry")
_expect(updated_semi_public.get("scene_camera_profile_key") == "hotel_corridor", "row camera semi-public scene did not expose text-matched profile key")
_expect("hotel corridor" in semi_public_composition.lower(), "row camera semi-public composition did not become location-aware")
_expect("bag" not in semi_public_composition.lower() and "shoes" not in semi_public_composition.lower(), "row camera semi-public composition leaked outfit-check props")
metadata_profile_row = {
"prompt": "A generated adult prompt. Composition: vertical polished mirror view with bag and shoes visible. Avoid: low quality.",
"caption": "sxcppnl7, generated adult prompt, polished mirror view with bag and shoes visible, illustration",
@@ -870,6 +907,42 @@ def smoke_config_route_location_theme() -> None:
_expect("315-degree front-left quarter view" in prompt, "Krea config route lost camera directive")
_expect_formatter_outputs(row, "config_route_location_theme", target="single")
parking_location_config, parking_composition_config = _thematic_location_configs("parking_garage")
parking_row = pb.build_prompt_from_configs(
row_number=1,
start_index=1,
seed=3311,
category_config=pb.build_category_config_json("woman", "random"),
cast_config=pb.build_cast_config_json("solo_woman", 1, 0),
generation_profile=pb.build_generation_profile_json(profile="balanced"),
camera_config=_orbit_camera(
horizontal_angle=135,
vertical_angle=-30,
zoom=4.0,
subject_focus="environment",
),
location_config=parking_location_config,
composition_config=parking_composition_config,
)
_expect_row_base(parking_row, "config_route_location_theme.parking")
parking_scene = _expect_text("config_route_location_theme.parking_scene", parking_row.get("scene_text"), 20)
parking_composition = _expect_text("config_route_location_theme.parking_composition", parking_row.get("composition"), 10)
parking_directive = _expect_text(
"config_route_location_theme.parking_camera_scene_directive",
parking_row.get("camera_scene_directive"),
40,
)
parking_profile = parking_row.get("scene_camera_profile") if isinstance(parking_row.get("scene_camera_profile"), dict) else {}
_expect("parking" in parking_scene.lower() or "garage" in parking_scene.lower(), "parking theme did not drive scene")
_expect("parking" in parking_composition.lower() or "garage" in parking_composition.lower() or "pillar" in parking_composition.lower(), "parking theme did not drive composition")
_expect(parking_row.get("location_theme") == "parking_garage", "parking location theme did not survive")
_expect(parking_row.get("scene_theme") == "parking_garage", "parking scene theme did not survive")
_expect(parking_row.get("scene_camera_profile_key") == "parking_garage", "parking theme did not expose camera profile key")
_expect(parking_profile.get("family") == "semi_public", "parking camera profile family should be semi_public")
_expect("Parking garage camera layout" in parking_directive, "parking theme did not drive camera-scene adapter")
_expect("back-right quarter view" in parking_directive, "parking camera-scene adapter missed orbit direction")
_expect("low-angle shot" in parking_directive, "parking camera-scene adapter missed elevation")
def smoke_builder_prompt_route_policy() -> None:
def legacy_from_request(request: builder_prompt_route.PromptBuildRequest) -> dict[str, Any]: