Any Multi-Switch
The first-non-empty switch you'll actually keep in every workflow
- any_1
- any_2
- *
Any Multi-Switch is the fallback switch from the ComfyUI_Eclipse router family, and it's the one you'll actually leave in your workflows. It takes up to 64 wildcard inputs, walks them in order, and returns the first one that isn't empty or None. No selector to maintain, no state to forget - the graph decides which branch is live by which branch you connected. Disconnect input 3 and it silently falls through to input 4. That's the whole magic.
This is the same shape as rgthree's famous Any Switch - "chooses the first input that is not null/empty" - and it's the backbone of the "several optional upstream branches, one downstream consumer" pattern. You build a workflow where a positive prompt can come from a smart prompt builder, a wildcard processor, or a plain text node, wire all three into the switch, and whichever one is actually feeding data wins. You never touch a dropdown to change behavior; you change the graph.
How it works
An inputcount integer (1–64, default 2) controls how many any_N sockets are exposed, and the sockets update automatically when you change the count - Eclipse's frontend JavaScript handles that, so you don't have to delete and re-add the node to grow it. Internally it checks each slot in priority order with a fairly careful "is this a real value?" test: None, empty strings, empty lists, and lists of Nones all count as empty and get skipped. If every slot is empty, it emits None so downstream optional inputs just see nothing.
The inputs are wildcard-typed, so it routes a model, a latent, an image, a string, a pipe - whatever. The output carries the type of whatever you connected.
Inputs and output that matter
inputcount- the only widget you'll touch. Bump it to expose more sockets.any_1…any_N- your branches.any_1has highest priority.- Output - the first non-empty input, or
None.
The trade-off
The plain Any Multi-Switch evaluates every upstream branch that's connected, because ComfyUI's caching runs the whole graph and this node just picks a winner at the end. If your branches are expensive - separate model loaders, separate samplers - that's wasted work: ComfyUI caches aggressively so branches with unchanged inputs don't re-run, but on a fresh run everything computes. That's exactly why Eclipse also ships Any Multi-Switch Lazy, which only executes the winning branch's upstream graph. If your alternatives are heavy, use the Lazy version; if they're cheap strings and latents, this one is fine and simpler to reason about.
Installing it
Part of ComfyUI_Eclipse, installed once:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_Eclipse
Restart ComfyUI (or ComfyUI Manager → search "ComfyUI Eclipse"). Pure routing, no extra dependencies.
Gotchas
The pack-wide one: ComfyUI_Eclipse was formerly RvTools, and v4.0.0 removed all legacy nodes - old workflows need the Workflow Migration Tool node (or python tools/migrate_workflow.py <workflow.json>) to rewrite old IDs with a backup.
And a behavior note: "first non-empty" means empty, not "the branch you wanted." If any_1 is connected to a node that's bypassed and outputs nothing, the switch will silently use any_2. That's usually what you want - but it's also how you get "why is it using the other model?" moments when a branch you thought was dead turns out to be feeding a value.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| inputcount | INT | 21–64 | Number of ANY inputs to expose. Inputs update automatically. |
| any_1opt | COMFY_MATCHTYPE_V3 | Any input #1 (highest priority). Leave empty to bypass. | |
| any_2opt | COMFY_MATCHTYPE_V3 | Any input #2 (used if #1 is empty). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | COMFY_MATCHTYPE_V3 | The selected output. |