Add Krea2 formatting and scalable scene pools

This commit is contained in:
2026-06-24 10:23:24 +02:00
parent 00ac8be640
commit 89af926a5a
9 changed files with 1191 additions and 23 deletions
+73
View File
@@ -21,6 +21,7 @@ try:
subcategory_choices,
)
from .caption_naturalizer import naturalize_caption
from .krea_formatter import format_krea2_prompt
except ImportError:
from prompt_builder import (
build_camera_config_json,
@@ -40,6 +41,7 @@ except ImportError:
subcategory_choices,
)
from caption_naturalizer import naturalize_caption
from krea_formatter import format_krea2_prompt
class SxCPPromptBuilder:
@@ -277,6 +279,75 @@ class SxCPCaptionNaturalizer:
)
class SxCPKrea2Formatter:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"source_text": ("STRING", {"default": "", "multiline": True}),
"input_hint": (["auto", "metadata_json", "prompt"], {"default": "auto"}),
"target": (["auto", "single", "softcore", "hardcore"], {"default": "auto"}),
"detail_level": (["balanced", "concise", "dense"], {"default": "balanced"}),
"style_mode": (["preserve", "photographic", "minimal"], {"default": "preserve"}),
"preserve_trigger": ("BOOLEAN", {"default": False}),
},
"optional": {
"metadata_json": ("STRING", {"default": "", "multiline": True}),
"negative_prompt": ("STRING", {"default": "", "multiline": True}),
"extra_positive": ("STRING", {"default": "", "multiline": True}),
"extra_negative": ("STRING", {"default": "", "multiline": True}),
},
}
RETURN_TYPES = ("STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING")
RETURN_NAMES = (
"krea_prompt",
"negative_prompt",
"krea_softcore_prompt",
"krea_hardcore_prompt",
"softcore_negative_prompt",
"hardcore_negative_prompt",
"method",
)
FUNCTION = "build"
CATEGORY = "prompt_builder"
def build(
self,
source_text,
input_hint,
target,
detail_level,
style_mode,
preserve_trigger,
metadata_json="",
negative_prompt="",
extra_positive="",
extra_negative="",
):
row = format_krea2_prompt(
source_text=source_text or "",
metadata_json=metadata_json or "",
negative_prompt=negative_prompt or "",
input_hint=input_hint,
target=target,
detail_level=detail_level,
style_mode=style_mode,
preserve_trigger=preserve_trigger,
extra_positive=extra_positive or "",
extra_negative=extra_negative or "",
)
return (
row["krea_prompt"],
row["negative_prompt"],
row["krea_softcore_prompt"],
row["krea_hardcore_prompt"],
row["softcore_negative_prompt"],
row["hardcore_negative_prompt"],
row["method"],
)
class SxCPInstaOFOptions:
@classmethod
def INPUT_TYPES(cls):
@@ -417,6 +488,7 @@ NODE_CLASS_MAPPINGS = {
"SxCPSeedControl": SxCPSeedControl,
"SxCPCameraControl": SxCPCameraControl,
"SxCPCaptionNaturalizer": SxCPCaptionNaturalizer,
"SxCPKrea2Formatter": SxCPKrea2Formatter,
"SxCPInstaOFOptions": SxCPInstaOFOptions,
"SxCPInstaOFPromptPair": SxCPInstaOFPromptPair,
}
@@ -426,6 +498,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"SxCPSeedControl": "SxCP Seed Control",
"SxCPCameraControl": "SxCP Camera Control",
"SxCPCaptionNaturalizer": "SxCP Caption Naturalizer",
"SxCPKrea2Formatter": "SxCP Krea2 Formatter",
"SxCPInstaOFOptions": "SxCP Insta/OF Options",
"SxCPInstaOFPromptPair": "SxCP Insta/OF Prompt Pair",
}