Nodes/Vantage-Nodes/Switch Any
ComfyUI Node

Switch Any

First non-None wins — the fallback node that works on any data type

By vantagewithai·Created 8 months ago·Updated 25 days ago· 25
Switch Any
  • v1
  • v2
  • v3
  • v4
  • v5
  • v6
  • v7
  • v8
  • v9
  • v10
  • value

Wire up to ten inputs of any type, and this node hands back the first one that isn't None. That's it - and "first non-None" is a surprisingly deep idea in ComfyUI, because optional inputs that don't arrive show up as None. This node turns "maybe this thing is connected, maybe not" into a deterministic fallback chain.

Think of it as the plumbing for "use A if you've got it, otherwise B, otherwise C." You're building a workflow where a nicer image should be used when it exists, but a fallback must keep the pipeline alive when it doesn't. Or a prompt that can come from several sources - an override, a batch, a default - where the first one that's actually present should win. This node is the clean way to express that instead of a tangle of conditional nodes.

What it needs

Ten optional inputs, v1 through v10, all typed ANY. That's the whole trick: because the type is ANY, the same node routes images, latents, strings, models - anything. It evaluates inputs in order and returns the first non-None one.

One output: value, the winner. If every input is None, you get None out.

Why the ordering matters

v1 wins over v2, v2 over v3, and so on. So put your preferred source in the low-numbered slots and your fallbacks after. The classic setup:

  • v1: a primary source (say, a live/custom input)
  • v2: a secondary (a default path)
  • v3+: further fallbacks

That's a priority chain, expressed as input order. It's worth a comment in your workflow (or a reroute label) because "higher slot wins" is exactly the kind of thing you forget a month later.

The catch with ANY

ANY inputs are convenient and dangerous. The node doesn't check that all your candidates are the same type - if v1 is an IMAGE and v2 is a STRING, it'll happily return whichever comes first, and the downstream node will complain about a type mismatch. This is the same "Anything Anywhere" tension the community argues about: routing anything is powerful and makes workflows harder to debug. Keep each chain to one type and it's a clean tool; mix types and you're building a minefield.

Install

Part of Vantage-Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-Nodes.git
pip install -r requirements.txt

or ComfyUI Manager → search "Vantage-Nodes" → Install → restart.

Common issues

  • Nothing comes out - all ten inputs are None. At least one wire must actually be connected.
  • Wrong thing wins - remember the order: v1 first. If your "fallback" is in v1, it beats everything after it.
  • Type mismatch downstream - you routed different types through one switch. Keep slots consistent per chain.
CategoryVantage/Control

Inputs (10)

NameTypeDefaultDescription
v1optANY
v2optANY
v3optANY
v4optANY
v5optANY
v6optANY
v7optANY
v8optANY
v9optANY
v10optANY

Outputs (1)

NameTypeDescription
valueANY