Wire seed config into built-in clothing routes

This commit is contained in:
2026-07-01 16:50:46 +02:00
parent 8c3f61ea6d
commit 12c5f73104
5 changed files with 75 additions and 10 deletions
+60 -4
View File
@@ -479,6 +479,10 @@ def _prompt_row(
subcategory: str,
seed: int,
seed_config: str | dict[str, Any] | None = None,
clothing: str = "random",
poses: str = "random",
minimal_clothing_ratio: float = 0.5,
standard_pose_ratio: float = 0.5,
character_cast: str = "",
women_count: int = 1,
men_count: int = 1,
@@ -494,15 +498,15 @@ def _prompt_row(
row_number=1,
start_index=1,
seed=seed,
clothing="random",
clothing=clothing,
ethnicity="any",
poses="random",
poses=poses,
backside_bias=0.35,
figure="random",
no_plus_women=False,
no_black=False,
minimal_clothing_ratio=0.5,
standard_pose_ratio=0.5,
minimal_clothing_ratio=minimal_clothing_ratio,
standard_pose_ratio=standard_pose_ratio,
trigger=Trigger,
prepend_trigger_to_prompt=True,
extra_positive="",
@@ -14394,6 +14398,58 @@ def smoke_seed_config_policy() -> None:
clothing_axis_seed = 42001
auto_weighted_seeded = _prompt_row(
name="seed_config_policy_auto_weighted_seed_config",
category="auto_weighted",
subcategory="random",
seed=clothing_axis_seed,
seed_config=pb.build_seed_lock_config_json(base_seed=clothing_axis_seed),
women_count=1,
men_count=0,
)
_expect(auto_weighted_seeded.get("source") == "built_in_generator", "auto_weighted prompt with seed_config should build")
def direct_builtin_woman(seed_config_value: str | dict[str, Any], *, name: str) -> dict[str, Any]:
return _prompt_row(
name=name,
category="woman",
subcategory="random",
seed=43001,
seed_config=seed_config_value,
clothing="full",
poses="standard",
minimal_clothing_ratio=-1,
standard_pose_ratio=-1,
women_count=1,
men_count=0,
)
direct_builtin_locked = direct_builtin_woman(
pb.build_seed_lock_config_json(base_seed=43001),
name="seed_config_policy_direct_builtin_locked",
)
direct_builtin_clothing_reroll = direct_builtin_woman(
pb.build_seed_lock_config_json(base_seed=43001, reroll_axis="clothing", reroll_seed=43002),
name="seed_config_policy_direct_builtin_clothing_reroll",
)
direct_builtin_stable_fields = ("primary_subject", "age_band", "body_type", "scene", "composition", "pose_mode")
_expect(
tuple(direct_builtin_locked.get(key) for key in direct_builtin_stable_fields)
== tuple(direct_builtin_clothing_reroll.get(key) for key in direct_builtin_stable_fields),
"Prompt-level direct built-in clothing reroll should keep non-clothing fields stable",
)
_expect(
(
direct_builtin_locked.get("prompt"),
direct_builtin_locked.get("caption"),
)
!= (
direct_builtin_clothing_reroll.get("prompt"),
direct_builtin_clothing_reroll.get("caption"),
),
"Prompt-level direct built-in clothing reroll should change clothing text",
)
def clothing_category_row(seed_config_value: str | dict[str, Any], *, name: str = "seed_config_policy_clothing_axis") -> dict[str, Any]:
return pb.build_prompt(
category="Casual clothes",