feat: add ComfyUIDeployExternalTextAny
This commit is contained in:
parent
02430ee62d
commit
8c5e5c4277
46
comfy-nodes/external_text_any.py
Normal file
46
comfy-nodes/external_text_any.py
Normal file
@ -0,0 +1,46 @@
|
||||
class AnyType(str):
|
||||
def __ne__(self, __value: object) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
WILDCARD = AnyType("*")
|
||||
|
||||
class ComfyUIDeployExternalTextAny:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {
|
||||
"input_id": (
|
||||
"STRING",
|
||||
{"multiline": False, "default": "input_text"},
|
||||
),
|
||||
},
|
||||
"optional": {
|
||||
"default_value": (
|
||||
"STRING",
|
||||
{"multiline": True, "default": ""},
|
||||
),
|
||||
"display_name": (
|
||||
"STRING",
|
||||
{"multiline": False, "default": ""},
|
||||
),
|
||||
"description": (
|
||||
"STRING",
|
||||
{"multiline": True, "default": ""},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = (WILDCARD,)
|
||||
RETURN_NAMES = ("text",)
|
||||
|
||||
FUNCTION = "run"
|
||||
|
||||
CATEGORY = "text"
|
||||
|
||||
def run(self, input_id, default_value=None, display_name=None, description=None):
|
||||
return [default_value]
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalTextAny": ComfyUIDeployExternalTextAny}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {"ComfyUIDeployExternalTextAny": "External Text Any (ComfyUI Deploy)"}
|
@ -309,7 +309,7 @@ def apply_inputs_to_workflow(workflow_api: Any, inputs: Any, sid: str = None):
|
||||
value['inputs']["input_id"] = new_value
|
||||
|
||||
# Fix for external text default value
|
||||
if (value["class_type"] == "ComfyUIDeployExternalText"):
|
||||
if (value["class_type"] == "ComfyUIDeployExternalText" or value["class_type"] == "ComfyUIDeployExternalTextAny"):
|
||||
value['inputs']["default_value"] = new_value
|
||||
|
||||
if (value["class_type"] == "ComfyUIDeployExternalCheckpoint"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user