Nodes/ComfyUI_Eclipse/Any Multi-Switch Lazy
ComfyUI Node

Any Multi-Switch Lazy

The fallback switch that only runs the branch that wins

By r-vage·Created 10 months ago·Updated a day ago· 31
Any Multi-Switch Lazy
  • any_1
  • any_2
  • *
inputcount2

Any Multi-Switch Lazy is the version of Eclipse's fallback switch that refuses to do wasted work. Same first-non-empty routing as the plain Any Multi-Switch - up to 64 wildcard inputs, highest-priority connected slot wins - but with a crucial difference: only the winning branch's upstream graph executes. The other branches never run at all. If you're choosing between two model loaders, two samplers, or two entire sub-pipelines, this is the switch that doesn't waste a single sample on the branch you aren't using.

This is the one I'd actually reach for in most real workflows. The plumbing layer's dirty secret is that a plain switch still evaluates everything upstream of it; the lazy variant is what most people mean when they say "switch" - flip a condition, and only the chosen path computes.

How it works

Under the hood it implements ComfyUI's lazy evaluation contract. The node's check_lazy_status reads the actual prompt graph to see which any_N slots have real connections, then requests inputs one at a time in priority order - it asks for any_1; if that slot resolves to a value, it stops and never asks for any_2. This is more careful than a naive lazy flag, because the dynamically-added sockets (any_3 and up, which only exist once you bump inputcount) can't all carry the lazy marker. So it inspects the graph itself and requests links one-by-one.

The practical effect: connect any_1 to an expensive model loader and any_2 to another, and only the winner's loader runs. The loser's model never loads, never occupies VRAM, never costs you a second.

Inputs and behavior

  • inputcount - number of sockets (1–64, default 2), auto-updating.
  • any_1any_N - the branches; any_1 is highest priority and, if connected, is the only one evaluated.
  • Output - the first non-empty value, or None if all are empty.

One semantic to keep straight: because the loser never executes, its upstream side effects never happen either. That's usually exactly what you want, but if a branch was doing something with side effects you rely on (a save node, a counter), lazy evaluation skips it - that's a feature, not a bug, but it changes what "connected but not selected" means.

Lazy vs Purge

The Eclipse family also offers Any Multi-Switch Purge, which runs everything upstream and then clears VRAM before the winner proceeds. For expensive alternatives, Lazy is the better default: it avoids the compute entirely instead of paying for it and then cleaning up. Purge earns its keep only when you need every branch evaluated (side effects, debugging) but still want the memory floor cleared afterward.

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"). No extra dependencies.

Gotchas

The pack-wide migration note applies as always: ComfyUI_Eclipse was formerly RvTools, and v4.0.0 removed every legacy node - old workflows need the Workflow Migration Tool node (or python tools/migrate_workflow.py <workflow.json>) to rewrite old IDs with a backup. And one lazy-specific gotcha: if the winning branch is empty (a bypassed node feeding it None), the node falls through and evaluates the next slot - so a "dead" high-priority branch can silently trigger a slower fallback branch, and with lazy evaluation the first branch's non-execution is part of the deal.

Category🌒 Eclipse/ Router

Inputs (3)

NameTypeDefaultDescription
inputcountINT21–64Number of ANY inputs to expose. Inputs update automatically.
any_1optCOMFY_MATCHTYPE_V3Any input #1 (highest priority). Only this branch executes if connected.
any_2optCOMFY_MATCHTYPE_V3Any input #2 (used if #1 is empty or not connected).

Outputs (1)

NameTypeDescription
*COMFY_MATCHTYPE_V3The selected output.