Synchronize pair side metadata

This commit is contained in:
2026-06-27 02:32:38 +02:00
parent cfe11a4634
commit ab2a13ecde
4 changed files with 65 additions and 5 deletions
+24
View File
@@ -119,10 +119,34 @@ def synchronize_pair_row_outputs(pair: dict[str, Any]) -> dict[str, Any]:
return pair
def synchronize_pair_side_metadata(pair: dict[str, Any]) -> dict[str, Any]:
side_keys = {
"softcore_row": (
"softcore_partner_styling",
),
"hardcore_row": (
"hardcore_clothing_state",
"character_hardcore_clothing",
"default_man_hardcore_clothing",
"hardcore_detail_density",
"hardcore_position_config",
),
}
for row_key, keys in side_keys.items():
row = pair.get(row_key)
if not isinstance(row, dict):
continue
for key in keys:
if key in pair:
row[key] = pair.get(key)
return pair
def normalize_pair_metadata(pair: dict[str, Any], *, active_trigger: str = "") -> dict[str, Any]:
trigger = str(active_trigger or "").strip()
triggers = _trigger_tuple(trigger)
synchronize_pair_row_outputs(pair)
synchronize_pair_side_metadata(pair)
for key in ("softcore_prompt", "hardcore_prompt"):
if key in pair:
pair[key] = sanitize_prompt_text(pair.get(key, ""), triggers=triggers)