Add chainable character slot controls
This commit is contained in:
+88
@@ -7,6 +7,7 @@ try:
|
||||
build_camera_config_json,
|
||||
build_cast_config_json,
|
||||
build_category_config_json,
|
||||
build_character_slot_json,
|
||||
build_character_profile_json,
|
||||
build_filter_config_json,
|
||||
build_generation_profile_json,
|
||||
@@ -28,6 +29,11 @@ try:
|
||||
cast_preset_choices,
|
||||
category_preset_choices,
|
||||
category_choices,
|
||||
character_age_choices,
|
||||
character_body_choices,
|
||||
character_ethnicity_choices,
|
||||
character_figure_choices,
|
||||
character_label_choices,
|
||||
character_profile_choices,
|
||||
ethnicity_choices,
|
||||
generation_profile_choices,
|
||||
@@ -41,6 +47,7 @@ except ImportError:
|
||||
build_camera_config_json,
|
||||
build_cast_config_json,
|
||||
build_category_config_json,
|
||||
build_character_slot_json,
|
||||
build_character_profile_json,
|
||||
build_filter_config_json,
|
||||
build_generation_profile_json,
|
||||
@@ -62,6 +69,11 @@ except ImportError:
|
||||
cast_preset_choices,
|
||||
category_preset_choices,
|
||||
category_choices,
|
||||
character_age_choices,
|
||||
character_body_choices,
|
||||
character_ethnicity_choices,
|
||||
character_figure_choices,
|
||||
character_label_choices,
|
||||
character_profile_choices,
|
||||
ethnicity_choices,
|
||||
generation_profile_choices,
|
||||
@@ -99,6 +111,7 @@ class SxCPPromptBuilder:
|
||||
"seed_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_profile": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
"extra_positive": ("STRING", {"default": "", "multiline": True}),
|
||||
"extra_negative": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
@@ -131,6 +144,7 @@ class SxCPPromptBuilder:
|
||||
seed_config="",
|
||||
camera_config="",
|
||||
character_profile="",
|
||||
character_cast="",
|
||||
extra_positive="",
|
||||
extra_negative="",
|
||||
no_plus_women=False,
|
||||
@@ -161,6 +175,7 @@ class SxCPPromptBuilder:
|
||||
seed_config=seed_config or "",
|
||||
camera_config=camera_config or "",
|
||||
character_profile=character_profile or "",
|
||||
character_cast=character_cast or "",
|
||||
)
|
||||
return (
|
||||
row["prompt"],
|
||||
@@ -474,6 +489,7 @@ class SxCPPromptBuilderFromConfigs:
|
||||
"seed_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_profile": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
"extra_positive": ("STRING", {"default": "", "multiline": True}),
|
||||
"extra_negative": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
@@ -496,6 +512,7 @@ class SxCPPromptBuilderFromConfigs:
|
||||
seed_config="",
|
||||
camera_config="",
|
||||
character_profile="",
|
||||
character_cast="",
|
||||
extra_positive="",
|
||||
extra_negative="",
|
||||
):
|
||||
@@ -510,6 +527,7 @@ class SxCPPromptBuilderFromConfigs:
|
||||
seed_config=seed_config or "",
|
||||
camera_config=camera_config or "",
|
||||
character_profile=character_profile or "",
|
||||
character_cast=character_cast or "",
|
||||
extra_positive=extra_positive or "",
|
||||
extra_negative=extra_negative or "",
|
||||
)
|
||||
@@ -523,6 +541,71 @@ class SxCPPromptBuilderFromConfigs:
|
||||
)
|
||||
|
||||
|
||||
class SxCPCharacterSlot:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"enabled": ("BOOLEAN", {"default": True}),
|
||||
"subject_type": (["woman", "man"], {"default": "woman"}),
|
||||
"label": (character_label_choices(), {"default": "auto_chain"}),
|
||||
"age": (character_age_choices(), {"default": "random"}),
|
||||
"manual_age": ("STRING", {"default": ""}),
|
||||
"ethnicity": (character_ethnicity_choices(), {"default": "random"}),
|
||||
"figure": (character_figure_choices(), {"default": "random"}),
|
||||
"body": (character_body_choices(), {"default": "random"}),
|
||||
"manual_body": ("STRING", {"default": ""}),
|
||||
"body_phrase": ("STRING", {"default": ""}),
|
||||
"skin": ("STRING", {"default": ""}),
|
||||
"hair": ("STRING", {"default": ""}),
|
||||
"eyes": ("STRING", {"default": ""}),
|
||||
},
|
||||
"optional": {
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING", "STRING", "STRING", "STRING")
|
||||
RETURN_NAMES = ("character_cast", "character_slot", "summary", "status")
|
||||
FUNCTION = "build"
|
||||
CATEGORY = "prompt_builder"
|
||||
|
||||
def build(
|
||||
self,
|
||||
enabled,
|
||||
subject_type,
|
||||
label,
|
||||
age,
|
||||
manual_age,
|
||||
ethnicity,
|
||||
figure,
|
||||
body,
|
||||
manual_body,
|
||||
body_phrase,
|
||||
skin,
|
||||
hair,
|
||||
eyes,
|
||||
character_cast="",
|
||||
):
|
||||
result = build_character_slot_json(
|
||||
subject_type=subject_type,
|
||||
label=label,
|
||||
age=age,
|
||||
manual_age=manual_age,
|
||||
ethnicity=ethnicity,
|
||||
figure=figure,
|
||||
body=body,
|
||||
manual_body=manual_body,
|
||||
body_phrase=body_phrase,
|
||||
skin=skin,
|
||||
hair=hair,
|
||||
eyes=eyes,
|
||||
enabled=enabled,
|
||||
character_cast=character_cast or "",
|
||||
)
|
||||
return result["character_cast"], result["character_slot"], result["summary"], result["status"]
|
||||
|
||||
|
||||
class SxCPCharacterProfileSave:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -821,6 +904,7 @@ class SxCPInstaOFPromptPair:
|
||||
"filter_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_profile": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
"extra_positive": ("STRING", {"default": "", "multiline": True}),
|
||||
"extra_negative": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
@@ -854,6 +938,7 @@ class SxCPInstaOFPromptPair:
|
||||
filter_config="",
|
||||
camera_config="",
|
||||
character_profile="",
|
||||
character_cast="",
|
||||
extra_positive="",
|
||||
extra_negative="",
|
||||
no_plus_women=False,
|
||||
@@ -874,6 +959,7 @@ class SxCPInstaOFPromptPair:
|
||||
filter_config=filter_config or "",
|
||||
camera_config=camera_config or "",
|
||||
character_profile=character_profile or "",
|
||||
character_cast=character_cast or "",
|
||||
extra_positive=extra_positive or "",
|
||||
extra_negative=extra_negative or "",
|
||||
)
|
||||
@@ -899,6 +985,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"SxCPGenerationProfile": SxCPGenerationProfile,
|
||||
"SxCPAdvancedFilters": SxCPAdvancedFilters,
|
||||
"SxCPPromptBuilderFromConfigs": SxCPPromptBuilderFromConfigs,
|
||||
"SxCPCharacterSlot": SxCPCharacterSlot,
|
||||
"SxCPCharacterProfileSave": SxCPCharacterProfileSave,
|
||||
"SxCPCharacterProfileLoad": SxCPCharacterProfileLoad,
|
||||
"SxCPCaptionNaturalizer": SxCPCaptionNaturalizer,
|
||||
@@ -917,6 +1004,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"SxCPGenerationProfile": "SxCP Generation Profile",
|
||||
"SxCPAdvancedFilters": "SxCP Advanced Filters",
|
||||
"SxCPPromptBuilderFromConfigs": "SxCP Prompt Builder From Configs",
|
||||
"SxCPCharacterSlot": "SxCP Character Slot",
|
||||
"SxCPCharacterProfileSave": "SxCP Character Profile Save",
|
||||
"SxCPCharacterProfileLoad": "SxCP Character Profile Load",
|
||||
"SxCPCaptionNaturalizer": "SxCP Caption Naturalizer",
|
||||
|
||||
Reference in New Issue
Block a user