LC AnySwitch
The switch that just picks whichever wire is live
- any_01
- any_02
- any_03
- any_04
- any_05
- any_06
- any_07
- any_08
- any_09
- any_10
- any_11
- any_12
- any_13
- any_14
- any_15
- any_16
- any_17
- any_18
- any_19
- any_20
- *
You've got a workflow with several optional branches - a checkpoint loader here, a LoRA stack there, maybe a ControlNet that only exists in some versions - and one consumer downstream. You want whichever branch is actually connected to win, without touching a selector every time you swap layouts. That's a fallback switch, the "first non-null input" shape, and LC AnySwitch is LC123's version of it.
The distinction matters because "switch" means two different things in ComfyUI. An A/B switch has a selector and passes the input you point at - a manual routing valve. A fallback switch has no selector: it walks its inputs and returns the first one that isn't None. rgthree's Any Switch is the canonical example, and LC AnySwitch plays in the same lane. Wire two model loaders in, leave one unconnected, and the connected one flows through. Connect both and the top one wins. That's the "first connected wins" behavior in the name, and it means you never hunt for the flag that mutes a branch - unplugging the wire is the control.
The inputs are all any_01 through any_20 typed as * - the wildcard type, so this routes models, latents, images, strings, whatever. Two engine details worth knowing. First, it type-locks from the first wire: once you connect a MODEL to any_01, the output adopts that type, so the downstream socket validation behaves. Second, and this is the interesting bit for people who use Use Everywhere - the node deliberately blocks Use Everywhere auto-wiring into its inputs. There's a companion JS file for exactly that. The reasoning is sound: a switch's inputs are supposed to stay partially unconnected, so an auto-wiring extension would silently connect everything and destroy the fallback logic. If you've ever had an "Any Switch" that suddenly passed the wrong branch, an auto-connect extension was usually the culprit.
inputcount (2–20) trims how many slots you actually see, so the node doesn't sprawl across your canvas. It's a widget, and the JS hides the unused slots.
The one real gotcha: if nothing is connected at all, it outputs None - and whether that's graceful or an error depends on what's downstream. Some nodes handle None optional inputs fine; others will throw. That's the standard behavior for this node family, not a bug. And for the "two of something, flip between them" case, remember this is not an A/B switch - use LC Boolean Switch for that, where a boolean state picks on_true vs on_false. Different tools, and mixing them up is the most common confusion.
The deeper design note, straight from the plumbing layer: optional inputs that are left unwired arrive as None, and "first non-null wins" is built entirely on that convention. That's also why this node is so safe to drop mid-graph - it never invents data, it just picks.
Install: it's part of the LC123 pack, so one clone gets you everything.
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
Restart, done. No pip deps. If your workflow has "sometimes this branch is live, sometimes that one," this is the node that makes the graph decide for you.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| inputcount | INT | 22–20 | — |
| any_01opt | * | — | |
| any_02opt | * | — | |
| any_03opt | * | — | |
| any_04opt | * | — | |
| any_05opt | * | — | |
| any_06opt | * | — | |
| any_07opt | * | — | |
| any_08opt | * | — | |
| any_09opt | * | — | |
| any_10opt | * | — | |
| any_11opt | * | — | |
| any_12opt | * | — | |
| any_13opt | * | — | |
| any_14opt | * | — | |
| any_15opt | * | — | |
| any_16opt | * | — | |
| any_17opt | * | — | |
| any_18opt | * | — | |
| any_19opt | * | — | |
| any_20opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |