From 457b3a81e868a0f99716c02874402c331f1b13ba Mon Sep 17 00:00:00 2001 From: altoiddealer Date: Mon, 7 Sep 2026 00:49:51 -0400 Subject: [PATCH] Add PassOrNone including locales and add tooltip/description to existing IsNone node. (#1035) --- locales/en/nodeDefs.json | 16 ++++++++++++++++ locales/zh/nodeDefs.json | 16 ++++++++++++++++ py/nodes/logic.py | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/locales/en/nodeDefs.json b/locales/en/nodeDefs.json index 601dc61..46b6fec 100644 --- a/locales/en/nodeDefs.json +++ b/locales/en/nodeDefs.json @@ -6271,6 +6271,22 @@ } } }, + "easy PassOrNone": { + "display_name": "Pass or None", + "inputs": { + "any": { + "name": "anything" + } + }, + "outputs": { + "0": { + "name": "output" + }, + "1": { + "name": "is_none" + } + } + }, "easy isNone": { "display_name": "Is None", "inputs": { diff --git a/locales/zh/nodeDefs.json b/locales/zh/nodeDefs.json index 6f489be..a65f448 100644 --- a/locales/zh/nodeDefs.json +++ b/locales/zh/nodeDefs.json @@ -6321,6 +6321,22 @@ } } }, + "easy PassOrNone": { + "display_name": "传递或为空", + "inputs": { + "any": { + "name": "任何" + } + }, + "outputs": { + "0": { + "name": "输出" + }, + "1": { + "name": "是否为空" + } + } + }, "easy isNone": { "display_name": "是否为空", "inputs": { diff --git a/py/nodes/logic.py b/py/nodes/logic.py index 14c8406..5a16a52 100755 --- a/py/nodes/logic.py +++ b/py/nodes/logic.py @@ -1000,13 +1000,44 @@ class isMaskEmpty(io.ComfyNode): return io.NodeOutput(False) +class PassOrNone(io.ComfyNode): + @classmethod + def define_schema(cls): + return io.Schema( + node_id="easy PassOrNone", + description="Passes the input through, or outputs None when input is None/not provided.", + category="EasyUse/Logic", + search_aliases=[ + "null", + "nothing", + "empty", + "blank", + ], + inputs=[ + io.AnyType.Input("anything", tooltip="Passes the input through, or outputs None when no input is provided.", optional=True), + ], + outputs=[ + io.AnyType.Output("output"), + io.Boolean.Output("is_none"), + ], + ) + + @classmethod + def execute(cls, anything=None): + return io.NodeOutput( + anything, + anything is None, + ) + + class isNone(io.ComfyNode): @classmethod def define_schema(cls): return io.Schema( node_id="easy isNone", + description="Returns true if the input is None, an empty string, or zero.", category="EasyUse/Logic", - inputs=[io.AnyType.Input("any")], + inputs=[io.AnyType.Input("any", tooltip="Returns true if the input is None, an empty string, or zero.")], outputs=[io.Boolean.Output("boolean")], ) @@ -1682,6 +1713,7 @@ NODE_CLASS_MAPPINGS = { "easy blocker": Blocker, "easy ifElse": IfElse, "easy isMaskEmpty": isMaskEmpty, + "easy PassOrNone": PassOrNone, "easy isNone": isNone, "easy isSDXL": isSDXL, "easy isFileExist": isFileExist, @@ -1731,6 +1763,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { "easy ifElse": "If else", "easy blocker": "Blocker", "easy isMaskEmpty": "Is Mask Empty", + "easy PassOrNone": "Pass or None", "easy isNone": "Is None", "easy isSDXL": "Is SDXL", "easy isFileExist": "Is File Exist",