Hot Lazy Switch
One dropdown, ten branches, and the ones you didn't pick never run
- input_0
- input_1
- input_2
- input_3
- input_4
- input_5
- input_6
- input_7
- input_8
- input_9
- output
You know the loop. You want to try a second checkpoint against the same prompt, or swap a LoRA stack, or compare two resolutions - and ComfyUI gives you two options: rewire half the canvas and undo it after, or keep five nearly-identical copies of the workflow open and rename them final_v3_REAL.json. Hot Lazy Switch is the third option. Up to ten inputs of any type, one dropdown, one output.
What it actually is, in the plumbing sense
ComfyUI's utility layer has two shapes people both call "a switch." The fallback shape walks its inputs and passes the first one that isn't empty, no selector at all - rgthree's Any Switch is the canonical one. The valve shape points at one input and passes that one, and that's what this is. You're the selector, and that's the point: you're A/B testing, not building a self-healing graph.
The reason to install this one over the other valve-shaped switches is the word lazy. The branches you didn't pick don't just get ignored at the output - they never execute. Two 12GB checkpoints on two loaders, one switch, only the selected checkpoint loads. On a 12GB or 16GB card that's the difference between "switching models" and "waiting for an OOM."
Why "lazy" is genuinely hard here
This is the interesting part, and if you write nodes yourself it's worth stealing. ComfyUI decides which links are prunable inside the scheduler, reading the node's raw INPUT_TYPES - before any dynamic input expansion has happened. The popular io.Autogrow slot isn't in that raw schema, so the lookup comes back None, is_lazy reads as False, every upstream link gets marked strong, and ComfyUI loads all ten branches before your node gets a say. check_lazy_status is still called afterwards, so the node looks correctly wired while pruning precisely nothing.
The author's fix was to declare all ten sockets statically, each one lazy=True, and let the frontend JavaScript hide the unused ones. That's why sockets appear one at a time as you connect them instead of the node greeting you as a wall of ten empty dots, and why unplugging leaves an empty socket in place rather than shuffling the wires below it.
One more choice worth stealing: every slot and the output share a single type binding, so the node adopts whatever you plug in rather than being a wildcard *. You can't put an IMAGE in one slot and a LATENT in another, because ComfyUI stops you - better than a node that accepts anything and fails inside a sampler.
The inputs and output that matter
Eleven widgets, and most of them get set once and forgotten. The three that matter, plus the output:
index- the dropdown. Its options are the names from thename_*fields, rewritten per node by the frontend, and selection resolves by name, not position. That's what makes it survive being promoted into a subgraph: the subgraph input shows "SDXL Turbo / Flux Schnell" instead of3.name_0…name_9- one label per slot ("Base", "LoRA done", "Upscaled"). Keep them unique; if two slots share a label the resolver takes the first match.input_0…input_9- optional, any type, revealed as you use them. The loaders and conditioning go here.output- one socket of whatever type you wired in. Straight into your sampler's model input, or CLIP, or a Preview.
Installing it
Manager is the easy path: open ComfyUI Manager → Install via Git URL → paste the repo → restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Bloodwolfb/ComfyUI-HotSwitches.git
No Python dependencies at all - the pyproject.toml asks only for Python 3.10+, which you already have. What you do need is a reasonably current ComfyUI, because both nodes are written against the newer backend authoring API (comfy_api.latest). The pack deliberately ships no NODE_CLASS_MAPPINGS, so on an old build there is no legacy entry to fall back to - you get an empty node search, not a broken node.
There's also an examples/hot_switches_demo.json in the repo you can drag onto the canvas; it uses text nodes as stand-ins so it runs whatever models you have.
Where people get burned
"Hot Lazy Switch: selected 'Input 3' (input_3) is not connected." The node's own error, and a good one - you picked a label whose socket is empty. It even lists the slots that are connected.
Nothing renders and the node looks wrong. This node does canvas surgery - hiding sockets, rewriting combo options from widget values - the exact category of pack the Nodes 2.0 frontend rewrite broke for rgthree. If the layout looks mangled, toggle Nodes 2.0 off before filing anything. And hard-refresh the browser after installing; the JS only loads on a fresh page.
An unselected branch won't update. It doesn't run at all, which is the feature. Anything you want firing every run belongs after the output socket.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| index | COMBO | Input 1 | Which named input to pass through. Promote this widget to a subgraph to expose the choice by name. |
| name_0 | STRING | Input 1 | Label shown for input_0. |
| name_1 | STRING | Input 2 | Label shown for input_1. |
| name_2 | STRING | Input 3 | Label shown for input_2. |
| name_3 | STRING | Input 4 | Label shown for input_3. |
| name_4 | STRING | Input 5 | Label shown for input_4. |
| name_5 | STRING | Input 6 | Label shown for input_5. |
| name_6 | STRING | Input 7 | Label shown for input_6. |
| name_7 | STRING | Input 8 | Label shown for input_7. |
| name_8 | STRING | Input 9 | Label shown for input_8. |
| name_9 | STRING | Input 10 | Label shown for input_9. |
| input_0opt | COMFY_MATCHTYPE_V3 | — | |
| input_1opt | COMFY_MATCHTYPE_V3 | — | |
| input_2opt | COMFY_MATCHTYPE_V3 | — | |
| input_3opt | COMFY_MATCHTYPE_V3 | — | |
| input_4opt | COMFY_MATCHTYPE_V3 | — | |
| input_5opt | COMFY_MATCHTYPE_V3 | — | |
| input_6opt | COMFY_MATCHTYPE_V3 | — | |
| input_7opt | COMFY_MATCHTYPE_V3 | — | |
| input_8opt | COMFY_MATCHTYPE_V3 | — | |
| input_9opt | COMFY_MATCHTYPE_V3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | COMFY_MATCHTYPE_V3 | — |