Add Krea2 POV prompt restore node
This commit is contained in:
@@ -217,6 +217,20 @@ HARDCORE_POSITION_AXIS_KEYS = {
|
||||
"aftercare_act",
|
||||
"cleanup_detail",
|
||||
}
|
||||
RESTORE_PROMPT_AXIS_CHOICES = [
|
||||
"clothing_detail",
|
||||
"face_detail",
|
||||
"expression_detail",
|
||||
"mouth_detail",
|
||||
"reaction_detail",
|
||||
"body_contact",
|
||||
"hand_detail",
|
||||
"touch_detail",
|
||||
"foreplay_detail",
|
||||
"performance_act",
|
||||
"visibility",
|
||||
"angle",
|
||||
]
|
||||
HARDCORE_SOURCE_FAMILY_BY_SUBCATEGORY = {
|
||||
"penetrative_sex": "penetrative",
|
||||
"foreplay_teasing": "foreplay",
|
||||
@@ -264,6 +278,16 @@ def _list_from(value: Any) -> list[Any]:
|
||||
return [value]
|
||||
|
||||
|
||||
def normalize_restore_prompt_axes(values: Any) -> list[str]:
|
||||
allowed = set(RESTORE_PROMPT_AXIS_CHOICES)
|
||||
normalized: list[str] = []
|
||||
for value in _list_from(values):
|
||||
text = str(value or "").strip()
|
||||
if text in allowed and text not in normalized:
|
||||
normalized.append(text)
|
||||
return normalized
|
||||
|
||||
|
||||
def _entry_text(item: Any) -> str:
|
||||
if isinstance(item, dict):
|
||||
return str(
|
||||
@@ -376,6 +400,8 @@ def empty_hardcore_position_config() -> dict[str, Any]:
|
||||
"allow_outercourse": True,
|
||||
"allow_anal": True,
|
||||
"allow_climax": True,
|
||||
"restore_prompt_axes": [],
|
||||
"relax_non_pose_axis_conflicts": False,
|
||||
}
|
||||
|
||||
|
||||
@@ -409,6 +435,8 @@ def parse_hardcore_position_config(value: str | dict[str, Any] | None) -> dict[s
|
||||
"allow_climax",
|
||||
):
|
||||
parsed[key] = not _is_false(parsed.get(key, True))
|
||||
parsed["restore_prompt_axes"] = normalize_restore_prompt_axes(parsed.get("restore_prompt_axes"))
|
||||
parsed["relax_non_pose_axis_conflicts"] = not _is_false(parsed.get("relax_non_pose_axis_conflicts", False))
|
||||
return parsed
|
||||
|
||||
|
||||
@@ -439,6 +467,11 @@ def hardcore_position_summary(config: dict[str, Any]) -> str:
|
||||
]
|
||||
if disabled:
|
||||
parts.append("blocked=" + ",".join(disabled))
|
||||
restore_axes = normalize_restore_prompt_axes(config.get("restore_prompt_axes"))
|
||||
if restore_axes:
|
||||
parts.append("restore_axes=" + ",".join(restore_axes))
|
||||
if restore_axes and config.get("relax_non_pose_axis_conflicts"):
|
||||
parts.append("relaxed_non_pose_conflicts")
|
||||
return "; ".join(parts)
|
||||
|
||||
|
||||
@@ -787,6 +820,14 @@ def hardcore_position_entry_conflicts(entry: Any, config: dict[str, Any]) -> boo
|
||||
return bool(matched) and not bool(matched & selected)
|
||||
|
||||
|
||||
def restored_prompt_axis_relaxes_conflicts(axis_name: str, config: dict[str, Any]) -> bool:
|
||||
if str(axis_name or "") in HARDCORE_POSITION_AXIS_KEYS:
|
||||
return False
|
||||
if not config.get("relax_non_pose_axis_conflicts"):
|
||||
return False
|
||||
return str(axis_name or "") in set(normalize_restore_prompt_axes(config.get("restore_prompt_axes")))
|
||||
|
||||
|
||||
def hardcore_subcategory_supports_positions(subcategory: dict[str, Any], config: dict[str, Any]) -> bool:
|
||||
if not hardcore_position_template_required(config):
|
||||
return True
|
||||
@@ -809,7 +850,11 @@ def filter_hardcore_axis(axis_name: str, values: list[Any], config: dict[str, An
|
||||
value
|
||||
for value in values
|
||||
if not hardcore_entry_blocked_by_action(value, axis_name, config)
|
||||
and not (axis_name not in HARDCORE_POSITION_AXIS_KEYS and hardcore_position_entry_conflicts(value, config))
|
||||
and not (
|
||||
axis_name not in HARDCORE_POSITION_AXIS_KEYS
|
||||
and not restored_prompt_axis_relaxes_conflicts(axis_name, config)
|
||||
and hardcore_position_entry_conflicts(value, config)
|
||||
)
|
||||
and (axis_name not in HARDCORE_POSITION_AXIS_KEYS or hardcore_position_entry_matches(value, config))
|
||||
]
|
||||
return filtered or values
|
||||
|
||||
Reference in New Issue
Block a user