Nodes/ComfyUI Easy Use/easy anythingInversedSwitch
ComfyUI Node Runs on cloud

easy anythingInversedSwitch

Send one input down one of many branches

By yolain·Created 3 years ago·Updated 8 days ago· 2,633
easy anythingInversedSwitch
  • in
  • out0
  • out1
  • out2
  • out3
  • out4
  • out5
  • out6
  • out7
  • out8
  • out9
  • out10
  • out11
  • out12
  • out13
  • out14
  • out15
  • out16
  • out17
  • out18
  • out19
index0

This is the mirror image of a normal index switch. Where the regular switch takes many inputs and picks one to output, anythingInversedSwitch takes one input and routes it to one of many outputs, chosen by an index. Electrical-engineering types will recognize it instantly: the plain switch is a multiplexer, this is a demultiplexer. You send one thing in, and it comes out of out0, out5, or wherever the index points - and every other output gets nothing.

Why you'd want that: conditional branching. You have one image (or latent, or model) and, depending on some upstream decision, you want it to flow into one of several different downstream paths - different upscalers, different post-processing chains, different save destinations. Set the index from that decision and the input takes the matching branch.

How it works

It reads the index and copies the single input in onto exactly one of the numbered outputs. The chosen output carries your value; the rest are empty. Because both the input and outputs are the ComfyUI wildcard type (*), it doesn't care what you feed it - image, latent, conditioning, model, a string. It's pure routing, no transformation.

The inputs and outputs that matter

  • index (INT, 0–9) - which output the input gets routed to. Set it by hand, or - the useful bit - drive it from an upstream node so the branch is chosen dynamically.
  • in (wildcard) - the single value to route.
  • out0 … out19 (wildcard) - the branches. Only the one matching the index receives the value.

Note the asymmetry, because it bites: there are outputs up to out19, but the index widget maxes at 9. If you're setting the index by hand you can only reach out0out9; to hit the higher outputs you'd feed the index from a node that can produce a larger number.

How to install it

Part of ComfyUI-Easy-Use. ComfyUI Manager: search ComfyUI-Easy-Use, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

then install.bat (Windows) or pip install -r ComfyUI-Easy-Use/requirements.txt, and restart. No models.

Common issues & troubleshooting

Downstream branches erroring on empty inputs. This is the big one. Only the selected output carries a value - the others are empty/None. If two of your branches both run to end nodes and the graph tries to execute the un-selected one, it may error on the missing input. The clean way to use a demux is to make sure only the active branch actually needs to run, or to pair each branch with logic that tolerates an empty input.

Off-by-one. Zero-indexed: out0 is the first branch. If the value comes out one slot from where you expected, you're counting from 1.

Can't reach the high outputs. The index widget stops at 9 while outputs go to 19 - a manual index can't select out10+. Drive the index from an integer-producing node if you need the upper range.

Update if it misbehaves. The pack's changelog records fixes to the index-switch family for "certain environments." If it acts strangely on an old install, update Easy-Use before deeper debugging.

CategoryEasyUse/Logic

Inputs (2)

NameTypeDefaultDescription
indexINT00–9
in*

Outputs (20)

NameTypeDescription
out0*
out1*
out2*
out3*
out4*
out5*
out6*
out7*
out8*
out9*
out10*
out11*
out12*
out13*
out14*
out15*
out16*
out17*
out18*
out19*