ComfyUI Node

QuickMode If

Pick a branch without paying for the one you didn't run

By yanadere0549·Created 2 months ago·Updated 2 months ago· 0
QuickMode If
  • on_true
  • on_false
  • output
conditionfalse

The lazy if for ComfyUI

QuickMode If is the muscle behind the draft/production idea in ComfyUI-QuickMode. Where QuickMode Condition is the switch, this is the branch: it takes a boolean condition, and if it's true you get on_true back, otherwise on_false. Boring on the surface - but two details make it genuinely worth knowing.

It's lazy. Both data inputs are declared lazy in the node definition, and the node's check_lazy_status method tells ComfyUI exactly which input the current condition needs. The branch you didn't pick is never scheduled, never evaluated, never computed. That's the whole point: in a production/draft setup the losing side is dead weight - a whole extra latent, sampler, or model path that would otherwise burn VRAM and seconds on every run. With this node it just doesn't happen.

It's any-type (*). The inputs and the output are all typed *, so they accept anything - a latent, a conditioning, an INT, a model, a string. Same wildcard mechanism the node-plumbing essay in the KB describes for A/B switches: the node doesn't care what it's routing, it just passes the winner through.

The inputs that matter:

  • condition - BOOLEAN with forceInput: it's a socket, not a widget. You must wire it, and the natural source is the production output of a QuickMode Condition.
  • on_true / on_false - any type, lazy, optional. You can leave one unconnected.

Output: output (any type).

Wiring it up

Typical use: two EmptyLatentImages - a small one for draft on on_false, a big one for production on on_true - with the output feeding the KSampler's latent_image. Want steps to switch too? Right-click the KSampler's steps widget, pick Convert widget to input, feed two Primitive values into a second QuickMode If, and wire the same condition into both. Fan-out is fine: one Condition can drive as many Ifs as you like.

Install & gotchas

Install with the pack - no dependencies, no models:

cd ComfyUI/custom_nodes
git clone https://github.com/yanadere0549/ComfyUI-QuickMode

then restart (or ComfyUI Manager → "ComfyUI-QuickMode").

  • Unconnected is fine on the losing side, fatal on the winning side. If condition is true and on_true isn't connected, you get a hard error naming the branch: "QuickModeIf: 'on_true' input is not connected". The lazy machinery skips the losing side, but it can't conjure the winning side out of nothing.
  • * sockets won't save you from yourself. Because the type checker can't see what's flowing, you can happily wire an IMAGE into one branch and a STRING into the other - it'll route fine, and downstream will explode confusingly. Connect matching types on both sides. This is the same legibility tradeoff behind the "Please Stop using the Anything Anywhere extension" backlash the KB's ecosystem essay records: convenience at the cost of a type checker that has your back.

That's it. If you were hand-bypassing a branch every time you wanted a quick render, this node replaces the whole dance with one wire and one boolean.

CategoryQuickMode

Inputs (3)

NameTypeDefaultDescription
conditionBOOLEANfalse
on_trueopt*
on_falseopt*

Outputs (1)

NameTypeDescription
output*