Merge First
The 'whatever branch is live wins' node
- in_1
- in_2
- in_3
- in_4
- in_5
- in_6
- in_7
- in_8
- in_9
- in_10
- in_11
- in_12
- in_13
- in_14
- in_15
- in_16
- out
Merge First answers a question every conditional workflow eventually asks: I've got several branches that might produce a value - which one do I actually use? The answer, always, is the first one that's actually there. This node takes up to 16 inputs, walks them in order, and passes the first valid one through its single out socket. It's this pack's equivalent of rgthree's Any Switch ("chooses the first input that is not null/empty") - first-available fallback logic with no selector to set and nothing to configure.
What counts as valid
The "valid" definition is the important part, straight from the source: a value counts as invalid if it's None, if it's an ExecutionBlocker, or if it's a blank/whitespace string. That first one is why it pairs so well with this pack's own conditionals. If True returns None on an empty branch; If True 3 and If True 4 emit ExecutionBlockers on theirs. Merge First treats both as "skip me" and slides to the next input, which is exactly the behavior you want when a dead branch shouldn't kill the graph.
Inputs and outputs
The all-optional inputs are in_1 through in_16, every one a wildcard (*) socket that accepts any type - a MODEL, a conditioning, an int, a string, whatever the branches are carrying. No inputs are required, so a graph with one wired branch works fine, and ordering is left-to-right: in_1 wins over in_2, which wins over in_3, and so on. If you want a specific branch to take priority, put it in a lower-numbered slot.
The one output is out, the same wildcard type as whatever won. And if every input is invalid - all sixteen empty, None, or blocked - Merge First returns an ExecutionBlocker itself, meaning downstream nodes don't run at all. That's the fail-closed behavior you want: better to skip the sampling than to feed it garbage.
in_1..in_16(all optional, any type) - the candidates, priority left-to-right.out- the first valid input, or an ExecutionBlocker if none are.
Putting it together
The canonical arrangement in this pack: If True 3's three outputs (blocked where false) wired into Merge First, with a plain model or a core loader on the final slot as a guaranteed fallback. The result is "branch A, else branch B, else branch C, else default" resolved in one node - and it recomputes every run, so flipping your trigger string re-routes the whole thing without you touching a wire.
The honest caveat
Despite the name, this node is purely routing - no merging, no averaging, no combination. It picks one. If you came looking for a node that blends branches, this is the wrong tool.
Installing it
Install: ComfyUI Manager → "Conditional Nodes by Mikudes", or clone into custom_nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/levox00/Conditional-Nodes-Comfy-Ui
Restart ComfyUI. It's in the conditional category, no dependencies to worry about.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| in_1opt | * | — | |
| in_2opt | * | — | |
| in_3opt | * | — | |
| in_4opt | * | — | |
| in_5opt | * | — | |
| in_6opt | * | — | |
| in_7opt | * | — | |
| in_8opt | * | — | |
| in_9opt | * | — | |
| in_10opt | * | — | |
| in_11opt | * | — | |
| in_12opt | * | — | |
| in_13opt | * | — | |
| in_14opt | * | — | |
| in_15opt | * | — | |
| in_16opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| out | * | — |