ComfyUI Node Runs on cloud

If

The 'If' node this pack advertises is the one that doesn't ship

By theUpsider·Created 3 years ago·Updated about a year ago· 234
If
  • ANY
  • IF_TRUE
  • IF_FALSE
  • ?

"If" is the most-searched node in the ComfyUI-Logic pack - 94 Google impressions put it ahead of everything else here - so let's start with the uncomfortable truth: it doesn't actually ship. Open the current version's nodes.py and you'll find the class IfExecuteNode sitting inside NODE_CLASS_MAPPINGS behind comment marks, in the mapping that registers nodes and in the one that names them. Install the pack fresh, restart ComfyUI, and there is no "If" in your node menu. You aren't going mad.

The README still advertises it under "conditional rendering," which is how people end up hunting for it. And the schema on this very page lists ANY, IF_TRUE and IF_FALSE - that's a stale record copied from the pack's other, working If node ("If ANY return A else B-🔬"). The real code is different, and the difference tells you why it got disabled.

What it was supposed to do

IfExecuteNode is the "execute" variant, not the "return" variant. Instead of passing a value through, it presents two dropdowns - NODE_TRUE and NODE_FALSE - populated with every registered node class in your whole ComfyUI install. When ANY is truthy it instantiates whichever node you picked in NODE_TRUE and calls its execute() method with no arguments; otherwise it does the same for NODE_FALSE.

That's the mechanism, and it's also the design flaw. ComfyUI nodes don't run on no inputs: instantiate a KSampler and call execute() with nothing and you get a TypeError, not an image. This node could only ever have "executed" a handful of self-contained classes, and the author clearly realised it - it's been sitting commented out since before the 1.2.0 release. No update since, either: the repo header says, in the author's own words, "currently not maintained."

The bigger misconception

People search for this node because they want ComfyUI to not run a branch when a condition is false. That's not how the graph works, in this pack or any other. ComfyUI executes every node that's connected, top to bottom, with no lazy "if" that skips a path - an If node just picks which value flows onward. Both branches still run and still burn VRAM; you're choosing a result, not a path. If you genuinely want to skip work, you want the mute/bypass dashboard in rgthree-comfy or a manual bypass, not a logic node.

What to actually use

For picking a value between two branches, the sibling that does ship is If ANY return A else B-🔬. ComfyUI core also ships its own Logic/If and Logic/Any nodes these days, which is honestly where I'd point a beginner - you may not need a logic pack at all.

Install the pack either way with Manager (search "ComfyUI-Logic") or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/theUpsider/ComfyUI-Logic

Then restart ComfyUI. No pip dependencies, no model downloads - it's pure Python and installs clean, which is the nicest thing about it. Just don't go looking for this node after you do.

CategoryLogic

Inputs (3)

NameTypeDefaultDescription
ANY*
IF_TRUE*
IF_FALSE*

Outputs (1)

NameTypeDescription
?*