Mpi Any Inverted Switch
One input, pick where it lands
- input
- any_1
- any_2
- any_3
- any_4
- any_5
- index
A normal switch takes several inputs and routes one to a single output. Mpi Any Inverted Switch is that node turned around: one input in, and an INT select widget (1–5) decides which of the five outputs it comes out of. If MpiAnySwitch is "pick which thing to use," this is "decide which branch gets the thing." It's the fan-out cousin of the switch family, and it's the node you reach for when one value should land in different places depending on a runtime condition.
The shape is minimal: a single input socket (wildcard *, accepts any type), the select widget (default 1, min 1, max 5, tooltip "Selection from 1 to 5"), and five outputs any_1 through any_5 plus an index output that echoes the selection. Exactly one of the five outputs carries the value - the rest emit nothing (technically an ExecutionBlocker), so downstream branches hanging off unselected outputs just don't run that run.
The key difference from the plain switch, beyond direction: here there's only one input, so there's nothing to be lazy about on the input side. The laziness this node buys you is downstream - since the four unselected outputs produce nothing, any branch fed by them is skipped, which means you can wire five different subgraphs to the outputs and only the selected one executes. It's a routing valve for "where does this value go," not "which value do I use."
The natural use is destination routing with a single source. A prompt that should be processed differently depending on a mode flag; a seed that needs to reach exactly one of several samplers; a boolean that fans out to whichever pipeline segment is active this run. Drive select from a seed, a random int, or the int output of MpiBoolean, and the same value goes wherever the run decides. It pairs neatly with the plain switch, too: AnySwitch picks the source, AnyInvSwitch picks the destination - together they're a crossbar.
The honest caveat: because the unselected outputs are blockers, any node wired to them that you expected to always run will silently not run when its output isn't selected. That's the feature, but it catches people who wire the output into a logger or a save node and wonder why nothing logged. If you need a value fanned out to all outputs, this isn't the node - you'd just reroute.
Install is pack-standard: ComfyUI Manager → search ComfyUi-MpiNodes → install, or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
Restart, and it's under MpiNodes/Logic. No requirements file, no model downloads - pure Python on top of ComfyUI, the same pack behind the Cubric Vision app.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input | * | — | |
| select | INT | 11–5 | Selection from 1 to 5 Output index is also 1 to 5 |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| any_1 | * | — |
| any_2 | * | — |
| any_3 | * | — |
| any_4 | * | — |
| any_5 | * | — |
| index | INT | — |