Fixed optional params
This commit is contained in:
@@ -225,7 +225,21 @@ class txt2img:
|
||||
def VALIDATE_INPUTS(cls, **kwargs):
|
||||
positivePrompt = kwargs.get("positivePrompt", "")
|
||||
negativePrompt = kwargs.get("negativePrompt", "")
|
||||
|
||||
settings = kwargs.get("settings")
|
||||
|
||||
structured_prompt = None
|
||||
if isinstance(settings, dict):
|
||||
structured_prompt = settings.get("structuredPrompt")
|
||||
has_structured_prompt = (
|
||||
isinstance(structured_prompt, dict) and len(structured_prompt) > 0
|
||||
)
|
||||
has_positive_prompt = bool(positivePrompt and str(positivePrompt).strip())
|
||||
if has_structured_prompt and has_positive_prompt:
|
||||
return (
|
||||
"settings.structuredPrompt and positivePrompt are mutually exclusive. "
|
||||
"Clear positivePrompt or disconnect Structured Prompt from Settings."
|
||||
)
|
||||
|
||||
# Only validate positivePrompt length if it's provided
|
||||
if positivePrompt and len(positivePrompt) > 10000:
|
||||
return "Positive Prompt is too long. Maximum length is 10000 characters."
|
||||
|
||||
@@ -17,11 +17,6 @@ class RunwareImageInferenceSettingsStructuredPrompt:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
optional: Dict[str, tuple] = {
|
||||
"high_level_description": ("STRING", {
|
||||
"multiline": True,
|
||||
"default": "",
|
||||
"tooltip": "Global scene summary (required).",
|
||||
}),
|
||||
"background": ("STRING", {
|
||||
"multiline": True,
|
||||
"default": "",
|
||||
@@ -81,7 +76,14 @@ class RunwareImageInferenceSettingsStructuredPrompt:
|
||||
"tooltip": f"Element {i} optional hex colours, comma-separated (e.g. #1F3B26,#7A5A2F).",
|
||||
})
|
||||
|
||||
return {"required": {}, "optional": optional}
|
||||
required = {
|
||||
"high_level_description": ("STRING", {
|
||||
"multiline": True,
|
||||
"default": "",
|
||||
"tooltip": "Global scene summary (required).",
|
||||
}),
|
||||
}
|
||||
return {"required": required, "optional": optional}
|
||||
|
||||
RETURN_TYPES = ("RUNWAREIMAGEINFERENCESTRUCTUREDPROMPT",)
|
||||
RETURN_NAMES = ("structuredPrompt",)
|
||||
|
||||
Reference in New Issue
Block a user