Nodes/ComfyUI-SwitchPathLazy/Switch Path Rev (1→2 Lazy)
ComfyUI Node

Switch Path Rev (1→2 Lazy)

One input, two exits — and only one of them fires

By ashtar1984·Created 9 months ago·Updated 9 months ago· 0
Switch Path Rev (1→2 Lazy)
  • input
  • on_true
  • on_false
statetrue

SwitchPathRev is the mirror image of its sibling, SwitchPathLazy. Where that node takes two inputs and merges them into one output, this one is 1→2: one input, two outputs (on_true and on_false), and a boolean state decides which exit carries the value. The output you don't pick gets an ExecutionBlocker, so whatever hangs off it is skipped outright.

You'd reach for it when you have one result and two possible destinations. Save to disk vs. just preview. Send the image into a heavy post-processing chain or straight to the viewer. Conditionally kick off an expensive downstream step only when state is true. That last one is the trick that makes it worth having: the inactive side doesn't just get muted, it gets blocked, so nothing on it runs and nothing on it produces a file.

How it works

Same native lazy evaluation as the rest of the pack. check_lazy_status reports which output the graph actually needs - only "on_true" or only "on_false" - so ComfyUI plans the execution around exactly one branch. The other output carries an ExecutionBlocker that propagates to its consumers and skips them. A live readout under the node (state, active output, inactive output, "lazy skip") is pushed through ComfyUI's progress-text API so you can watch which exit fired.

Note the default: state defaults to true here, the opposite of SwitchPathLazy's false. Doesn't matter much, but it's easy to assume the two defaults match.

The inputs and outputs that matter

  • state - boolean, defaults to true. The router.
  • input - wildcard (*), so it accepts an image, latent, text, anything.
  • on_true / on_false - wildcard outputs. Exactly one carries the value; the other is the block signal.

Wire input from whatever produces the value, then hang your two destination chains off the outputs. A neat combo is a SwitchPathLazy at the front (pick a pipeline) feeding this at the back (fan the winner out to save + preview + compare) - the two halves of the pack slot together cleanly.

Installing it

Same pack as SwitchPathLazy - ComfyUI Manager, search ComfyUI-SwitchPathLazy, or:

cd ComfyUI/custom_nodes
git clone https://github.com/ashtar1984/ComfyUI-SwitchPathLazy.git

Restart and both nodes appear under flow control. No models, no dependencies, nothing to configure - the code only uses ComfyUI's own server and comfy_execution.graph_utils. It's a tiny MIT pack by a single dev (ashtar1984, one commit in late 2025), and like most of this ecosystem's quiet utilities it has no community presence to speak of. It exists because the author wanted it; it works.

Gotchas worth knowing

  • Only one output fires. If you wire both exits expecting both to get the value, that's not this node's job - that's a reroute or a fan-out, not a switch.
  • Blocking propagates silently. Toggle state and a whole section of the graph can go dark: a Save node on the inactive side just doesn't save. That's the feature, not a bug, but it reads like a bug the first time.
  • Wildcard types mean no static checking. A type mismatch between input and what your consumer expects shows up at runtime, not as a red socket.
Categoryflow control

Inputs (2)

NameTypeDefaultDescription
stateBOOLEANtrue
input*

Outputs (2)

NameTypeDescription
on_true*
on_false*