Synchronize pair side metadata
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user