ComfyUI Node

Switch Duo

Route two values with one boolean, no wiring spaghetti

By drmbt·Created 2 years ago·Updated 7 months ago· 6
Switch Duo
  • on_false1
  • on_true1
  • on_false2
  • on_true2
  • override_switch
  • OUTPUT1
  • OUTPUT2
valuefalse

Every ComfyUI regular has built the same ugly thing: two Primitive nodes, a boolean, and a couple of conditional wires to pick between plan A and plan B. It works, and it clutters your graph. Switch Duo is the pack's answer to that - a switch that routes two values at once based on one boolean, which is the upgrade nobody thinks to ask for until they need to toggle both a prompt and a seed (or a model and a filename) together. One node, one decision, two outputs that stay in sync.

It's a fork-friendly QoL node in the DRMBT nodes category, the same grab-bag category as Text ++ and Number ++. Like those, it accepts any_typ inputs - it doesn't care whether you're switching strings, numbers, images, or latent tensors, which is what makes it actually useful rather than another string-only switch.

How it works

Dead simple under the hood, which is the point. You give it value (a boolean), plus on_true1/on_false1 for the first output and on_true2/on_false2 for the second. If the boolean is true, OUTPUT1 passes on_true1 and OUTPUT2 passes on_true2; false flips both to the _false inputs. Two channels switch together, so you never get a state where output 1 updated but output 2 didn't.

The one bit of cleverness is override_switch. It's an optional any_typ input that can drive the decision from elsewhere in the graph - handy when you want the switch to follow some computed value rather than a hand-set checkbox. Truthiness handling is forgiving: strings like "false", "0", "0.0", "", and "none" evaluate to false, everything else to true, and numbers/booleans convert naturally.

The inputs that matter

  • value - the boolean that picks the branch. The checkbox you'll flip most of the time.
  • on_true1 / on_false1 - the two candidates for OUTPUT1. Any type.
  • on_true2 / on_false2 - the two candidates for OUTPUT2. Optional, but they're the point of this node.
  • override_switch - optional; drives the decision from a computed value instead of the checkbox.

Outputs are OUTPUT1 and OUTPUT2, both any_typ, both following the same branch.

Installing

Switch Duo ships in the drmbt/comfyui-dreambait-nodes pack. ComfyUI Manager: search comfyui-dreambait-nodes. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/drmbt/comfyui-dreambait-nodes
# restart ComfyUI

No dependencies beyond the pack itself - it's a tiny Python class.

Where it fits, and where it doesn't

The killer use case is A/B testing with paired values: switching between "cinematic" / seed 100 and "experimental" / seed 200 in one flip, keeping the two halves from desyncing. It also shines when you want a bypass toggle that routes both the input and a label string. What it's not is a multi-input selector - it's strictly two-way, so if you need to pick among three or more options, grab a proper switch node instead. And if you're switching heavy things like models or latents, the any_typ passthrough works, but remember the input has to be wired - this isn't a primitive you can type values into. Small node, specific job, does it cleanly.

CategoryDRMBT nodes

Inputs (6)

NameTypeDefaultDescription
valueBOOLEANfalse
on_false1*
on_true1*
on_false2opt*
on_true2opt*
override_switchopt*override any type bool, float int or legal float wrappable string value to number

Outputs (2)

NameTypeDescription
OUTPUT1*
OUTPUT2*