🔶 Any Switch
Manually pick between two inputs by index
- source_0
- source_1
- SOURCE_X
The plain sibling of Any Switch, by Frame. That one drives its switching off an automatic frame counter; this one just holds two sources and picks between them with a number you set - 0 or 1 - like a manual toggle. No frame logic, no restart signal, nothing clever. If you just want a two-way A/B switch you flip yourself, this is the lighter tool for it.
Same family as rgthree-comfy's reroute and context nodes in spirit, if you've used those: it's pure graph plumbing, adds no generation capability, just makes it faster to swap what's feeding a downstream node without re-wiring.
Inputs and outputs
nr- an INT, 0 or 1 (min 0, max 1, step 1, default 0). This is the widget you click to pick which source comes out: 0 selectssource_0, 1 selectssource_1.source_0,source_1- your two wildcard-typed candidates.nr_override(optional, INT) - wire an INT in here instead of clicking the widget, and it takes over. Useful if you want something upstream - a counter, a logic node, another Chaosaiart output - to drive the choice instead of you doing it by hand.SOURCE_X- the single output: whichever sourcenr(ornr_override) points at.
The override pattern here - a plain widget plus an optional input of the same shape that takes priority when connected - shows up across several other nodes in this pack (the ControlNet strength/start/end nodes work the same way). Once you've seen it once, you'll recognize it everywhere.
Installing it
Via ComfyUI Manager: Install via Git URL → https://github.com/chaosaiart/Chaosaiart-Nodes. That's the method the README documents directly; a title search for "Chaosaiart" should also find it.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/chaosaiart/Chaosaiart-Nodes
Linux, inside your venv if you use one:
pip install opencv-python
pip install tqdm
Windows: run the Install_windows script in the cloned folder. Restart ComfyUI afterward either way. Nothing to download model-wise - this node just routes existing data.
Common issues
It silently passes through whatever's wrong. Because both inputs are wildcard-typed, ComfyUI won't complain if source_0 and source_1 are different types - you'll only find out something's mismatched when the downstream node chokes on it. If a graph errors out further along, check what actually got selected here before chasing the error somewhere else.
Nothing happens when you change nr mid-run. Like most ComfyUI widgets, it only takes effect on the next queue - it's not a live toggle you flip during generation.
One shared module for the whole pack. All ~20 Chaosaiart nodes live in a single Python module, so a broken dependency (opencv-python or tqdm failing to install) takes the entire pack offline, not just this node - check your ComfyUI startup log for an import error first if the node's missing entirely.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| nr | INT | 00–1 | — |
| source_0 | * | — | |
| source_1 | * | — | |
| nr_overrideopt | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SOURCE_X | * | — |