Nodes/switch-auto-selector-any-five-by-steve-lasmin/Switch Auto Selector (ANY Five) by Steve Lasmin
ComfyUI Node

Switch Auto Selector (ANY Five) by Steve Lasmin

The switch that refuses to guess when you feed it two signals

By Eklipsis·Created a day ago·Updated a day ago· 0
Switch Auto Selector (ANY Five) by Steve Lasmin
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • output

Most routing nodes quietly pick a winner. This one refuses to pick at all unless exactly one of its five inputs is carrying a signal - and when you get it wrong it throws a red-node error and tells you which inputs were live. That's the whole personality of Switch Auto Selector (ANY Five) by Steve Lasmin: it trades a selector dropdown for a strict "one active source, or no run" rule.

Why you'd reach for it

Say you've got three candidate positive-prompt branches, or two checkpoint loaders, or a handful of images you keep swapping as the input to a pass. The normal way to choose is an A/B switch with an index you edit, or a first-non-null fallback like rgthree's Any Switch. Both work, but both have a failure mode this node is designed to kill: the silently wrong pick. A first-non-null switch takes whichever branch happens to be live and never complains, so if you forget to turn one off you get the branch you didn't want and may not notice for a while. Here, forgetfulness is loud.

The intended workflow is to wire up to five candidate sources and leave all but one off - disconnect, bypass, or mute them - and let the node route the survivor to the output. It's routing-by-to-do-list: instead of maintaining a dropdown, you maintain which branches are muted.

How it works

The node is tiny, and that's a feature. All five inputs are optional and typed ANY (the * wildcard), so the node doesn't care whether it's routing an image, a latent, a model, conditioning, or a string - it just passes whatever the single live input carried, unchanged.

The mechanism rests on a ComfyUI convention: an optional input you leave unwired, or that comes from a muted or bypassed node, arrives at the node's function as None. Its select() method collects whichever of the five inputs are not None, then checks the count:

  • Exactly 1 → that value is routed to the output, and the output takes the active input's type.
  • 0ValueError: No active signal detected. You muted everything.
  • 2+ValueError listing exactly which inputs are live: Multiple active signals detected on: input_2, input_4. Mute one more and re-run.

That error listing the offenders is genuinely useful - it tells you precisely which branches you forgot to kill instead of making you hunt through the graph.

The inputs and output that matter

  • input_1 through input_5 - all optional, all ANY, all interchangeable. The tooltip on each is the author's rule: Must be None when inactive. If a socket isn't used, leave it disconnected.
  • output - the single active signal, type-matching whatever input won.

There are no widgets to configure and no settings to fumble with. Wiring it into a consumer is a straight line: whatever you'd have fed from one source now feeds from the selector's output.

Installing

Via ComfyUI Manager, search "Switch Auto Selector (ANY Five) by Steve Lasmin" and hit install. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/Eklipsis/switch-auto-selector-any-five-by-steve-lasmin.git

Then restart ComfyUI. There's nothing else to fetch - no model files, no Python dependencies (the manifest's dependency list is empty), just one file with one class.

Where people get burned

This is a new, tiny pack - one commit, essentially no community footprint yet - so "where people get burned" is mostly the shape of the node itself.

First, the mute-versus-bypass trap. Bypass in ComfyUI is a pass-through: a bypassed node hands its input along, so bypassing the middle of a chain does not deactivate that branch - the value still reaches the selector and it still counts as active. Mute is what actually zeros a branch out. When the README says "bypass or mute all sources except one," read that as: mute the source nodes of the branches you don't want (right-click → Mute, or Ctrl+M). If the error still names an input you thought you'd turned off, you probably bypassed instead of muted.

Second, keep your candidates the same type. The output only matches the type of whichever input is live, so if you switch between an image and a latent, the downstream node that validated against one will choke on the other. The ANY flexibility is for routing different kinds of graphs, not for swapping types mid-stream.

And for the honest take: if you just need two sources and a checkbox, a stock A/B switch is less ceremony. This node earns its keep when you want the strictness - the guarantee that a half-off graph fails loudly instead of silently running the wrong branch.

Categoryutils

Inputs (5)

NameTypeDefaultDescription
input_1opt*
input_2opt*
input_3opt*
input_4opt*
input_5opt*

Outputs (1)

NameTypeDescription
output*