Move cast descriptor entry policy
This commit is contained in:
@@ -1732,6 +1732,49 @@ def smoke_pair_options_policy() -> None:
|
||||
pair_cast.prompt_cast_descriptors("Woman A / primary creator: descriptor") == "Woman A: descriptor",
|
||||
"Pair cast prompt descriptor label cleanup changed",
|
||||
)
|
||||
|
||||
def _fake_character_context(
|
||||
label: str,
|
||||
label_map: dict[str, dict[str, Any]],
|
||||
_rng: random.Random,
|
||||
_ethnicity: str,
|
||||
_figure: str,
|
||||
_no_plus_women: bool,
|
||||
_no_black: bool,
|
||||
) -> tuple[dict[str, Any], dict[str, Any] | None]:
|
||||
subject = "man" if label.startswith("Man ") else "woman"
|
||||
age = "40-year-old adult" if subject == "man" else "30-year-old adult"
|
||||
return {"subject_type": subject, "age": age, "body_phrase": f"{label} body"}, label_map.get(label)
|
||||
|
||||
descriptor_entries, descriptor_slots = pair_cast.cast_descriptor_entries_from_slots(
|
||||
seed_config={},
|
||||
seed=1,
|
||||
row_number=1,
|
||||
ethnicity="any",
|
||||
figure="any",
|
||||
no_plus_women=False,
|
||||
no_black=False,
|
||||
women_count=2,
|
||||
men_count=1,
|
||||
character_slots=[{"subject_type": "man", "presence_mode": "pov"}],
|
||||
character_slot_map={"Man A": {"subject_type": "man", "presence_mode": "pov"}},
|
||||
primary_descriptor="primary descriptor",
|
||||
axis_rng=lambda _config, _axis, seed_value, row_value: random.Random(seed_value + row_value),
|
||||
character_context_for_label=_fake_character_context,
|
||||
slot_is_pov=lambda slot: bool(slot and slot.get("presence_mode") == "pov"),
|
||||
)
|
||||
_expect(
|
||||
descriptor_entries
|
||||
== [
|
||||
"Woman A / primary creator: primary descriptor",
|
||||
"Woman B: 30-year-old adult woman, Woman B body",
|
||||
],
|
||||
"Pair cast descriptor entries should keep primary label and skip POV men",
|
||||
)
|
||||
_expect(
|
||||
descriptor_slots == [{"subject_type": "man", "presence_mode": "pov"}],
|
||||
"Pair cast descriptor entries should return the source slots",
|
||||
)
|
||||
partner_styling = pair_cast.softcore_partner_styling(
|
||||
seed_config={},
|
||||
seed=1,
|
||||
|
||||
Reference in New Issue
Block a user