Add Krea2 POV prompt restore node

This commit is contained in:
2026-06-30 22:42:59 +02:00
parent 337bbb10f1
commit 665a23a7b2
3 changed files with 181 additions and 1 deletions
+60
View File
@@ -13,6 +13,7 @@ try:
hardcore_position_focus_choices,
hardcore_position_key_choices,
hardcore_position_summary,
normalize_restore_prompt_axes,
parse_hardcore_position_config,
)
except ImportError: # Allows local smoke tests from the repository root.
@@ -26,6 +27,7 @@ except ImportError: # Allows local smoke tests from the repository root.
hardcore_position_focus_choices,
hardcore_position_key_choices,
hardcore_position_summary,
normalize_restore_prompt_axes,
parse_hardcore_position_config,
)
@@ -339,6 +341,62 @@ class SxCPKrea2POVInteractionFilter(_SxCPKrea2POVVariantFilter):
POSITION_FAMILY = "interaction"
class SxCPKrea2POVPromptRestore:
CLOTHING_AXES = ["clothing_detail"]
FACE_EXPRESSION_AXES = ["face_detail", "expression_detail", "mouth_detail", "reaction_detail"]
BODY_TOUCH_AXES = ["body_contact", "hand_detail", "touch_detail", "foreplay_detail"]
CAMERA_PRESENTATION_AXES = ["performance_act", "visibility", "angle"]
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"hardcore_position_config": (SXCP_HARDCORE_POSITION_CONFIG,),
"restore_clothing_detail": ("BOOLEAN", {"default": True}),
"restore_face_expression_detail": ("BOOLEAN", {"default": True}),
"restore_body_touch_detail": ("BOOLEAN", {"default": False}),
"restore_camera_presentation_detail": ("BOOLEAN", {"default": False}),
"relax_non_pose_axis_conflicts": ("BOOLEAN", {"default": True}),
}
}
RETURN_TYPES = (SXCP_HARDCORE_POSITION_CONFIG, "STRING")
RETURN_NAMES = ("hardcore_position_config", "summary")
FUNCTION = "build"
CATEGORY = "prompt_builder"
def build(
self,
hardcore_position_config,
restore_clothing_detail=True,
restore_face_expression_detail=True,
restore_body_touch_detail=False,
restore_camera_presentation_detail=False,
relax_non_pose_axis_conflicts=True,
):
config = parse_hardcore_position_config(hardcore_position_config)
axes: list[str] = []
if restore_clothing_detail:
axes.extend(self.CLOTHING_AXES)
config["allow_foreplay"] = True
config["allow_interaction"] = True
if restore_face_expression_detail:
axes.extend(self.FACE_EXPRESSION_AXES)
config["allow_foreplay"] = True
config["allow_interaction"] = True
if restore_body_touch_detail:
axes.extend(self.BODY_TOUCH_AXES)
config["allow_foreplay"] = True
config["allow_interaction"] = True
if restore_camera_presentation_detail:
axes.extend(self.CAMERA_PRESENTATION_AXES)
config["allow_interaction"] = True
config["restore_prompt_axes"] = normalize_restore_prompt_axes(axes)
config["relax_non_pose_axis_conflicts"] = bool(relax_non_pose_axis_conflicts)
config["summary"] = hardcore_position_summary(config)
return json.dumps(config, ensure_ascii=True, sort_keys=True), str(config["summary"])
class SxCPKrea2VariantEvidence:
@classmethod
def INPUT_TYPES(cls):
@@ -462,6 +520,7 @@ NODE_CLASS_MAPPINGS = {
"SxCPKrea2POVToyFilter": SxCPKrea2POVToyFilter,
"SxCPKrea2POVClimaxFilter": SxCPKrea2POVClimaxFilter,
"SxCPKrea2POVInteractionFilter": SxCPKrea2POVInteractionFilter,
"SxCPKrea2POVPromptRestore": SxCPKrea2POVPromptRestore,
"SxCPKrea2VariantEvidence": SxCPKrea2VariantEvidence,
}
@@ -476,5 +535,6 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"SxCPKrea2POVToyFilter": "SxCP Krea2 POV Toy Filter",
"SxCPKrea2POVClimaxFilter": "SxCP Krea2 POV Climax Filter",
"SxCPKrea2POVInteractionFilter": "SxCP Krea2 POV Interaction Filter",
"SxCPKrea2POVPromptRestore": "SxCP Krea2 POV Prompt Restore",
"SxCPKrea2VariantEvidence": "SxCP Krea2 Variant Evidence",
}