Nodes/ComfyUI Prepack/đź’€Prepack Merge Selector
ComfyUI Node

đź’€Prepack Merge Selector

One selector knob, five inputs, one output — the poor man's switch

By S4MUEL-404·Created 12 months ago·Updated 10 months ago· 2
đź’€Prepack Merge Selector
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • output
â—„selector1â–ş

Sometimes you don't need a fancy router - you need a knob that picks which of five things goes through. The đź’€Prepack Merge Selector is exactly that: five wildcard inputs (input_1 through input_5), one selector integer from 1 to 5, and a single output that passes through whichever input matches the selector number. Everything else is ignored.

If you've used a switch node from rgthree or another pack, the concept is familiar. What this one adds is zero ceremony: no per-input type declarations, no pairing with a separate selector node - the selector and the inputs live on the same node, and the * wildcard means each input accepts whatever you throw at it.

How it works

The mechanism is trivial in the best way. selector defaults to 1 and ranges 1–5. When the node runs, it returns input_N where N is the selector value, and discards the other four. Because every input is a wildcard, you can mix types freely - input_1 could be a MODEL, input_2 a string, input_3 an image, and the node is equally happy passing any of them through. It's a pure passthrough: the selected value comes out unchanged, with no type coercion.

The classic pattern is to drive selector from another node's output. Wire a seed, a counter, a logic node's result, or a dropdown-driven integer into the selector, and you've turned a static knob into a runtime branch: pick which LoRA stack to use by seed parity, which prompt to apply based on a comparison, which checkpoint pipeline to send down the graph.

Where people get burned

The output type is *, which is both the feature and the trap. ComfyUI will let you wire that wildcard output into most sockets, but the actual type at runtime is whatever input_N was - if you feed a MODEL in and wire the output into an IMAGE socket, you get a runtime failure, not a clean connection error. Wildcards defer type checking to execution time, so a mis-wired selector can fail mid-queue instead of refusing the connection.

The other gotcha: unconnected inputs pass through as None when selected. If selector points at a slot you never wired, you get None out - which often produces a confusing downstream error ("model is None") rather than anything that names the actual problem. Keep the selector in range, or check the selected slot is populated.

Installing it

It ships in the Prepack pack:

cd ComfyUI/custom_nodes
git clone https://github.com/S4MUEL-404/ComfyUI-Prepack.git
pip install -r ComfyUI-Prepack/requirements.txt

Or search "Prepack" in ComfyUI Manager. Dependencies are just PyTorch, NumPy, and Pillow - already present in a stock install. Restart ComfyUI and find it under đź’€Prepack. No models, no config.

If the output seems to be the wrong input, verify the selector value you're feeding - a counter or logic node feeding it with values outside 1–5 will cause the node to pick nothing sensible, and unlike some switch implementations there's no clamping here.

Categoryđź’€Prepack

Inputs (6)

NameTypeDefaultDescription
selectorINT11–5—
input_1opt*—
input_2opt*—
input_3opt*—
input_4opt*—
input_5opt*—

Outputs (1)

NameTypeDescription
output*—