From 697fd52349119902b604f1811c0180eaaa63282f Mon Sep 17 00:00:00 2001 From: karrix Date: Thu, 9 May 2024 14:26:43 +0800 Subject: [PATCH] add: bool custom node --- comfy-nodes/external_boolean.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 comfy-nodes/external_boolean.py diff --git a/comfy-nodes/external_boolean.py b/comfy-nodes/external_boolean.py new file mode 100644 index 0000000..0f47366 --- /dev/null +++ b/comfy-nodes/external_boolean.py @@ -0,0 +1,25 @@ +class ComfyUIDeployExternalBoolean: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "input_id": ( + "STRING", + {"multiline": False, "default": "input_bool"}, + ), + "default_value": ("BOOLEAN", {"default": False}) + } + } + + RETURN_TYPES = ("BOOLEAN",) + RETURN_NAMES = ("bool_value",) + + FUNCTION = "run" + + def run(self, input_id, default_value=None): + print(f"Node '{input_id}' processing with switch set to {default_value}") + return [default_value] + + +NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalBoolean": ComfyUIDeployExternalBoolean} +NODE_DISPLAY_NAME_MAPPINGS = {"ComfyUIDeployExternalBoolean": "External Boolean (ComfyUI Deploy)"} \ No newline at end of file