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
+7 -6
View File
@@ -3232,8 +3232,9 @@ def make_group_or_layout(index: int, batch: int, rng: random.Random, expr_deck:
return row
def build_rows(total: int, start_index: int, clothing: str = "full", ethnicity: str = "any", poses: str = "standard", backside_bias: float = 0.0, figure: str = "curvy", no_plus: bool = False, no_black: bool = False, minimal_clothing_ratio: float | None = None, standard_pose_ratio: float | None = None, seed: int = DEFAULT_RNG_SEED, expression_seed: int = EXPRESSION_SEED) -> list[dict]:
def build_rows(total: int, start_index: int, clothing: str = "full", ethnicity: str = "any", poses: str = "standard", backside_bias: float = 0.0, figure: str = "curvy", no_plus: bool = False, no_black: bool = False, minimal_clothing_ratio: float | None = None, standard_pose_ratio: float | None = None, seed: int = DEFAULT_RNG_SEED, expression_seed: int = EXPRESSION_SEED, clothing_rng: random.Random | None = None) -> list[dict]:
rng = random.Random(seed)
wardrobe_rng = clothing_rng or rng
expr_deck = ExpressionDeck(EXPRESSIONS, random.Random(expression_seed))
rows: list[dict] = []
batch_quotas = batch_category_quotas()
@@ -3245,21 +3246,21 @@ def build_rows(total: int, start_index: int, clothing: str = "full", ethnicity:
index = start_index
for batch in range(1, batch_count + 1):
batch_rows: list[dict] = []
clothing_modes = batch_clothing_modes(rng, clothing, minimal_clothing_ratio)
clothing_modes = batch_clothing_modes(wardrobe_rng, clothing, minimal_clothing_ratio)
single_pose_modes = batch_single_pose_modes(rng, poses, standard_pose_ratio, single_subject_count)
for category, count in batch_quotas:
for _ in range(count):
row_clothing = clothing_modes.pop()
if category == "woman":
row_pose = single_pose_modes.pop()
row = make_single(index, batch, rng, "woman", expr_deck, row_clothing, ethnicity, row_pose, backside_bias, figure, no_plus, no_black)
row = make_single(index, batch, rng, "woman", expr_deck, row_clothing, ethnicity, row_pose, backside_bias, figure, no_plus, no_black, clothing_rng=wardrobe_rng if clothing_rng else None)
elif category == "man":
row_pose = single_pose_modes.pop()
row = make_single(index, batch, rng, "man", expr_deck, row_clothing, ethnicity, row_pose, backside_bias, figure, no_plus, no_black)
row = make_single(index, batch, rng, "man", expr_deck, row_clothing, ethnicity, row_pose, backside_bias, figure, no_plus, no_black, clothing_rng=wardrobe_rng if clothing_rng else None)
elif category == "couple":
row = make_couple(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus)
row = make_couple(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus, clothing_rng=wardrobe_rng if clothing_rng else None)
else:
row = make_group_or_layout(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus)
row = make_group_or_layout(index, batch, rng, expr_deck, row_clothing, ethnicity, no_plus, clothing_rng=wardrobe_rng if clothing_rng else None)
batch_rows.append(row)
index += 1
rng.shuffle(batch_rows)