Nodes/Vantage-NodesV2/Any Switch (VantageV2)
ComfyUI Node

Any Switch (VantageV2)

The switch with no dropdown, and that's the point

By vantagewithai·Created 15 days ago·Updated 11 days ago· 3
Any Switch (VantageV2)
  • any_01
  • any_02
  • any_03
  • any_04
  • any_05
  • *

The first thing you notice is that there's nothing to configure. No dropdown, no selector, no index field. That's not an oversight - this node is the other kind of switch.

What it actually is

The word "switch" covers two different tools in ComfyUI, and conflating them is why people get confused. The first is a routing valve: you point it at A or B and it passes that one through. The second is a fallback: it walks its inputs in order and passes the first one that has something in it. You don't pick; the graph picks, based on what's connected and produced a value.

Any Switch (VantageV2) is the second kind. It's the local version of rgthree's Any Switch, the canonical first-non-null node - the KB's plumbing doc calls that pattern the thing that "lets you build a graph with several optional upstream branches and one downstream consumer - whichever branch is live wins, and you never touch a selector."

How it works

The node exposes five optional sockets, any_01 through any_05, all typed * - ComfyUI's wildcard, so model, latent, image, string, anything plugs in and the node doesn't care. It reads them in socket order and returns the first one that isn't None. If you fill all five, the frontend grows a spare socket, so a sixth and beyond is possible.

Two details in the actual source are worth knowing because they change behaviour you'd otherwise misread.

First, it's non-None, not truthy. False, 0, an empty string, an empty list and an empty dict are all real values and the walk stops on them. So if any_01 is wired to something that hands over False, that False wins and your genuine IMAGE on any_02 never gets a look. Fallback switches are order-sensitive; this one is aggressively so.

Second, there's exactly one exception: an rgthree-style context dict containing model and clip keys with every value set to None gets skipped rather than returned. A courtesy to the biggest context-bundle pack, so a dead context doesn't poison the chain.

When you'd reach for it

The healthy use is a workflow that can be fed from more than one place and doesn't care which. You've got an upscale branch that sometimes runs and sometimes is bypassed, or a prompt that comes either from a string node or from a file reader, and one consumer downstream. Wire preferred source to any_01, alternatives below it, done. No state to forget.

The unhealthy use is expecting it to save compute. It won't. This node is explicitly not lazy - every connected upstream branch still executes, whether or not its value gets chosen. If the point is to avoid running the branch you didn't pick, use Int Switch / Float Switch / String Switch from the same pack (those declare their data inputs lazy) or accept the cost.

One socket out, named *, typed * - it plugs into any input on any node. Remember the wildcard contract: nothing is type-checked at the wiring stage, so an IMAGE where a LATENT belongs fails at run time, not at connect time.

Installing it

Stop ComfyUI, then from your ComfyUI directory:

cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-NodesV2.git

Start ComfyUI, hard-refresh the browser, and look under the Vantage category in the Add Node menu. The pack is also published to the Comfy registry, so ComfyUI Manager's search should find "Vantage-NodesV2" - the git route is the one the README documents and the one I'd trust if Manager comes up empty.

There is nothing to pip install. The repo has no requirements file and its pyproject.toml declares no dependencies at all; everything it imports (torch, numpy, Pillow, aiohttp) already ships with ComfyUI. What it does need is a recent ComfyUI - the frontend uses the newer title-button and widget APIs, so an install that's a year stale is where "node doesn't appear" stories start.

When it misbehaves

If the output is None, then every socket was empty or unconnected - and because this is a fallback node, silence is the failure mode. Work backwards: is the branch you expected actually enabled, or did you mute it and forget? A bypassed upstream node can pass None on a wildcard, which reads identically to "not connected" here.

Downstream, that None is fine on an optional input (it simply arrives as nothing) and fatal on a required one. If a sampler suddenly refuses to run behind this node, the switch isn't broken; something upstream of it went quiet.

CategoryVantage/Utils

Inputs (5)

NameTypeDefaultDescription
any_01opt*—
any_02opt*—
any_03opt*—
any_04opt*—
any_05opt*—

Outputs (1)

NameTypeDescription
**—