Nodes/ComfyUI LC123 Nodes/LC Boolean Switch
ComfyUI Node

LC Boolean Switch

The A/B switch driven by a checkbox

By lonecatone23·Created 2 months ago·Updated 3 days ago· 18
LC Boolean Switch
  • on_true
  • on_false
  • *
statefalse

There are two shapes of switch in ComfyUI, and it's worth knowing which one you're holding. The fallback switch (like LC AnySwitch) picks the first connected input - the graph decides. The A/B switch has a selector and routes whichever input you point at - you decide. LC Boolean Switch is the second kind: a boolean state picks between on_true and on_false, and both of those inputs are any-type (*), so you can route models, latents, images, strings - whatever.

The tooltip says it in one line: "True → on_true, False → on_false." A checkbox (default off) drives it, and the two inputs are optional - which is the feature, because you only have to wire the branch you use. Leave on_false empty and state false and you get None out, which is exactly the null-output trick for muting a branch from inside the data rather than by bypassing nodes.

The classic use is "two of something, one workflow." Two checkpoints, two LoRAs, two seed sources, two upscalers - wire both in, flip the checkbox, and the active branch flows through. It's the manual routing valve the fallback switch isn't: with LC AnySwitch the first connected input wins and you control it by unplugging wires; with this one you keep both wired and control it with a checkbox you can also convert to an input and drive from another node. That last bit matters - convert the state widget to an input and you can drive the switch from a comparison, a random picker, or the output of an LC Boolean, which turns a manual A/B into an automatic one.

Where people get caught is assuming the empty branch is free. If state is true but on_true isn't connected, the output is None - and whether downstream survives depends on the downstream node. Some handle None optional inputs gracefully, some throw. So the rule of thumb: if you're going to leave one side unwired, make sure the consumer can handle nothing arriving. The other common confusion is thinking this node inverts anything - it doesn't. The input state is used as-is; if you need the opposite polarity, that's LC Boolean Flip's job, chained in front.

This is a genuinely useful node to have around, and it's the one I'd reach for when a graph has two competing branches that I switch between constantly during iteration. It's also the natural building block for "experiment A/B" layouts: keep both branches fed from the same upstream, flip the boolean, and compare the outputs.

Mechanically it's the standard first-class switch pattern: * sockets with a VALIDATE_INPUTS style tolerance, one * output that adopts the type of whichever input is live. Small, boring, reliable.

Install is the LC123 pack clone:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

Restart, no pip deps. If you've ever deleted and re-added a node just to swap which model loader was connected, this checkbox saves you the click-torture.

CategoryLC123/utils

Inputs (3)

NameTypeDefaultDescription
stateBOOLEANfalseTrue → on_true, False → on_false.
on_trueopt*Passed through when state is true.
on_falseopt*Passed through when state is false.

Outputs (1)

NameTypeDescription
**