From 3cb44af4102c30eaa8a12e8c089681f93445c6d1 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 27 Jun 2026 16:51:31 +0200 Subject: [PATCH] Expose built-in category presets --- category_cast_config.py | 4 ++++ tools/prompt_smoke.py | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/category_cast_config.py b/category_cast_config.py index e358b88..a3bb764 100644 --- a/category_cast_config.py +++ b/category_cast_config.py @@ -9,6 +9,10 @@ RANDOM_SUBCATEGORY = "random" CATEGORY_PRESETS = { "auto_weighted": ("auto_weighted", RANDOM_SUBCATEGORY), "auto_full": ("auto_full", RANDOM_SUBCATEGORY), + "woman": ("woman", RANDOM_SUBCATEGORY), + "man": ("man", RANDOM_SUBCATEGORY), + "couple": ("couple", RANDOM_SUBCATEGORY), + "group_or_layout": ("group_or_layout", RANDOM_SUBCATEGORY), "women_casual": ("Casual clothes", RANDOM_SUBCATEGORY), "men_casual": ("Men casual clothes", RANDOM_SUBCATEGORY), "couple_casual": ("Couple casual clothes", RANDOM_SUBCATEGORY), diff --git a/tools/prompt_smoke.py b/tools/prompt_smoke.py index d20cc15..f9c9c3d 100644 --- a/tools/prompt_smoke.py +++ b/tools/prompt_smoke.py @@ -980,6 +980,8 @@ def smoke_config_route_location_theme() -> None: _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("main_category") == "woman", "parking built-in woman preset fell back to another category") + _expect(parking_row.get("primary_subject") == "woman", "parking built-in woman preset did not generate a woman") _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") @@ -1019,6 +1021,8 @@ def smoke_config_route_location_theme() -> None: ) _expect(creator_row.get("location_theme") == "creator_bedroom", "creator location theme did not survive") _expect(creator_row.get("scene_theme") == "creator_bedroom", "creator scene theme did not survive") + _expect(creator_row.get("main_category") == "woman", "creator built-in woman preset fell back to another category") + _expect(creator_row.get("primary_subject") == "woman", "creator built-in woman preset did not generate a woman") _expect(creator_row.get("scene_camera_profile_key") == "creator_bedroom", "creator theme did not expose camera profile key") _expect(creator_profile.get("family") == "private_creator", "creator camera profile family should be private_creator") _expect("Creator room camera layout" in creator_directive, "creator theme did not drive camera-scene adapter") @@ -2313,6 +2317,8 @@ def smoke_category_extensions_policy() -> None: def smoke_category_cast_config_policy() -> None: _expect(pb.CATEGORY_PRESETS is category_cast_config.CATEGORY_PRESETS, "Prompt builder category presets are not delegated") _expect(pb.CAST_PRESETS is category_cast_config.CAST_PRESETS, "Prompt builder cast presets are not delegated") + _expect("woman" in category_cast_config.category_preset_choices(), "Category preset choices lost built-in woman") + _expect("man" in category_cast_config.category_preset_choices(), "Category preset choices lost built-in man") _expect("hardcore_pose" in category_cast_config.category_preset_choices(), "Category preset choices lost hardcore_pose") _expect("custom_counts" in category_cast_config.cast_preset_choices(), "Cast preset choices lost custom_counts") _expect( @@ -2379,6 +2385,10 @@ def smoke_category_cast_config_policy() -> None: _expect(category_config.get("category") == "Hardcore sexual poses", "Category config lost hardcore category mapping") _expect(category_config.get("subcategory") == "Foreplay and teasing", "Category config lost explicit subcategory") _expect(pb._parse_category_config(category_config) == ("Hardcore sexual poses", "Foreplay and teasing"), "Category parser wrapper drifted") + builtin_woman_config = json.loads(pb.build_category_config_json("woman", "random")) + _expect(builtin_woman_config.get("preset") == "woman", "Built-in woman category preset fell back") + _expect(builtin_woman_config.get("category") == "woman", "Built-in woman category config lost direct category") + _expect(pb._parse_category_config(builtin_woman_config) == ("woman", "random"), "Built-in woman category parser drifted") fallback_config = json.loads(category_cast_config.build_category_config_json("unknown", "random")) _expect(fallback_config.get("preset") == "auto_weighted", "Unknown category preset did not fall back")