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

Lazy Switch 2 Values (obvpm)

Switch a pair without them drifting apart

By chanon·Created about a month ago·Updated a day ago· 40
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

Values in ComfyUI rarely travel alone. A model comes with a CLIP. An image comes with its mask. A conditioning setup comes with its own VAE. So the moment you switch branches, you're switching two or three wires that must agree - and two separate Lazy Switches with two separate booleans is a setup that will eventually disagree, because you'll change one and forget the other.

This is the fix: one boolean, two values, both from the same side.

What it does

boolean true means read the on_true_value_* inputs; false means read on_false_value_*. The selected side's values come out as value_1 and value_2, in matching positions. Both slots switch together - there's no way to take slot 1 from the true side and slot 2 from the false side, which is precisely the guarantee you're here for.

Laziness works the same as the single-value switch and, if anything, matters more here. Both inputs are lazy on each side, and on a run the node only requests the selected side's pins. So the branch you didn't choose - its loader, its LoRA stack, its sampler - never executes, and you don't pay VRAM for a pair of models you aren't using.

Unconnected slots on the selected side give you None rather than an error, so a half-populated branch doesn't detonate the run. That's a convenience and a trap in equal measure: a None flowing into a required input somewhere downstream still fails, just further away. If a run is failing at a node that isn't obviously related to your switch, check whether the selected side actually had something on both pins.

Inputs and outputs

boolean is required and connectable - a widget by default, a socket if you convert it. Then on_false_value_1, on_false_value_2, on_true_value_1, on_true_value_2, all optional wildcards. Out come value_1 and value_2.

The cases it's built for

Model and CLIP as a unit. The classic reason to want this: two checkpoints where one has a matching text encoder and one doesn't, and the pair has to stay matched. One switch, one boolean, no chance of running model A with CLIP B and getting the mush that results.

Image and mask together. Latent-space inpainting and any masked pipeline where the pair is meaningless apart. A mask from the wrong branch is worse than no mask, because it looks like it worked.

Positive and negative conditioning, latent and its noise scale, video and its audio track - anything where the two values are two halves of one decision.

For a single value, use the plain Lazy Switch; there's no reason to carry a second empty pin around. For three, there's a three-slot version next door with the same mechanics.

The usual caveats apply

Laziness stops the branch it doesn't take, not the sink at the end of the graph. Output nodes - Save, Preview, anything that reports a result - are execution roots in ComfyUI, and the engine walks backwards from them, so a save node with any live path into it still runs. If you want a branch completely off, pair the lazy switch with a muting gate downstream. That pairing, and which half people forget, is the stuff of half the routing questions that get posted; the plumbing notes on this ecosystem set out the same distinction for the switch and mute nodes other packs ship.

Also worth remembering: the values here are wildcards, so nothing is type-checked. That's what makes a switch possible in the first place, and it's also why a wrong pairing shows up as a downstream error rather than as a red wire.

Install

Manager, search comfyui-obvpm, or:

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

Restart ComfyUI. The pack has no Python dependencies to install - it declares none on purpose, because everything it imports already comes with ComfyUI - and nothing to download. Search obvpm in the node menu to find the whole set.

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.