From 4ffd8f56c2289c1aa5ddceb7ee3dcc0dcde80560 Mon Sep 17 00:00:00 2001 From: boobkake22 Date: Mon, 2 Mar 2026 02:06:40 -0800 Subject: [PATCH] Update naming --- README.md | 6 +++--- __init__.py | 6 +++--- simple_switch.py | 30 +++++++++++++++--------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 3bf05b5..eb3a938 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ComfyUI custom node that returns the first available value from six optional wil ## What it does -- Accepts six optional inputs: `value_1` ... `value_6` +- Accepts six optional inputs: `input01` ... `input06` - Returns the first non-empty input in order - Preserves original behavior for empty model/clip context dictionaries - Uses wildcard typing so it can pass through most ComfyUI value types @@ -31,8 +31,8 @@ Restart ComfyUI after installing. ## Usage -1. Add the `Simple Switch (6 Inputs)` node. -2. Connect values to `value_1` ... `value_6` in your preferred priority order. +1. Add the `SimpleSwitch` node. +2. Connect values to `input01` ... `input06` in your preferred priority order. 3. Use `output` downstream. ## License diff --git a/__init__.py b/__init__.py index 2386367..bfac0e8 100644 --- a/__init__.py +++ b/__init__.py @@ -1,11 +1,11 @@ -from .simple_switch import SimpleAnySwitch +from .simple_switch import SimpleSwitch NODE_CLASS_MAPPINGS = { - "SimpleAnySwitch": SimpleAnySwitch, + "SimpleSwitch": SimpleSwitch, } NODE_DISPLAY_NAME_MAPPINGS = { - "SimpleAnySwitch": "Simple Switch (6 Inputs)", + "SimpleSwitch": "Simple Switch (6 Inputs)", } __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] diff --git a/simple_switch.py b/simple_switch.py index 0a3c561..66443e8 100644 --- a/simple_switch.py +++ b/simple_switch.py @@ -27,8 +27,8 @@ def _is_none(value): return value is None -class SimpleAnySwitch: - """Return the first non-empty value from value_1..value_6.""" +class SimpleSwitch: + """Return the first non-empty value from input01..input06.""" CATEGORY = "Simple Switch" FUNCTION = "switch" @@ -40,25 +40,25 @@ class SimpleAnySwitch: return { "required": {}, "optional": { - "value_1": (ANY_TYPE,), - "value_2": (ANY_TYPE,), - "value_3": (ANY_TYPE,), - "value_4": (ANY_TYPE,), - "value_5": (ANY_TYPE,), - "value_6": (ANY_TYPE,), + "input01": (ANY_TYPE,), + "input02": (ANY_TYPE,), + "input03": (ANY_TYPE,), + "input04": (ANY_TYPE,), + "input05": (ANY_TYPE,), + "input06": (ANY_TYPE,), }, } def switch( self, - value_1=None, - value_2=None, - value_3=None, - value_4=None, - value_5=None, - value_6=None, + input01=None, + input02=None, + input03=None, + input04=None, + input05=None, + input06=None, ): - for candidate in (value_1, value_2, value_3, value_4, value_5, value_6): + for candidate in (input01, input02, input03, input04, input05, input06): if not _is_none(candidate): return (candidate,) return (None,)