Add atlas refine cue seed workflow
This commit is contained in:
+27
-1
@@ -716,6 +716,19 @@ def _axis_values_with_krea2_variant_keys(
|
||||
return axis_values
|
||||
merged = dict(axis_values)
|
||||
merged["krea2_variant_keys"] = [str(key) for key in variant_keys if str(key).strip()]
|
||||
prompt_variant_indices = hardcore_position_config.get("krea2_prompt_variant_indices")
|
||||
if isinstance(prompt_variant_indices, dict):
|
||||
normalized_indices: dict[str, int] = {}
|
||||
for key, value in prompt_variant_indices.items():
|
||||
key_text = str(key or "").strip()
|
||||
if not key_text:
|
||||
continue
|
||||
try:
|
||||
normalized_indices[key_text] = int(value)
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
if normalized_indices:
|
||||
merged["krea2_prompt_variant_indices"] = normalized_indices
|
||||
return merged
|
||||
|
||||
|
||||
@@ -730,12 +743,25 @@ def _axis_values_with_krea2_prompt_variant_indices(
|
||||
if not isinstance(variant_keys, list) or not variant_keys:
|
||||
return axis_values
|
||||
rng = seed_policy.axis_rng(seed_config, "pose", seed, row_number)
|
||||
existing_indices = axis_values.get("krea2_prompt_variant_indices") if isinstance(axis_values, dict) else {}
|
||||
indices: dict[str, int] = {}
|
||||
if isinstance(existing_indices, dict):
|
||||
for key, value in existing_indices.items():
|
||||
key_text = str(key or "").strip()
|
||||
if not key_text:
|
||||
continue
|
||||
try:
|
||||
indices[key_text] = int(value)
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
for key in variant_keys:
|
||||
key_text = str(key)
|
||||
if key_text in indices:
|
||||
continue
|
||||
variant = krea2_pose_variant_catalog.get_variant(str(key))
|
||||
cue_sets = krea2_pose_variant_catalog.prompt_cue_sets(variant)
|
||||
if len(cue_sets) > 1:
|
||||
indices[str(key)] = rng.randrange(len(cue_sets))
|
||||
indices[key_text] = rng.randrange(len(cue_sets))
|
||||
if not indices:
|
||||
return axis_values
|
||||
merged = dict(axis_values)
|
||||
|
||||
Reference in New Issue
Block a user