ComfyUI Node

Output Switch

Send a value down one path and genuinely block the other

By Stibo·Created 5 months ago·Updated 2 months ago· 9
Output Switch
  • input
  • on_true
  • on_false

An input switch picks which of two values comes through. Output Switch is the mirror image: it takes one value and routes it to one of two outputs - and the output you don't pick is blocked, so everything hanging off that side simply doesn't run. It's the "send this down the right path and make sure the wrong path stays dead" node.

What it is

  • input - the value to route.
  • Outputs: on_true and on_false.

A boolean decides which output is active. Flip it to True and input flows out of on_true; flip it to False and it goes to on_false. The unselected output is blocked with an execution blocker, which means ComfyUI skips the downstream nodes on that branch entirely - not just ignores the value, actually refuses to run them.

Why the blocking matters

That's the whole point of an output switch versus a plain value switch. With a value switch you still pay for whatever you connected, even if you never use it. Here, the dead branch is dead: hang an expensive subgraph off on_false, and when the boolean is True, that subgraph costs you nothing.

The classic pattern: you have a conditional post-processing step. When enabled, route the image through the enhance/upscale branch; when disabled, route it straight to the save node. The blocked side means the enhancement never runs when it's off - no wasted VRAM, no wasted seconds, and no chance of an unwanted pass happening invisibly.

Where does the boolean come from? From the usual places: a Number Compare result, an Is None check, a boolean toggle, or any node that outputs a boolean. In a typical workflow the boolean is the wiring point - the Output Switch is where your conditional logic actually forks the graph.

Installing it

Part of the Nifty Nodes pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Stibo/comfyui-nifty-nodes

or search "Nifty Nodes" in ComfyUI Manager, then restart. No models or dependencies beyond the pack.

Gotchas

The blocked-output behavior is both the feature and the footgun. Connect a save node to the wrong output and your image silently never gets written - no error, just nothing. So trace which side is active for your boolean's value before you connect anything important. Also, because the unselected branch doesn't run, any node that produces a value you expected to exist "for later" will hand you None when its branch is blocked - that's by design, but it's a common source of confusion when people wire the same source into two paths expecting both to execute. And remember this pack targets the newer ComfyUI V3 API - update ComfyUI if the node doesn't appear after install.

Categorynifty/logic

Inputs (1)

NameTypeDefaultDescription
inputCOMFY_MATCHTYPE_V3Value to route to either on_true or on_false.

Outputs (2)

NameTypeDescription
on_trueCOMFY_MATCHTYPE_V3
on_falseCOMFY_MATCHTYPE_V3