Nodes/comfyui-moonpack/Conditional Bypasser
ComfyUI Node

Conditional Bypasser

Gate work on real conditions

By moonwhaler·Created about a year ago·Updated 11 days ago· 16
Conditional Bypasser
  • value
  • output
enabledtrue
disabled_behaviorblock

Most bypass nodes are cosmetic. They flip a node's mode on the canvas, sure, but if you're manually clicking them, nothing in the graph is deciding anything. MoonPack's Conditional Bypasser is the other kind: a real server-side gate that takes an input, checks a boolean, and decides whether the downstream graph runs at all. You wire it up once and the workflow decides its own path.

That's the use case to keep in mind. This isn't for "let me quickly mute a node while testing." It's for graph-driven branching - when some upstream node computed a condition, and a whole expensive branch (an upscale, a second pass, a VAE decode) should only run if that condition is true.

How it works

Two inputs, one output. You feed any value into value - the input is typed *, so it accepts whatever you throw at it - and enabled is the switch. When enabled is true, the node passes value through unchanged to output. When it's false, the node returns a ExecutionBlocker instead. That's the mechanism that matters: an ExecutionBlocker doesn't just carry a null value; it tells the ComfyUI execution engine that everything downstream of it is skipped entirely. No wasted sampling, no wasted VRAM, no half-baked intermediate results floating around.

The node is honest about the type-checking: value accepts any type, and the output is typed * too, so the downstream connections just work whether you're passing an image, a conditioning, or a model. If you're on a very old ComfyUI build that lacks ExecutionBlocker, the code falls back to returning None - but you should be on a current build anyway.

Where you'd actually use it

The classic pattern is a condition node (or a custom node that outputs a boolean) feeding enabled, with the expensive branch behind it:

  • Upscale only when the image is below a resolution threshold.
  • Run a face-fix pass only when a detection node found a face.
  • Guard an optional LoRA branch behind a toggle that lives somewhere else in the graph.

One caveat: because it blocks execution rather than just skipping, it's stricter than a cosmetic bypass. If anything downstream of the blocker truly needs to run for the rest of the workflow to make sense, don't gate it this way - or you'll get a silently truncated graph. Think of it as a circuit breaker, not a light switch.

Installing it

It ships with MoonPack, so the install is the pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/moonwhaler/comfyui-moonpack.git

Or search MoonPack in ComfyUI Manager, then restart ComfyUI. Found under MoonPack/utils. No extra Python dependencies - the pack deliberately has none beyond what ComfyUI ships.

The verdict

If you're just toggling things by hand, use Fast Node Bypasser and save yourself the setup. The moment you want a workflow that decides to skip its own expensive branch, Conditional Bypasser is the cleaner tool - it's the difference between showing a branch and actually not running it.

CategoryMoonPack/utils

Inputs (3)

NameTypeDefaultDescription
value*Any input. Type-checked dynamically.
enabledBOOLEANtrueIf false, behavior is controlled by 'disabled_behavior'.
disabled_behaviorCOMBOblockWhen disabled: 'block' stops downstream nodes from running (ExecutionBlocker). 'pass_none' lets downstream nodes run but receive None instead of the input value.

Outputs (1)

NameTypeDescription
output*