From 6bfe8ba1f826eba98e2d1c51bc8bb4fe0f306855 Mon Sep 17 00:00:00 2001 From: Thomas Ward Date: Tue, 24 Sep 2024 12:24:08 -0400 Subject: [PATCH] Add dynamicInputs = FALSE nodes The comments on the original PR suggested it'd be nice to have nodes with dynamicInputs set to False for both of the String nodes. As such, I've created a dedicated node, and set the other string constants to dynamicInputs = True. --- comfy_extras/nodes_constant_values.py | 32 +++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/comfy_extras/nodes_constant_values.py b/comfy_extras/nodes_constant_values.py index f5dc30413..259d23697 100644 --- a/comfy_extras/nodes_constant_values.py +++ b/comfy_extras/nodes_constant_values.py @@ -50,7 +50,7 @@ class ConstantString(_CONSTANT_BASE): def INPUT_TYPES(s) -> dict: return { "required" : { - "value": ("STRING", {"multiline": False}) + "value": ("STRING", {"multiline": False, "dynamicPrompts": True}) } } @@ -63,7 +63,33 @@ class ConstantStringMultiline(_CONSTANT_BASE): def INPUT_TYPES(s) -> dict: return { "required": { - "value": ("STRING", {"multiline": True}) + "value": ("STRING", {"multiline": True, "dynamicPrompts": True}) + } + } + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("string",) + + +class ConstantNonDynamicString(_CONSTANT_BASE): + @classmethod + def INPUT_TYPES(s) -> dict: + return { + "required" : { + "value": ("STRING", {"multiline": False, "dynamicPrompts": False}) + } + } + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("string",) + + +class ConstantNonDynamicStringMultiline(_CONSTANT_BASE): + @classmethod + def INPUT_TYPES(s) -> dict: + return { + "required": { + "value": ("STRING", {"multiline": True, "dynamicPrompts": False}) } } @@ -76,4 +102,6 @@ NODE_CLASS_MAPPINGS = { "ConstantInteger": ConstantInteger, "ConstantString": ConstantString, "ConstantStringMultiline": ConstantStringMultiline, + "ConstantNonDynamicString": ConstantNonDynamicString, + "ConstantNonDynamicStringMultiline": ConstantNonDynamicStringMultiline }