Nodes/ControlAltAI Nodes/Switch (Two Way)
ComfyUI Node

Switch (Two Way)

Route one of two inputs down your workflow

By gseth·Created 2 years ago·Updated about a year ago· 209
Switch (Two Way)
  • input_1
  • input_2
  • output
selection_setting1

A switch is one of those unglamorous nodes that quietly makes a workflow reusable instead of a mess of copy-pasted branches. Switch (Two Way) picks between two inputs and passes the chosen one down the line. Want a graph that can run "with a LoRA" or "without a LoRA," "upscale" or "skip upscale," "img2img" or "txt2img," all from a single toggle? This is how you do it without maintaining two separate workflows.

What sets ControlAltAI's version apart from the dozen other switch nodes out there is that it's type-agnostic. Most switches only handle one wire type. This one accepts any type - images, latents, models, conditioning, whatever - and passes it through as long as the output connects to something that accepts it.

How it works

You wire up to two inputs (input_1, input_2) and set selection_setting to 1 or 2. That's it - 1 sends input_1 to the output, 2 sends input_2. The output is a wildcard type (*), so it takes on whatever you plugged in.

The intended companion is the pack's Integer Settings node, which outputs a clean 1 or 2 from a simple enable/disable toggle. Wire Integer Settings into selection_setting and now your whole branch flips from one boolean switch - much nicer than editing a number by hand mid-workflow.

The inputs and outputs that matter

  • selection_setting - 1 or 2. Set it directly, or drive it from Integer Settings for one-click switching.
  • input_1 / input_2 - the two candidates. Both are optional, so you can wire just the branches you're using.
  • output - the chosen input, passed straight through.

How to install it

ComfyUI Manager → search ControlAltAI Nodes → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/gseth/ControlAltAI-Nodes

then restart. Pure logic node, no dependencies.

Common issues

Because the output is a wildcard, ComfyUI can't always infer the type until something's connected on both ends - so wire the output into its destination and feed at least the input you're selecting, and the type resolves. If you set selection_setting to 2 but only wired input_1, you'll get nothing useful; make sure the branch you're selecting is actually connected.

The honest take: it's a switch, it does exactly what a switch does. The reason to use this one over rolling your own is the any-type behavior plus the clean Integer Settings pairing. If you need three branches instead of two, the pack has Switch (Three Way), which pairs with Integer Settings Advanced the same way.

CategoryControlAltAI Nodes/Logic

Inputs (3)

NameTypeDefaultDescription
selection_settingINT11–2
input_1opt*
input_2opt*

Outputs (1)

NameTypeDescription
output*