Nodes/Nifty Nodes for ComfyUI/Input Switch (Eager)
ComfyUI Node

Input Switch (Eager)

The Input Switch that runs both branches

By Stibo·Created 5 months ago·Updated 2 months ago· 9
Input Switch (Eager)
  • on_true
  • on_false
  • output
boolean

The regular Nifty Input Switch is lazy - it only executes the branch you pick, which is what you want 95% of the time. Nifty Input Switch (Eager) is the other 5%: identical job, except both on_true and on_false are always evaluated, no matter which one the boolean selects.

Same inputs: boolean, on_true, on_false, all matching any type, with a single output that carries the chosen value through. The only difference is evaluation semantics, and the author shipped both on purpose.

When does eager make sense?

Lazy evaluation is great right up until the unselected branch needs to do something. Three cases where eager is the correct call:

  • Side effects. The branch you're not routing to still saves a file, writes metadata, or embeds a bundle into a PNG. Lazy would silently skip it.
  • You want both to run anyway. Say on_false warms a cache or pre-encodes a reference image you'll need a few steps later.
  • Validation over speed. The other branch is cheap but you want it error-checked on every run, even when unused.

The honest flip side: eager is how you burn VRAM. If your two branches are both full sampling paths, this node will happily run both and double your memory use. Reach for it deliberately, not by habit.

If you're not sure which you need, you want the lazy one. Go read the Nifty Input Switch article for the fuller if/else walkthrough - this page is just the "both branches run" variant.

Install

Same pack, same steps: ComfyUI Manager → search "Nifty Nodes", or:

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

Then restart. It's a v3-API pack, so keep ComfyUI updated. This is the node you grab when a lazy switch quietly skips work you needed done - a niche, but when you're in it, nothing else will do.

Categorynifty/logic

Inputs (3)

NameTypeDefaultDescription
booleanBOOLEANDetermines which input is passed to the output.
on_trueoptCOMFY_MATCHTYPE_V3Value passed through when boolean is True. Both branches are evaluated regardless of the boolean value.
on_falseoptCOMFY_MATCHTYPE_V3Value passed through when boolean is False. Both branches are evaluated regardless of the boolean value.

Outputs (1)

NameTypeDescription
outputCOMFY_MATCHTYPE_V3