Nodes/comfyui-obvpm/Lazy Switch 2 Values (obvpm)
ComfyUI Node

Lazy Switch 2 Values (obvpm)

Flip two wires with one boolean, and skip the loser

By chanon·Created about a month ago·Updated a day ago· 42
Lazy Switch 2 Values (obvpm)
  • on_false_value_1
  • on_false_value_2
  • on_true_value_1
  • on_true_value_2
  • value_1
  • value_2
booleantrue

Two wires that always flip together is the most common conditional shape in ComfyUI. A model and its matching LoRA stack. A positive conditioning and the negative that goes with it. A latent and its mask. Two Lazy Switches - one per value - works, right up until the day you change one and forget the other, and spend twenty minutes wondering why a LoRA is being applied to the wrong base model.

Lazy Switch 2 Values (obvpm) is the same switch, ganged. One boolean, two slots, both sides switch together.

Inputs and outputs

  • boolean - required BOOLEAN, default true. True selects the on_true_value_* block; false selects the on_false_value_* block.
  • on_true_value_1, on_true_value_2 - optional wildcard inputs, the true side.
  • on_false_value_1, on_false_value_2 - optional wildcard inputs, the false side.
  • value_1, value_2 - the selected side's values in the same slots.

Slot pairing is positional: on_true_value_1 and on_false_value_1 both feed value_1. Unconnected slots on the selected side output None rather than erroring, which is what makes a half-populated switch usable while you're still building.

The part that actually matters: laziness

Only the selected side executes. Not "runs and gets discarded" - the nodes feeding the unselected side never execute at all, because the inputs are declared lazy and the node's check_lazy_status asks the engine for exactly one side. On a graph where the false side is an entirely different model path with its own samplers, that's the whole point. Switching between two pipelines becomes free.

Two consequences worth internalising. First, an unconnected selected side gives you None rather than an error - deliberate, and it means a half-built workflow still queues. Second, a branch that was muted by an optional gate can be picked back up simply by selecting the other side: the mute only blocked that path, it didn't break the node.

The companion pattern: drive boolean from a gate's present output, and this switch flips itself based on whether an input exists. Load a reference image and the graph takes the reference path; don't, and it doesn't.

So why not 3 values?

Because most pairs really are pairs, and the five-slot version is worse to read. If you find yourself routinely leaving slot 3 empty, use this one. The three-value version exists for the genuinely-triple cases - model, clip and vae; or latent, mask and seed.

And when the values stop being related, stop ganging them. Two independent decisions want two independent switches; bundling them into one boolean just hides the coupling in the wiring instead of the node.

Install

ComfyUI Manager → search comfyui-obvpm (the pack title), or:

cd ComfyUI/custom_nodes
git clone https://github.com/chanon/comfyui-obvpm

Restart ComfyUI. Category obvpm/switches; searching the node menu for obvpm lists the entire pack. Nothing extra installs - the pack deliberately declares no Python dependencies, and this node is pure execution-logic. As of 0.2.0 every class id ends in (obvpm) (the suffix ended a clash with another pack's Bundle id), and older workflows migrate automatically when you open them.

Traps

Laziness doesn't reach output nodes. If the unselected side ends in a Preview or Save Image, that node still runs - every OUTPUT_NODE is an execution root, and nothing reaches it through a wire, so there's no evaluation to prune. Use the pack's Mute node on that branch if you need it truly dead.

value_1 is still a wildcard. Wire an IMAGE into the true side's slot 1 and a LATENT into the false side's slot 1, and both are legal - you'll find out at the consumer. Slots are type-blind by design, which is flexibility right up until it's a mystery error two nodes later.

It's a switch, not a filter. If what you actually want is "use this value if it exists, otherwise that one", that's First Float / First Int territory, or a gate. This node always has an opinion: one side wins, the other doesn't run.

Categoryobvpm/switches

Inputs (5)

NameTypeDefaultDescription
booleanBOOLEANtrueSelects which side to execute and output: true = the on_true_value inputs, false = the on_false_value inputs.
on_false_value_1opt*Output as value_1 when boolean is false. Only executes while selected; may be left unconnected.
on_false_value_2opt*Output as value_2 when boolean is false. Only executes while selected; may be left unconnected.
on_true_value_1opt*Output as value_1 when boolean is true. Only executes while selected; may be left unconnected.
on_true_value_2opt*Output as value_2 when boolean is true. Only executes while selected; may be left unconnected.

Outputs (2)

NameTypeDescription
value_1*The selected side's value for this slot. None when that slot is unconnected.
value_2*The selected side's value for this slot. None when that slot is unconnected.