Add ethnicity list node and regional filters
This commit is contained in:
+115
-6
@@ -20,6 +20,7 @@ try:
|
||||
build_category_config_json,
|
||||
build_character_slot_json,
|
||||
build_character_profile_json,
|
||||
build_ethnicity_list_json,
|
||||
build_filter_config_json,
|
||||
build_generation_profile_json,
|
||||
build_insta_of_options_json,
|
||||
@@ -72,6 +73,7 @@ except ImportError:
|
||||
build_category_config_json,
|
||||
build_character_slot_json,
|
||||
build_character_profile_json,
|
||||
build_ethnicity_list_json,
|
||||
build_filter_config_json,
|
||||
build_generation_profile_json,
|
||||
build_insta_of_options_json,
|
||||
@@ -155,6 +157,7 @@ class SxCPPromptBuilder:
|
||||
"prepend_trigger_to_prompt": ("BOOLEAN", {"default": True}),
|
||||
},
|
||||
"optional": {
|
||||
"ethnicity_list": ("STRING", {"default": "", "multiline": True}),
|
||||
"seed_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_profile": ("STRING", {"default": "", "multiline": True}),
|
||||
@@ -197,6 +200,7 @@ class SxCPPromptBuilder:
|
||||
extra_negative="",
|
||||
no_plus_women=False,
|
||||
no_black=False,
|
||||
ethnicity_list="",
|
||||
):
|
||||
row = build_prompt(
|
||||
category=category,
|
||||
@@ -205,7 +209,7 @@ class SxCPPromptBuilder:
|
||||
start_index=start_index,
|
||||
seed=seed,
|
||||
clothing=clothing,
|
||||
ethnicity=ethnicity,
|
||||
ethnicity=ethnicity_list or ethnicity,
|
||||
poses=poses,
|
||||
expression_enabled=expression_enabled,
|
||||
expression_intensity=expression_intensity,
|
||||
@@ -700,6 +704,99 @@ class SxCPAdvancedFilters:
|
||||
)
|
||||
|
||||
|
||||
class SxCPEthnicityList:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"include_european": ("BOOLEAN", {"default": False}),
|
||||
"include_mediterranean_mena": ("BOOLEAN", {"default": False}),
|
||||
"include_latina": ("BOOLEAN", {"default": False}),
|
||||
"include_east_asian": ("BOOLEAN", {"default": False}),
|
||||
"include_southeast_asian": ("BOOLEAN", {"default": False}),
|
||||
"include_south_asian": ("BOOLEAN", {"default": False}),
|
||||
"include_black_african": ("BOOLEAN", {"default": False}),
|
||||
"include_indigenous": ("BOOLEAN", {"default": False}),
|
||||
"include_mixed": ("BOOLEAN", {"default": False}),
|
||||
"include_asian": ("BOOLEAN", {"default": False}),
|
||||
"include_white_asian": ("BOOLEAN", {"default": False}),
|
||||
"include_western_european": ("BOOLEAN", {"default": False}),
|
||||
"include_french_european": ("BOOLEAN", {"default": False}),
|
||||
"include_germanic_european": ("BOOLEAN", {"default": False}),
|
||||
"include_nordic_european": ("BOOLEAN", {"default": False}),
|
||||
"include_celtic_european": ("BOOLEAN", {"default": False}),
|
||||
"include_slavic_european": ("BOOLEAN", {"default": False}),
|
||||
"include_baltic_european": ("BOOLEAN", {"default": False}),
|
||||
"include_alpine_european": ("BOOLEAN", {"default": False}),
|
||||
"include_balkan_european": ("BOOLEAN", {"default": False}),
|
||||
"include_greek_mediterranean": ("BOOLEAN", {"default": False}),
|
||||
"include_italian_mediterranean": ("BOOLEAN", {"default": False}),
|
||||
"include_iberian_mediterranean": ("BOOLEAN", {"default": False}),
|
||||
"strict_excludes": ("BOOLEAN", {"default": True}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING", "STRING", "STRING")
|
||||
RETURN_NAMES = ("ethnicity", "filter_config", "summary")
|
||||
FUNCTION = "build"
|
||||
CATEGORY = "prompt_builder"
|
||||
|
||||
def build(
|
||||
self,
|
||||
include_european,
|
||||
include_mediterranean_mena,
|
||||
include_latina,
|
||||
include_east_asian,
|
||||
include_southeast_asian,
|
||||
include_south_asian,
|
||||
include_black_african,
|
||||
include_indigenous,
|
||||
include_mixed,
|
||||
include_asian,
|
||||
include_white_asian,
|
||||
include_western_european,
|
||||
include_french_european,
|
||||
include_germanic_european,
|
||||
include_nordic_european,
|
||||
include_celtic_european,
|
||||
include_slavic_european,
|
||||
include_baltic_european,
|
||||
include_alpine_european,
|
||||
include_balkan_european,
|
||||
include_greek_mediterranean,
|
||||
include_italian_mediterranean,
|
||||
include_iberian_mediterranean,
|
||||
strict_excludes,
|
||||
):
|
||||
result = build_ethnicity_list_json(
|
||||
include_european=include_european,
|
||||
include_mediterranean_mena=include_mediterranean_mena,
|
||||
include_latina=include_latina,
|
||||
include_east_asian=include_east_asian,
|
||||
include_southeast_asian=include_southeast_asian,
|
||||
include_south_asian=include_south_asian,
|
||||
include_black_african=include_black_african,
|
||||
include_indigenous=include_indigenous,
|
||||
include_mixed=include_mixed,
|
||||
include_asian=include_asian,
|
||||
include_white_asian=include_white_asian,
|
||||
include_western_european=include_western_european,
|
||||
include_french_european=include_french_european,
|
||||
include_germanic_european=include_germanic_european,
|
||||
include_nordic_european=include_nordic_european,
|
||||
include_celtic_european=include_celtic_european,
|
||||
include_slavic_european=include_slavic_european,
|
||||
include_baltic_european=include_baltic_european,
|
||||
include_alpine_european=include_alpine_european,
|
||||
include_balkan_european=include_balkan_european,
|
||||
include_greek_mediterranean=include_greek_mediterranean,
|
||||
include_italian_mediterranean=include_italian_mediterranean,
|
||||
include_iberian_mediterranean=include_iberian_mediterranean,
|
||||
strict_excludes=strict_excludes,
|
||||
)
|
||||
return result["ethnicity"], result["filter_config"], result["summary"]
|
||||
|
||||
|
||||
class SxCPPromptBuilderFromConfigs:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -714,6 +811,7 @@ class SxCPPromptBuilderFromConfigs:
|
||||
"cast_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"generation_profile": ("STRING", {"default": "", "multiline": True}),
|
||||
"filter_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"ethnicity_list": ("STRING", {"default": "", "multiline": True}),
|
||||
"seed_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_profile": ("STRING", {"default": "", "multiline": True}),
|
||||
@@ -737,6 +835,7 @@ class SxCPPromptBuilderFromConfigs:
|
||||
cast_config="",
|
||||
generation_profile="",
|
||||
filter_config="",
|
||||
ethnicity_list="",
|
||||
seed_config="",
|
||||
camera_config="",
|
||||
character_profile="",
|
||||
@@ -751,7 +850,7 @@ class SxCPPromptBuilderFromConfigs:
|
||||
category_config=category_config or "",
|
||||
cast_config=cast_config or "",
|
||||
generation_profile=generation_profile or "",
|
||||
filter_config=filter_config or "",
|
||||
filter_config=ethnicity_list or filter_config or "",
|
||||
seed_config=seed_config or "",
|
||||
camera_config=camera_config or "",
|
||||
character_profile=character_profile or "",
|
||||
@@ -798,6 +897,7 @@ class SxCPCharacterSlot:
|
||||
"hardcore_clothing": ("STRING", {"default": ""}),
|
||||
},
|
||||
"optional": {
|
||||
"ethnicity_list": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
}
|
||||
@@ -832,6 +932,7 @@ class SxCPCharacterSlot:
|
||||
softcore_outfit="",
|
||||
hardcore_clothing="",
|
||||
character_cast="",
|
||||
ethnicity_list="",
|
||||
):
|
||||
result = build_character_slot_json(
|
||||
subject_type=subject_type,
|
||||
@@ -839,7 +940,7 @@ class SxCPCharacterSlot:
|
||||
slot_seed=slot_seed,
|
||||
age=age,
|
||||
manual_age=manual_age,
|
||||
ethnicity=ethnicity,
|
||||
ethnicity=ethnicity_list or ethnicity,
|
||||
figure=figure,
|
||||
body=body,
|
||||
manual_body=manual_body,
|
||||
@@ -888,6 +989,7 @@ class SxCPWomanSlot:
|
||||
"hardcore_clothing": ("STRING", {"default": ""}),
|
||||
},
|
||||
"optional": {
|
||||
"ethnicity_list": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
}
|
||||
@@ -920,6 +1022,7 @@ class SxCPWomanSlot:
|
||||
softcore_outfit="",
|
||||
hardcore_clothing="",
|
||||
character_cast="",
|
||||
ethnicity_list="",
|
||||
):
|
||||
result = build_character_slot_json(
|
||||
subject_type="woman",
|
||||
@@ -927,7 +1030,7 @@ class SxCPWomanSlot:
|
||||
slot_seed=slot_seed,
|
||||
age=age,
|
||||
manual_age=manual_age,
|
||||
ethnicity=ethnicity,
|
||||
ethnicity=ethnicity_list or ethnicity,
|
||||
figure=figure_bias,
|
||||
body=body,
|
||||
manual_body=manual_body,
|
||||
@@ -975,6 +1078,7 @@ class SxCPManSlot:
|
||||
"hardcore_clothing": ("STRING", {"default": ""}),
|
||||
},
|
||||
"optional": {
|
||||
"ethnicity_list": ("STRING", {"default": "", "multiline": True}),
|
||||
"character_cast": ("STRING", {"default": "", "multiline": True}),
|
||||
},
|
||||
}
|
||||
@@ -1007,6 +1111,7 @@ class SxCPManSlot:
|
||||
softcore_outfit="",
|
||||
hardcore_clothing="",
|
||||
character_cast="",
|
||||
ethnicity_list="",
|
||||
):
|
||||
result = build_character_slot_json(
|
||||
subject_type="man",
|
||||
@@ -1014,7 +1119,7 @@ class SxCPManSlot:
|
||||
slot_seed=slot_seed,
|
||||
age=age,
|
||||
manual_age=manual_age,
|
||||
ethnicity=ethnicity,
|
||||
ethnicity=ethnicity_list or ethnicity,
|
||||
figure="random",
|
||||
body=body,
|
||||
manual_body=manual_body,
|
||||
@@ -1397,6 +1502,7 @@ class SxCPInstaOFPromptPair:
|
||||
"seed_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"options_json": ("STRING", {"default": "", "multiline": True}),
|
||||
"filter_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"ethnicity_list": ("STRING", {"default": "", "multiline": True}),
|
||||
"camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"softcore_camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
"hardcore_camera_config": ("STRING", {"default": "", "multiline": True}),
|
||||
@@ -1433,6 +1539,7 @@ class SxCPInstaOFPromptPair:
|
||||
seed_config="",
|
||||
options_json="",
|
||||
filter_config="",
|
||||
ethnicity_list="",
|
||||
camera_config="",
|
||||
softcore_camera_config="",
|
||||
hardcore_camera_config="",
|
||||
@@ -1455,7 +1562,7 @@ class SxCPInstaOFPromptPair:
|
||||
prepend_trigger_to_prompt=prepend_trigger_to_prompt,
|
||||
seed_config=seed_config or "",
|
||||
options_json=options_json or "",
|
||||
filter_config=filter_config or "",
|
||||
filter_config=ethnicity_list or filter_config or "",
|
||||
camera_config=camera_config or "",
|
||||
softcore_camera_config=softcore_camera_config or "",
|
||||
hardcore_camera_config=hardcore_camera_config or "",
|
||||
@@ -1487,6 +1594,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"SxCPCategoryPreset": SxCPCategoryPreset,
|
||||
"SxCPCastControl": SxCPCastControl,
|
||||
"SxCPGenerationProfile": SxCPGenerationProfile,
|
||||
"SxCPEthnicityList": SxCPEthnicityList,
|
||||
"SxCPAdvancedFilters": SxCPAdvancedFilters,
|
||||
"SxCPPromptBuilderFromConfigs": SxCPPromptBuilderFromConfigs,
|
||||
"SxCPWomanSlot": SxCPWomanSlot,
|
||||
@@ -1512,6 +1620,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"SxCPCategoryPreset": "SxCP Category Preset",
|
||||
"SxCPCastControl": "SxCP Cast Control",
|
||||
"SxCPGenerationProfile": "SxCP Generation Profile",
|
||||
"SxCPEthnicityList": "SxCP Ethnicity List",
|
||||
"SxCPAdvancedFilters": "SxCP Advanced Filters",
|
||||
"SxCPPromptBuilderFromConfigs": "SxCP Prompt Builder From Configs",
|
||||
"SxCPWomanSlot": "SxCP Woman Slot",
|
||||
|
||||
Reference in New Issue
Block a user