Use metadata for scene camera profiles

This commit is contained in:
2026-06-27 13:25:36 +02:00
parent 75a71a2df6
commit f811c02641
5 changed files with 194 additions and 11 deletions
+53
View File
@@ -570,6 +570,59 @@ 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")
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",
"scene_text": "private themed room with neutral walls and warm lamps",
"scene_entry": {
"slug": "library_by_metadata",
"prompt": "private themed room with neutral walls and warm lamps",
"theme": "classical_library",
},
"scene_theme": "classical_library",
"composition": "polished mirror view with bag and shoes visible",
"subject_type": "woman",
"women_count": 1,
"men_count": 0,
}
updated_metadata_profile = row_camera.apply_camera_config(
metadata_profile_row,
_orbit_camera(horizontal_angle=315, vertical_angle=0, zoom=5.0),
compact_labels=pb.CAMERA_COMPACT_LABELS,
)
metadata_scene = _expect_text(
"row_camera_policy.metadata_scene",
updated_metadata_profile.get("camera_scene_directive"),
40,
)
_expect("Library camera layout" in metadata_scene, "row camera should prefer scene theme metadata over generic scene text")
_expect(
updated_metadata_profile.get("scene_camera_profile_key") == "classical_library",
"row camera should expose metadata-selected profile key",
)
_expect(
"library" in str(updated_metadata_profile.get("composition", "")).lower(),
"row camera metadata-selected profile did not clean composition",
)
explicit_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",
"scene_text": "coworking lounge with tall windows, warm desks, and glass partitions",
"scene_camera_profile_key": "classical_library",
"composition": "polished mirror view with bag and shoes visible",
"subject_type": "woman",
"women_count": 1,
"men_count": 0,
}
updated_explicit_profile = row_camera.apply_camera_config(
explicit_profile_row,
_orbit_camera(horizontal_angle=315, vertical_angle=0, zoom=5.0),
compact_labels=pb.CAMERA_COMPACT_LABELS,
)
_expect(
"Library camera layout" in str(updated_explicit_profile.get("camera_scene_directive", "")),
"explicit scene_camera_profile_key should override text-matched scene profile",
)
def smoke_config_route_location_theme() -> None: