From c48da5300e4766ec10857e353f84b36c6af5778a Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Mon, 10 Mar 2025 20:19:01 +0800 Subject: [PATCH] Make trigger_words input optional for TriggerWord Toggle node. This will fix https://github.com/willmiao/ComfyUI-Lora-Manager/issues/31 --- py/nodes/trigger_word_toggle.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/py/nodes/trigger_word_toggle.py b/py/nodes/trigger_word_toggle.py index 3067d261..8dda5596 100644 --- a/py/nodes/trigger_word_toggle.py +++ b/py/nodes/trigger_word_toggle.py @@ -10,10 +10,11 @@ class TriggerWordToggle: @classmethod def INPUT_TYPES(cls): return { - "required": { - "trigger_words": ("STRING", {"defaultInput": True, "forceInput": True}), + "required": {}, + "optional": { + **FlexibleOptionalInputType(any_type), + "trigger_words": ("STRING", {"default": "", "defaultInput": True}), }, - "optional": FlexibleOptionalInputType(any_type), "hidden": { "id": "UNIQUE_ID", # 会被 ComfyUI 自动替换为唯一ID }, @@ -23,7 +24,7 @@ class TriggerWordToggle: RETURN_NAMES = ("filtered_trigger_words",) FUNCTION = "process_trigger_words" - def process_trigger_words(self, trigger_words, id, **kwargs): + def process_trigger_words(self, id, trigger_words="", **kwargs): # Send trigger words to frontend PromptServer.instance.send_sync("trigger_word_update", { "id": id,