Nodes/ComfyUI-nhknodes/πŸ”€ Conditional Router Dual (nhk)
ComfyUI Node

πŸ”€ Conditional Router Dual (nhk)

Route Two Wires at Once β€” Conditional Router Dual (nhk)

By EnashkaΒ·Created 12 months agoΒ·Updated 28 days agoΒ· 23
πŸ”€ Conditional Router Dual (nhk)
  • pass_input1
  • pass_input2
  • fail_input1
  • fail_input2
  • output1
  • output2
  • info
β—„conditiontrueβ–Ί

Conditional Router Dual (nhk) is the two-lane version of the pack's Conditional Router: instead of choosing between one pair of inputs, it chooses between two pairs. A single boolean condition picks either the pass_input1/pass_input2 pair or the fail_input1/fail_input2 pair, and both selected values come out its two outputs.

Why would you route two wires together? Because in real workflows data travels in pairs: an image and its mask, a latent and its conditioning, an image and its prompt text. The plain router would need two of them wired in parallel, each with its own condition - which means duplicating your condition logic and hoping both flip together. This node guarantees the pair stays together. It's part of the pack's WIP image-evaluation family, where the classic pattern is routing an image and its evaluation metadata down the same path.

How it works

The mechanism is lazy evaluation via check_lazy_status. When the graph is being planned, this node tells ComfyUI: "only execute the pass inputs" or "only execute the fail inputs," depending on condition. The losing branch never runs. That's the whole point - no wasted work on an img2img chain you're not taking, and no risk of a side effect (a save, an API call) firing on a path you didn't want.

The info output is a STRING telling you which path won ("Using pass inputs" / "Using fail inputs"), which doubles as a debug flag and as a way to log routing decisions downstream.

Inputs and outputs

  • condition - boolean, default true. True = pass pair, false = fail pair.
  • pass_input1, pass_input2 - the pair used when condition is true.
  • fail_input1, fail_input2 - the pair used when condition is false.

Outputs:

  • output1 / output2 - the selected pair.
  • info - which path was taken.

All inputs are wildcard (*), so the pairs can be any two types - but the two inputs in each pair are wired by you, and it's your job to keep them meaningfully paired. There's no type enforcement between output1 and output2.

Installing it

Same as the whole pack:

cd ComfyUI/custom_nodes && git clone https://github.com/Enashka/ComfyUI-nhknodes

restart, or "NHK Nodes" from ComfyUI Manager. It appears under nhk/wip.

The caveats, since it's WIP

This is in the pack's experimental family, and the author's own docs warn these nodes may change while they work out ComfyUI's pull-based execution quirks. Two things to watch: first, lazy evaluation means the unselected branch genuinely doesn't execute - so don't hang a critical side effect (like a save) off the losing input and expect it to run. Second, remember ComfyUI executes backward from terminals; if you route a branch that has no real terminal at its end, it may never fire at all. And while the pair-keeping is convenient, it's a thin convenience over two separate routers - if you only need to route one value, the single Conditional Router is the simpler node to read.

Categorynhk/wip

Inputs (5)

NameTypeDefaultDescription
conditionBOOLEANtrueTrue = use pass inputs, False = use fail inputs
pass_input1*First input when condition is True
pass_input2*Second input when condition is True
fail_input1*First input when condition is False
fail_input2*Second input when condition is False

Outputs (3)

NameTypeDescription
output1*First selected input based on condition
output2*Second selected input based on condition
infoSTRINGWhich path was taken