π Double Switch - Out (nhk)
Send a Wire Pair to One of Two Destinations β Double Switch - Out (nhk)
- input1
- input2
- A1
- A2
- B1
- B2
Double Switch - Out (nhk) is the outgoing half of the pack's paired A/B switch design. It takes one double input (input1/input2) and, based on a boolean selector, routes that pair to either the A outputs or the B outputs. Input goes in as a pair, comes out as whichever pair you selected.
The "In/Out" split is the pack author's way of covering both ends of a two-wire pipeline. "Double Switch - In" picks which pair of inputs flows downstream; this one decides which of two destinations receives the pair. Typical shape: one img2img chain that produces an image plus its mask, and you want to send that pair either to the "pass" processing branch or the "fail" redo branch. Two destinations, one switch, both wires kept together.
How it works
Mechanically it's the mirror of Double Switch - In. When selector is true, input1/input2 go out on A1/A2 and the B outputs receive None. When false, the routing flips: the pair goes to B1/B2 and the A outputs get None. The inactive outputs being None - rather than some error - is deliberate: downstream nodes that don't receive a wire simply don't execute, so the unselected destination chain never runs.
The routing is lazy too, in the sense that only the selected branch's consumers get pulled into execution; there's no wasted compute on the branch you didn't take. The selector is a plain boolean widget, so you can flip it by hand or drive it from an evaluator or another node.
Inputs and outputs
selector- boolean, default true. True = A outputs, false = B outputs.input1,input2- the pair to route.
Outputs:
A1,A2- receive the pair when selector is true (elseNone).B1,B2- receive the pair when selector is false (elseNone).
All inputs are wildcard (*). As with its In counterpart, nothing checks that input1 and input2 are the same type - you're the one keeping the pair coherent.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes && git clone https://github.com/Enashka/ComfyUI-nhknodes
restart, or "NHK Nodes" from ComfyUI Manager. No extra deps.
What to keep in mind
The "unselected outputs get None" behavior is the thing to internalize: it means the destination branch you didn't pick genuinely doesn't execute - no save, no API call, nothing. If you expected both destinations to run, that's a misunderstanding of the node, not a bug. And since it's the Out companion, it's only useful in graphs that already think in pairs; for single-value routing the pack's Conditional Splitter (one input to two outputs) is the simpler shape. Used where pairs are natural - image+mask, latent+conditioning, image+metadata - it keeps the two wires honest through the whole pipeline.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| selector | BOOLEAN | true | True = output to A outputs, False = output to B outputs |
| input1 | * | First input to route | |
| input2 | * | Second input to route |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| A1 | * | β |
| A2 | * | β |
| B1 | * | β |
| B2 | * | β |