Nodes/Crystools/πŸͺ› Switch any
ComfyUI Node Runs on cloud

πŸͺ› Switch any

Switch Any (Crystools)

By crystianΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 1,946
πŸͺ› Switch any
  • on_true
  • on_false
  • *
β—„booleantrueβ–Ί

The generic member of Crystools' switch family. Where Switch image, Switch string, and Switch conditioning are locked to one specific type, this one is typed * on both inputs and the output - meaning it'll route anything: a MODEL, a CLIP, a LATENT, a custom pipe object, whatever, as long as both branches genuinely carry the same kind of thing.

Why you'd reach for it

Reach for this whenever you want to route two of the same object type with one boolean and there isn't a dedicated typed switch for it - alternating between two model loaders, two VAEs, two bundled pipe outputs. It's the escape hatch for every type the pack didn't build a specific switch for.

It also shows up a lot paired with Crystools' own Pipe from any - since a pipe's unpacked slots are all typed * too, this switch is a natural fit for choosing between two different pipe bundles further down a graph, rather than needing four separate typed switches to cover every value bundled inside.

How it works

Same lazy-evaluation behavior as the rest of the switch family: only the branch actually selected by the boolean gets executed upstream, so the path you didn't pick doesn't cost you compute. That's a real feature, not a footnote - it means you can put two genuinely expensive generation paths behind a switch and only pay for the one you use.

Inputs and outputs

Required: on_true and on_false, both typed *, and boolean (default true, routes on_true). Output: a single * socket that becomes whichever branch's concrete type got selected.

Installing it

Through ComfyUI Manager, search crystools. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/crystian/ComfyUI-Crystools.git
cd ComfyUI-Crystools
pip install -r requirements.txt

Restart ComfyUI. No models or extra dependencies for this node.

Common issues

Because it's typed *, ComfyUI's normal link validation is looser than it is for the typed switches - nothing stops you from wiring on_true to one type and on_false to something completely incompatible, and the graph will happily let you build it. It won't fail when you draw the wire; it'll fail at runtime, or worse, silently produce garbage downstream if the two types happen to be structurally similar enough not to crash outright. Keep both branches genuinely the same type, and if you find yourself needing that discipline enforced automatically, the typed switches (image, string, conditioning) exist precisely so ComfyUI catches the mistake for you at link time instead.

If you're debugging a graph that uses this node and something downstream is erroring in a way that doesn't make sense, wire a Show any onto the switch's output before it reaches the failing node - it's the fastest way to confirm you're actually getting the type you think you are out of a wildcard socket.

Categorycrystools πŸͺ›/Switch

Inputs (3)

NameTypeDefaultDescription
on_true*β€”
on_false*β€”
booleanBOOLEANtrueβ€”

Outputs (1)

NameTypeDescription
**β€”