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

πŸͺ› Switch from any

Route one input down one of two branches

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

Most of the switch nodes in this pack - Switch latent, Switch mask, and the other typed variants the README documents - work the same way: two inputs go in, a boolean picks one, one value comes out. Switch from any flips that shape around. One value goes in, and depending on the boolean, it comes out one of two possible outputs instead. It's a router, not a picker.

It's also the newest switch in the pack - Crystools' own changelog puts its addition in the June 2025 release (1.25.1), well after the rest of the switch family, which is presumably why it doesn't get a dedicated screenshot in the README's Switch section the way the older ones do. Don't be surprised if you find less written about it elsewhere; it's a genuinely newer addition.

How it works

You give it one arbitrary value and a boolean. If the boolean is true, that value comes out of on_true (and on_false stays empty); flip it, and it routes to on_false instead. It's the ComfyUI-graph equivalent of an if/else branch for a single piece of data - useful when you want one upstream result to conditionally feed one of two completely different downstream paths, rather than choosing between two upstream sources like the other switches do.

The inputs and outputs that matter

  • any - required, any type. The single value you're routing.
  • boolean - required, defaults to true. Controls which output actually carries the value.
  • Outputs: on_true and on_false - connect your two possible downstream paths to these. Only the branch matching the current boolean actually gets the value.

How to install it

Through ComfyUI Manager: search crystools, install, restart. Manually:

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

You'll find it under crystools πŸͺ› / Switch once restarted - no models, no GPU requirement.

Common issues & troubleshooting

The main thing that trips people up coming from the other switch nodes in this pack is the reversed shape - it's easy to expect two inputs and one output out of habit, and instead find yourself staring at one input and two outputs. If you're trying to pick between two sources of the same type, you want Switch latent, Switch mask, or one of the other typed pickers, not this one.

One thing you don't need to worry about: Crystools added "lazy switches" in version 1.24.0, so this node uses ComfyUI's lazy-evaluation support rather than naively evaluating everything upstream of both outputs. In practice that means whichever downstream branch isn't selected by the boolean doesn't get computed at all - so this genuinely works as a conditional gate, not just a display-time picker, and you can safely put something expensive behind the branch you don't always take.

Categorycrystools πŸͺ›/Switch

Inputs (2)

NameTypeDefaultDescription
any*β€”
booleanBOOLEANtrueβ€”

Outputs (2)

NameTypeDescription
on_true*β€”
on_false*β€”