Add men and couple casual outfit categories
This commit is contained in:
+30
-1
@@ -1270,6 +1270,28 @@ def _configured_cast_context(women_count: int, men_count: int) -> dict[str, str]
|
||||
}
|
||||
|
||||
|
||||
def _couple_type_from_counts(
|
||||
rng: random.Random,
|
||||
women_count: int,
|
||||
men_count: int,
|
||||
) -> tuple[str, str, str, int, int]:
|
||||
women_count = max(0, int(women_count))
|
||||
men_count = max(0, int(men_count))
|
||||
if women_count >= 2 and men_count == 0:
|
||||
return "two women", "two women", "close affectionate couple pose", 2, 0
|
||||
if men_count >= 2 and women_count == 0:
|
||||
return "two men", "two men", "relaxed romantic couple pose", 0, 2
|
||||
if women_count >= 1 and men_count >= 1:
|
||||
return "woman and man", "a woman and a man", "playful date-night pose", 1, 1
|
||||
|
||||
primary_subject, subject_phrase, pose = g.choose(rng, g.COUPLE_TYPES)
|
||||
if primary_subject == "two women":
|
||||
return primary_subject, subject_phrase, pose, 2, 0
|
||||
if primary_subject == "two men":
|
||||
return primary_subject, subject_phrase, pose, 0, 2
|
||||
return primary_subject, subject_phrase, pose, 1, 1
|
||||
|
||||
|
||||
def _lettered(prefix: str, count: int) -> list[str]:
|
||||
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
return [f"{prefix.capitalize()} {letters[index]}" for index in range(max(0, count))]
|
||||
@@ -1438,7 +1460,11 @@ def _subject_context(
|
||||
return _configured_cast_context(women_count, men_count)
|
||||
|
||||
if subject_type == "couple":
|
||||
primary_subject, subject_phrase, pose = g.choose(rng, g.COUPLE_TYPES)
|
||||
primary_subject, subject_phrase, pose, effective_women_count, effective_men_count = _couple_type_from_counts(
|
||||
rng,
|
||||
women_count,
|
||||
men_count,
|
||||
)
|
||||
return {
|
||||
"subject_type": "couple",
|
||||
"subject": primary_subject,
|
||||
@@ -1450,6 +1476,9 @@ def _subject_context(
|
||||
"eyes": "",
|
||||
"body_phrase": "",
|
||||
"fallback_pose": pose,
|
||||
"women_count": str(effective_women_count),
|
||||
"men_count": str(effective_men_count),
|
||||
"person_count": "2",
|
||||
}
|
||||
|
||||
if subject_type == "group":
|
||||
|
||||
Reference in New Issue
Block a user