ControlAltAI: Switch (Two Way)
Route anything to anywhere, and it won't type-check you
- input_1
- input_2
- output
Most switch nodes in ComfyUI come in flavours: one for latents, one for images, one for models. This one doesn't care. Its sockets are type * - the wildcard the ComfyUI backend documents as an input that "can be connected to any source" - so the same node can pass a checkpoint, a latent, a string, or an image, whichever input you point it at.
That's the whole reason to reach for it. You keep two model loaders in one workflow, or two upscale paths, or a generation branch and a test branch, and flip between them with a single integer instead of deleting and re-wiring half the canvas.
How it works
Two optional any-type inputs, one selection_setting integer, one output:
if selection_setting == 2:
selected_output = input_2 if input_2 is not None else input_1
else:
selected_output = input_1 if input_1 is not None else input_2
So: 1 passes input_1, 2 passes input_2, and anything else also passes input_1 because the else branch catches it. Each side has a fallback to the other when its socket is empty - which sounds helpful and is occasionally a trap. If you select input_2 but forget to connect anything to it, you don't get an error, you get input_1. Silent fallback is the classic "why is my output the wrong image" moment with this node.
It also declares VALIDATE_INPUTS returning True, which tells the backend to skip type-checking these sockets. That's what makes the wildcard work - and it means ComfyUI will happily let you route a LATENT into a socket that wants an IMAGE. You'll find out at execution time, with a type error from the downstream node rather than from this one.
Inputs and outputs
selection_setting- requiredINTwidget, range 1–2, default 1. This is what a Switch (Two Way) workflow drives;1= first input,2= second.input_1,input_2- optional, both*. Label them mentally; nothing on the canvas will tell you which is which later.- output
output- also*.
Pairing it with Integer Settings
The intended combo is ControlAltAI: Integer Settings, which emits 1 when its toggle is off and 2 when it's on. Wire setting_value → selection_setting and you've built a two-position selector whose knob is one checkbox. To do that you have to right-click selection_setting → Convert widget to input first, since it's a widget by default - that conversion step is required for every connection into a widget anywhere in ComfyUI, and forgetting it is the single most common "the wire won't attach" complaint.
One thing worth being clear-eyed about: a switch reroutes results, it doesn't skip work. ComfyUI still executes every node wired into both inputs on every queue, because the graph doesn't know your selection is a runtime value until the node runs. So this saves you rewiring, not VRAM.
Installing it
Part of ussoewwin/ComfyUI-NunchakuFluxLoraStacker - a pack that bundles a Nunchaku FLUX LoRA stacker, Florence-2 captioning nodes, a TensorRT CCSR upscaler, and this ControlAltAI utility set (a Python 3.13 fork of gseth/ControlAltAI-Nodes, which is why the classes carry the hswq_ prefix). Manager search ComfyUI-NunchakuFluxLoraStacker, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker.git
pip install -r requirements.txt
Restart afterwards. No models, no GPU for this node - but install the full requirements file: the pack imports its CCSR dependencies at load time, and one missing package hides every node in it. nunchaku is the guarded exception.
If something's off
The output is always the first input. Check selection_setting is actually 2, then check something is connected to input_2. An empty socket falls back silently.
It worked, then broke on a new ComfyUI version. The wildcard trick relies on VALIDATE_INPUTS behaviour in the backend. If a core update tightens type resolution, these sockets can start erroring at queue time. It's rare, but this is the node class to suspect.
Only one of the two branches ever runs, no matter what you flip. You may have connected the switch's output to both branches downstream instead of using two switches, or wired the same toggle to both. One selector picks one path; if you need the other path to be the inverse, put a Boolean Reverse in front of a second switch.
If you already run rgthree-comfy, its Any Switch is the same idea in the other flavour - no selector, it walks its inputs and passes the first one that isn't empty. That's the better node when the graph should decide. This one is the better node when you should.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| selection_setting | INT | 11–2 | — |
| input_1opt | * | — | |
| input_2opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |