Move cast descriptor entry policy
This commit is contained in:
+20
-48
@@ -2621,24 +2621,24 @@ def _cast_descriptor_entries(
|
||||
character_cast: str | dict[str, Any] | list[Any] | None = "",
|
||||
primary_descriptor: str = "",
|
||||
) -> tuple[list[str], list[dict[str, Any]]]:
|
||||
slots = _parse_character_cast(character_cast)
|
||||
label_map = _character_slot_label_map(slots)
|
||||
rng = _axis_rng(seed_config, "person", seed, row_number + 997)
|
||||
descriptors: list[str] = []
|
||||
for index in range(max(0, women_count)):
|
||||
label = f"Woman {chr(ord('A') + index)}"
|
||||
if index == 0 and primary_descriptor:
|
||||
descriptors.append(f"Woman A / primary creator: {primary_descriptor}")
|
||||
continue
|
||||
context, _slot = _character_context_for_label(label, label_map, rng, ethnicity, figure, no_plus_women, no_black)
|
||||
descriptors.append(f"{label}: {_insta_of_descriptor_from_context(context)}")
|
||||
for index in range(max(0, men_count)):
|
||||
label = f"Man {chr(ord('A') + index)}"
|
||||
if _slot_is_pov(label_map.get(label)):
|
||||
continue
|
||||
context, _slot = _character_context_for_label(label, label_map, rng, ethnicity, figure, no_plus_women, no_black)
|
||||
descriptors.append(f"{label}: {_insta_of_descriptor_from_context(context)}")
|
||||
return descriptors, slots
|
||||
return pair_cast.cast_descriptor_entries(
|
||||
seed_config=seed_config,
|
||||
seed=seed,
|
||||
row_number=row_number,
|
||||
ethnicity=ethnicity,
|
||||
figure=figure,
|
||||
no_plus_women=no_plus_women,
|
||||
no_black=no_black,
|
||||
women_count=women_count,
|
||||
men_count=men_count,
|
||||
character_cast=character_cast,
|
||||
primary_descriptor=primary_descriptor,
|
||||
parse_character_cast=_parse_character_cast,
|
||||
character_slot_label_map=_character_slot_label_map,
|
||||
axis_rng=_axis_rng,
|
||||
character_context_for_label=_character_context_for_label,
|
||||
slot_is_pov=_slot_is_pov,
|
||||
)
|
||||
|
||||
|
||||
def _row_from_profile_metadata(metadata_json: str | dict[str, Any] | None) -> dict[str, Any]:
|
||||
@@ -3826,35 +3826,6 @@ def _insta_of_descriptor_from_context(context: dict[str, Any]) -> str:
|
||||
return pair_cast.insta_descriptor_from_context(context)
|
||||
|
||||
|
||||
def _insta_of_cast_descriptors(
|
||||
primary_descriptor: str,
|
||||
seed_config: dict[str, int],
|
||||
seed: int,
|
||||
row_number: int,
|
||||
ethnicity: str,
|
||||
figure: str,
|
||||
no_plus_women: bool,
|
||||
no_black: bool,
|
||||
women_count: int,
|
||||
men_count: int,
|
||||
character_cast: str | dict[str, Any] | list[Any] | None = "",
|
||||
) -> list[str]:
|
||||
descriptors, _slots = _cast_descriptor_entries(
|
||||
seed_config,
|
||||
seed,
|
||||
row_number,
|
||||
ethnicity,
|
||||
figure,
|
||||
no_plus_women,
|
||||
no_black,
|
||||
women_count,
|
||||
men_count,
|
||||
character_cast,
|
||||
primary_descriptor=primary_descriptor,
|
||||
)
|
||||
return descriptors
|
||||
|
||||
|
||||
def _insta_of_prompt_cast_descriptors(text: str) -> str:
|
||||
return pair_cast.prompt_cast_descriptors(text)
|
||||
|
||||
@@ -3973,8 +3944,9 @@ def build_insta_of_pair(
|
||||
platform_styles=INSTA_OF_PLATFORM_STYLES,
|
||||
soft_levels=INSTA_OF_SOFT_LEVELS,
|
||||
hardcore_levels=INSTA_OF_HARDCORE_LEVELS,
|
||||
build_cast_descriptors=_insta_of_cast_descriptors,
|
||||
axis_rng=_axis_rng,
|
||||
character_context_for_label=_character_context_for_label,
|
||||
slot_is_pov=_slot_is_pov,
|
||||
choose=g.choose,
|
||||
slot_softcore_outfit=_slot_softcore_outfit,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user