ControlAltAI: Switch (Three Way)
The any-type router, with a fallback that will quietly surprise you
- input_1
- input_2
- input_3
- output
Same trick as the two-way version, one more input. Three sockets typed *, an integer selector from 1 to 3, and one output that carries whichever input you pointed at. It'll route a model, a latent, an image, a string - the backend's wildcard type means the node "can be connected to any source" and it's up to the node to make sense of what arrives, which here just means passing it on untouched.
Three branches in one graph is the honest use case: three checkpoints, three upscalers, three prompt strategies, and one number deciding which one survives to the next node.
How it works
The selection is a chain of ifs, and the interesting part is the fallback nesting:
if selection_setting == 2:
selected = input_2 if input_2 is not None else (input_1 if input_1 is not None else input_3)
elif selection_setting == 3:
selected = input_3 if input_3 is not None else (input_1 if input_1 is not None else input_2)
else:
selected = input_1 if input_1 is not None else (input_2 if input_2 is not None else input_3)
Read the fallback order carefully, because it isn't symmetric. Selecting 2 with input_2 unconnected gives you input_1; selecting 3 with input_3 unconnected also gives you input_1 (not input_2, which you might reasonably have expected). Selecting anything other than 1, 2 or 3 - including a value that a buggy upstream node produced - lands on the else branch and passes input_1.
And because the wildcard type is paired with a VALIDATE_INPUTS that returns True, the backend performs no type checking on these sockets at all. That's what lets this node route anything; it's also why a mismatched connection surfaces as an error from the downstream node, at queue time, often phrased in a way that points nowhere near the switch.
Inputs and outputs
selection_setting- requiredINTwidget, range 1–3, default 1.input_1,input_2,input_3- optional, all*.- output
output-*, the selected value.
Driving it
The node it was built to pair with is ControlAltAI: Integer Settings Advanced, which holds three mutually-exclusive toggles and emits 1, 2 or 3. Connect setting_value → selection_setting and you've got a three-way router with radio buttons on the canvas.
To make that connection you must first right-click selection_setting and choose Convert widget to input. Widgets can't accept wires; converting promotes the field to a socket. Do the reverse if you'd rather just type the number - that's a perfectly valid way to use this node, and honestly for a "set it and leave it" graph it's less machinery.
The value-add over three separate wires, of course, is the number becomes one thing: drive it from a primitive, from an expression node, or from the Integer Settings toggle bank, and the whole routing decision lives in one place.
Installing it
It ships in ussoewwin/ComfyUI-NunchakuFluxLoraStacker - a grab-bag pack containing a Nunchaku FLUX LoRA stacker, the Florence-2 captioning suite, a TensorRT CCSR upscaler and this ControlAltAI utility set (a Python 3.13 fork of gseth/ControlAltAI-Nodes, which is why the class names all carry an hswq_ prefix). ComfyUI Manager: search ComfyUI-NunchakuFluxLoraStacker. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker.git
pip install -r requirements.txt
Then restart. This node needs no model files and no GPU - but install the entire requirements file anyway, because the pack imports its CCSR dependencies (pytorch-lightning, taming-transformers, omegaconf, einops, open-clip-torch) at load time and any missing one takes the whole pack with it. The nunchaku dependency is import-guarded, so an AMD/ROCm box that can't install it still loads these nodes.
If something's off
Wrong branch, no error. That's the fallback. Check that the socket you selected actually has something plugged in.
ComfyUI accepts a connection it should have refused. Expected - these are * sockets with validation disabled. If the graph errors at run time, look downstream of the switch first.
The switch is a no-op on speed. Every node wired into all three inputs still runs on every queue. ComfyUI executes the connected graph; a runtime selector can't change that. If your goal is saving VRAM, bypass the branch with a mute/bypass control instead - rgthree-comfy's group bypassers are the usual answer for that, and its Any Switch is the fallback-only cousin of this node if you'd rather the graph pick than you.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| selection_setting | INT | 11–3 | — |
| input_1opt | * | — | |
| input_2opt | * | — | |
| input_3opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |