Nodes/duckcomfy personal nodes/C Switch Boolean Conditioning
ComfyUI Node

C Switch Boolean Conditioning

Swap positive prompts mid-workflow with a checkbox

By duckcomfy·Created about a year ago·Updated 10 months ago· 0
C Switch Boolean Conditioning
  • on_true
  • on_false
  • conditioning
booleantrue

C Switch Boolean Conditioning routes between two CONDITIONING inputs - on_true and on_false - based on a boolean, and passes the winner through. It's the same A/B switch shape as the pack's float version, but for the thing that actually steers the image: the encoded prompt. One checkbox, and the sampler is guided by a completely different prompt.

The realistic use is keeping two modes of the same workflow alive at once. One conditioning encodes "portrait, soft light, plain background" for a clean shot; the other encodes "portrait, holding a coffee cup, cafe bokeh." A toggle switches between them without rebuilding the graph, and because both branches stay wired you can flip back and forth while iterating. The same pattern works for negatives, or for toggling a ControlNet-driven prompt vs a plain one.

The inputs that matter

  • on_true - CONDITIONING, used when the boolean is on.
  • on_false - CONDITIONING, used when it's off.
  • boolean - the selector, default on.
  • Output conditioning - whichever input won, wired into a KSampler's positive or negative socket.

Both conditioning inputs are lazy, which matters more here than anywhere: the unselected branch's entire upstream chain - its text encoder, its CLIP, its wildcard processing - doesn't run. Toggle from the heavy prompt to the light one and you genuinely skip that encode work, not just its result. That's a real speedup on a big graph and the main reason to prefer a lazy switch over a manual rewire.

Why you'd reach for it

The conditioning version earns its keep in shared workflows and batch experiments. You want to A/B two prompt philosophies on the same seed and the same sampler settings - this is the node. You want a "detail pass" toggle that feeds the detailer a different prompt - this is the node. It also composes with the pack's I2iToggle / I2Cnet2IToggle booleans: flip one checkbox and both your latent source and your prompt swap together.

Install

Part of duckcomfy personal nodes. ComfyUI Manager → search "duckcomfy personal nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/duckcomfy/duckcomfy_personal_nodes

Restart ComfyUI. No pip dependencies, no model downloads.

Gotchas

Same lazy-input caveat as the float switch, with a sharper edge: if on_false is unwired and you flip the boolean off, the run fails at execution time because the now-needed conditioning is missing - and since conditioning chains are the expensive part of a graph, that failure shows up as a mid-run crash, not a nice red warning. Keep both sides wired unless you've deliberately locked the boolean. Also remember conditioning carries the text-encoder's assumptions: switching between an SDXL-encoded and an SD 1.5-encoded conditioning on one sampler is a mismatch, so keep both branches built from the same CLIP.

Categoryduckcomfy

Inputs (3)

NameTypeDefaultDescription
on_trueCONDITIONING
on_falseCONDITIONING
booleanBOOLEANtrue

Outputs (1)

NameTypeDescription
conditioningCONDITIONING