Any Switch π
One Switch to Route Any Socket Type β OmniNodes' Any Switch π
- input_a
- input_b
- output
- selected_label
Switch nodes in ComfyUI have a serious bloat problem. Most packs ship one per data type - an IMAGE switch, a MODEL switch, a LATENT switch, a CONDITIONING switch - and if you use more than two types you end up hunting through the menu for the right one. OmniNodes' Any Switch is the "one to rule them all" version: a boolean-gated A/B router whose sockets accept anything, so you keep one node in your palette instead of six.
It's dead simple to use. A condition BOOLEAN decides the route - True passes input_a through, False passes input_b. Because the inputs and the output are all the wildcard type (* in the schema), you can plug a model into it in one workflow and a string in the next without swapping nodes. The classic use is keeping two model loaders in one graph and flipping between them with a checkbox, or wiring two prompt sources into one encoder so you can toggle which one is live without rewiring anything.
The one extra output worth wiring
Besides output, it returns selected_label - a STRING that says "a" or "b" depending on which branch fired. That sounds like fluff until you've stared at a generated image and wondered which prompt actually ran. Feed it into a show-text node or a Workflow End run label and you get a permanent record of the branch that produced the output. Genuinely useful for sweeps and A/B runs.
How it actually works
ComfyUI's type system has exactly one escape hatch: the "*" wildcard type, which accepts any socket and leaves it up to the node to make sense of what arrives. That's the entire trick here. The node reads condition, picks one of the two inputs, and passes it through untouched. There's no type coercion, no re-encoding - whatever goes in comes out byte-identical, which is what you want from a switch.
Install
The pack installs like any other. In ComfyUI Manager, search for OmniNodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart ComfyUI, and you'll find this under TensorVizion/Workflow. No extra pip install - this node is pure routing logic with zero dependencies beyond ComfyUI itself.
Where people get burned
Two things trip people up, and they're both conceptual rather than mechanical.
First, this is an A/B selector, not a fallback switch. rgthree's famous "Any Switch" walks its inputs and picks the first non-null one automatically; this node does nothing until you flip the boolean. If you wanted "whatever branch is actually connected wins," this isn't that - this is an explicit routing valve.
Second, the type-erasing convenience has a real cost to graph legibility. The KB's comfyui-ecosystem doc records the community's "please stop using the Anything Anywhere extension" backlash - the argument that wildcard nodes hide what's flowing where and make a graph impossible to debug. A boolean switch is on the mild end of that spectrum (you can see the two wires entering), but don't turn your whole workflow into wildcard soup. Use this where you'd otherwise stack three type-specific switches, not everywhere you can.
Bottom line: if you've ever groaned at needing a switch node per type, this is the one to grab. It routes anything, reports which branch it took, and disappears into your workflow - which is exactly what a switch should do.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| condition | BOOLEAN | true | β |
| input_aopt | * | β | |
| input_bopt | * | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | * | β |
| selected_label | STRING | β |