Lazy Fallback Switch (Autogrow)
The switch that skips the branches you didn't pick
- default
- values
- output
The name is doing real work here. This is a switch that routes by an integer index, and - the part that earns the "Lazy" - it only evaluates the route you actually selected. Every other branch's upstream nodes sit out of the run entirely. That's the difference between this and a normal switch, and it's the whole reason you'd reach for it.
What it is
You feed it an index (an integer, defaults to 0), connect a handful of candidate values, and it passes through whichever one matches value<index>. Pick 2 and you get whatever is wired into value2. The fallback is the twist: if value2 isn't connected, it returns default instead. And if default isn't connected either, you get None. No errors, no dead ends - the graph just routes around whatever's missing.
"Autogrow" means the routes aren't fixed. The node starts with value0 through value9 and spawns more sockets as you connect them, up to value99. Any integer index works, so nothing about the layout changes when you decide you need a 27th branch; out-of-range indices, including negatives, fall through to default.
Why lazy matters
A regular switch in ComfyUI still forces everything wired into it to execute, because the scheduler has to know what's there. Lazy evaluation is the opposite: the node asks the scheduler to evaluate only the input it actually needs, and the branches you didn't pick never run. That's genuinely useful when your branches are expensive - a second KSampler pass, an upscaler, a ControlNet preprocessor you only want on some runs. You keep all the pieces in one workflow and let one number decide which one fires.
The node is also type-agnostic. All the value sockets, default, and the output share one ComfyUI type (MATCHTYPE_V3 in the schema), so it routes whatever you give it - a model, a latent, conditioning, an image - without caring what it's carrying.
The inputs you'll actually set
index- the selector. Drive it from a primitive or math node to pick the branch at runtime.default- the fallback for when the indexed route is unconnected.values- the routes themselves; connect only the ones that need custom processing.
The single output, output, wires into whatever downstream node expects that type.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/SparknightLLC/ComfyUI-LazyFallbackSwitch.git
Restart ComfyUI, and it appears under Sparknight/Logic. ComfyUI Manager users can search "Lazy Fallback Switch" instead. Good news on the dependency front: there are none. No requirements.txt, no model downloads, no API key - the README says so and the source agrees.
One requirement does bite: you need a recent ComfyUI with V3 MatchType support, and the Autogrow variant needs V3 Autogrow too (the pack declares ComfyUI 0.4.0+). On an older build this node simply won't register.
The catch (read before committing to this variant)
Here's where the Autogrow variant gets honest. At the time of writing, ComfyUI doesn't preserve lazy metadata from expanded Autogrow inputs during dependency discovery - tracked in ComfyUI PR #15103. Until that lands in your ComfyUI build, connected Autogrow routes may all execute instead of just the selected one. You'd keep the routing but silently lose the laziness, which is the whole point. If that matters, the pack's own advice is to use the fixed Lazy Fallback Switch instead - it doesn't depend on Autogrow scheduling, and ten routes covers most switch jobs anyway.
The same shop (Sparknight LLC) makes the Spectral VAE Detailer, and this pack feels like it came from the same place: narrow, careful, and tested against ComfyUI's actual scheduler rather than just the happy path.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT | 0 | Selects the matching valueN input. Any missing value uses default. |
| defaultopt | COMFY_MATCHTYPE_V3 | Used when the indexed value input is not connected. An unconnected default returns None. | |
| valuesopt | COMFY_AUTOGROW_V3 | Connect only the indexed routes that need custom processing. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | COMFY_MATCHTYPE_V3 | The selected indexed value, or default. |