Nodes/Comfyui_LG_Tools/🎈LazySwitch1way
ComfyUI Node

🎈LazySwitch1way

The switch that refuses to run the branch you don't need

By LAOGOU-666·Created 2 years ago·Updated 7 months ago· 369
🎈LazySwitch1way
  • ON_TRUE
  • ON_FALSE
  • OUTPUT
booleantrue

LazySwitch1way is the ComfyUI "if/else" that actually saves you time. You feed it two possible values and a boolean, and it passes through one of them - but here's the trick: the input you don't select never executes. The README states it plainly: "only run the specified line, the non-specified line need not load." That lazy behavior is the whole reason this node exists, and it's what separates it from a plain boolean ? a : b switch.

Why does that matter? Consider a workflow where one branch loads a heavy checkpoint or runs a big sampler and the other just passes an image through. A normal switch (including MuterSwitcher in this same pack) evaluates both branches first - so you pay for the heavy model load even when you're not using that branch. LazySwitch1way tells ComfyUI, via check_lazy_status, which inputs are actually needed, and ComfyUI skips the rest of that dependency chain. The unselected branch simply doesn't run.

The inputs that matter

  • boolean (BOOLEAN, default true) - the selector.
  • ON_TRUE (any, lazy) - the value that passes through when boolean is true.
  • ON_FALSE (any, lazy) - the value that passes through when boolean is false.

Both data inputs are wildcard * type (images, latents, models, strings - anything), and they're flagged lazy, which is what unlocks the skip behavior. One output, OUTPUT (*), carries the chosen value onward. There's also a LazySwitch2way sibling in the pack if you need two outputs routed at once; 1way is the one you reach for when you only need a single value forward.

Where it shines

The classic use is model/preprocessing selection: "use the upscaler if this is on, otherwise pass through raw," or "pick between two LoRA chains" where the unused chain's loader would otherwise burn VRAM and startup time every single run. It's also the natural companion to the pack's GroupSwitcher - same idea of picking a branch, but at the data level instead of the graph level.

Installing it

Part of Comfyui_LG_Tools:

cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools.git
pip install -r requirements.txt

Or via ComfyUI Manager → "Comfyui_LG_Tools" → restart. It's under Add Node → 🎈LAOGOU → Switch.

Common issues

  • "The other branch still runs." Check you're using the Lazy node and not MuterSwitcher - the pack's non-lazy switch will happily evaluate both sides. Also confirm you haven't manually connected the unselected input to something that forces execution.
  • "It returns the wrong value." Double-check the boolean direction. trueON_TRUE, falseON_FALSE. It's easy to wire them backwards and chase the bug for a while.
  • Beware the two-input trap. If you feed both inputs from the same upstream node, that upstream still runs regardless - laziness skips the branch, not its shared parent.

If you're doing A/B routing in anything beyond a toy graph, this is the switch to reach for. The lazy evaluation is a small feature that compounds into real time saved on big workflows.

Category🎈LAOGOU/Switch

Inputs (3)

NameTypeDefaultDescription
booleanBOOLEANtrue
ON_TRUE*
ON_FALSE*

Outputs (1)

NameTypeDescription
OUTPUT*