Switch
The branch picker that doesn't waste your GPU
- on_true
- on_false
- OUT
Every power user eventually builds a workflow that needs to take different paths - different prompts, different samplers, different LoRAs - without rebuilding the graph. This Switch is that branch picker: one Path number, up to 64 inputs, and the value from Input_N comes out the other side. It looks like a dozen other switch nodes, but there's one detail that makes it genuinely nice: the unselected branches don't run at all.
That's the part people assume doesn't matter until they wire a lazy-heavy branch into it. ComfyUI's newer execution model supports lazy evaluation, and this node uses it properly - it tells the engine to only load the input that Path selects. You're not paying for the three branches you skipped. The classic alternative, a simple "always evaluate everything, pick one at the end," burns VRAM and time on branches you never look at. This one doesn't.
How it works
Path is an INT from 1 to 64. Input_1 is always there, and every time you connect another wire the node grows another input slot (up to 64 of them, though by the time you're at double digits you should probably split the workflow). Its check_lazy_status method tells ComfyUI's executor exactly which input it needs, and the rest are skipped. The output is output, type * - anything, any data type, it passes through untouched.
The pack also hooks ComfyUI's execution internals on import to make execution-blocking work across the graph; that's the machinery behind the Inversed Switch, and it's part of why the two nodes are designed to be used together. You can use Switch standalone - select between two prompt sets or two seed strategies - but the intended pairing is: Inversed Switch splits one stream into many branches, and a Switch downstream picks which one actually delivers.
The input that matters
- Path - the only thing you'll touch. The number of the input slot you want routed to the output.
That's it. No models, no config, no gotchas about data types.
Install
It ships in ComfyUI-WBLESS, which installs cleanly - no requirements.txt, no model downloads, nothing extra:
cd ComfyUI/custom_nodes
git clone https://github.com/LaoMaoBoss/ComfyUI-WBLESS
then restart ComfyUI. Or grab it through ComfyUI Manager by searching "ComfyUI-WBLESS."
Troubleshooting
If a branch "doesn't seem to run," that's the feature, not a bug - the lazy evaluation means skipped branches genuinely don't execute, so don't debug a workflow by assuming everything runs. Older ComfyUI builds had switch runtime errors in early versions of this pack (fixed in V2.2.3/V2.2.4 of the README changelog), so if a switch misbehaves, updating both ComfyUI and the pack is the first move. And because Switch is built on this pack's execution hook, it's one of those nodes where keeping the pack current matters - a stale pack against a new ComfyUI is where switches start throwing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| on_true | * | — | |
| on_false | * | — | |
| switch | BOOLEAN | true | True passes on_true, False passes on_false. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| OUT | * | — |