Nodes/Lenient Switch/Simple Selector (Switch)
ComfyUI Node

Simple Selector (Switch)

A dropdown switch that also tells you which option it picked

By id-fa·Created 3 months ago·Updated 3 months ago· 6
Simple Selector (Switch)
  • source_a
  • source_b
  • source_c
  • source_d
  • source_e
  • output
  • label
selectnone
label_a
label_b
label_c
label_d
label_e
block_on_none_selectedfalse
bypass_unselectedfalse

Simple Selector (Switch) (class SimpleSelectorSwitch) is the no-philosophy member of the Lenient Switch pack. No truthiness tests, no per-slot conditions, no "first truthy wins." You get a plain dropdown (none / A / B / C / D / E), five sources, and whatever you select gets forwarded. It's what you drop in when you just want to swap between two or three things without rewiring the graph.

The genuinely clever bit is small and easy to miss: every slot carries a free-form label_alabel_e text field - a memo, "SDXL base", "Flux dev", whatever - and the node re-emits the selected slot's label on a second label STRING output. The labels never influence flow. They're for you. Feed that output into a text-concat node and your saved filename says which variant actually ran. Stuff it into PNG metadata and you can tell which of your five prompts made this image at a glance. A switch that doubles as a tiny audit trail.

The inputs that matter

  • select - the dropdown. The whole control surface.
  • label_alabel_e - per-slot memos, re-emitted on label for the chosen slot.
  • block_on_none_selected - when select is none, emit an ExecutionBlocker on both outputs so downstream nodes are skipped instead of receiving None. Default off.
  • bypass_unselected - lazy evaluation: only the selected slot's source actually runs, so the other four upstream chains never execute. That's a big deal when one of those chains is expensive. Note it's not a visual bypass - nothing greys out, the nodes just don't run.

Outputs: output (any) and label (STRING).

Two behaviors that bite people

  • Selecting a slot whose source_X isn't connected returns None - it does not block. Only select = none with block_on_none_selected on triggers the blocker. If your downstream breaks on a None, check which slot you selected, not the block toggle.
  • With bypass_unselected on and select = none, nothing runs - every source is skipped, not just the unselected ones.

Why you'd reach for it

A/B testing. Two checkpoints, two samplers, two CLIPs - wire each pair into source_a / source_b, flip the dropdown, run. No deleting and re-plugging wires every time you want to compare. It composes nicely with the pack's main LenientSwitch too: manual picks here for the things you decide by hand, automatic gating there for the things the graph should decide for itself.

Install

This node ships zero JavaScript - pure Python. Same trivial install as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/id-fa/ComfyUI-Lenient-Switch lenient-switch

Restart ComfyUI, and it appears under Lenient Switch in the node menu. No dependencies, no models to download. (ComfyUI Manager search "Lenient Switch" works too.)

CategoryLenient Switch

Inputs (13)

NameTypeDefaultDescription
selectCOMBOnonePick which source to forward. 'none' forwards nothing (see block_on_none_selected).
label_aSTRINGFree-form per-slot memo (e.g. 'SDXL base'). Not used by the node.
label_bSTRINGFree-form per-slot memo (e.g. 'SDXL base'). Not used by the node.
label_cSTRINGFree-form per-slot memo (e.g. 'SDXL base'). Not used by the node.
label_dSTRINGFree-form per-slot memo (e.g. 'SDXL base'). Not used by the node.
label_eSTRINGFree-form per-slot memo (e.g. 'SDXL base'). Not used by the node.
block_on_none_selectedBOOLEANfalseWhen 'none' is selected, emit ExecutionBlocker so downstream nodes are skipped instead of receiving None.
bypass_unselectedBOOLEANfalseWhen ON, only the selected slot's source_X is evaluated; the upstream chains feeding the other (and, with 'none', all) sources do not run (lazy evaluation). Note: nodes are not visually bypassed like rgthree; they simply do not execute.
source_aopt*Source for slot A (any type).
source_bopt*Source for slot B (any type).
source_copt*Source for slot C (any type).
source_dopt*Source for slot D (any type).
source_eopt*Source for slot E (any type).

Outputs (2)

NameTypeDescription
output*
labelSTRING