Nodes/comfy-ovum/If Else Ovum
ComfyUI Node

If Else Ovum

The branch node that only evaluates the side you need

By sfinktah·Created about a year ago·Updated 10 months ago· 7
If Else Ovum
  • on_true
  • on_false
  • *
boolean

Every logic toolkit needs a fork in the road, and If Else Ovum is comfy-ovum's: feed it a BOOLEAN and two candidate values, and it passes through whichever branch the boolean picks. True → on_true, false → on_false, one output. It's the if/else of the graph, and it's the node you reach for whenever a workflow has to make a decision.

It lives in the ovum/loop category, sitting alongside the compare nodes, the integer math, and the list utilities that make up the pack's small logic brain. The typical chain: CompareOvum produces a boolean → IfElseOvum picks a value → that value drives something downstream (a prompt, a sampler setting, a branch of processing).

The thing that makes it good: lazy inputs

This is where IfElseOvum beats the naive version. Its on_true and on_false inputs are lazy - ComfyUI only evaluates the branch that's actually chosen. That's a real difference, not marketing. If on_true comes from an expensive or even failing upstream computation, and the boolean is False, that branch never runs. You can hang an expensive sampler off on_true and a cheap fallback off on_false, and the wrong side simply costs nothing. The node even tells ComfyUI which input to fetch via its lazy-status check, so the skipped branch doesn't get pulled into the graph's execution.

Inputs and output

  • boolean (BOOLEAN) - the decision. Wire it from a compare node, a setting, a BOOLEAN widget, anywhere.
  • on_true (*) - value returned when boolean is true. Lazy.
  • on_false (*) - value returned when false. Lazy.
  • Output: a single * socket carrying the chosen value.

Both branches are typed *, so the two sides don't need to be the same type - a string on one side and an image on the other will technically pass through, though you'd only want to do that if the downstream node genuinely accepts either.

What to pair it with

The pack has the rest of the logic skeleton: CompareOvum for ==, !=, <, <=, >, >=; mathIntOperation for arithmetic; GetListLength for sizing checks; and the loop nodes for the fancier stuff. IfElseOvum is where those booleans land and become actual values.

Installing it

Part of sfinktah/comfy-ovum:

cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum

or search comfy-ovum in ComfyUI Manager, then restart. No models.

Gotchas

The lazy evaluation cuts both ways: because the unchosen branch is skipped, you can't rely on it having side effects (file writes, env sets) happening on every run - only the chosen branch runs. And don't expect the output type to "know" what it is; the * socket is maximally permissive, so you'll see the value in the UI but the type system won't police it for you. Otherwise it's the cleanest branch node in the pack - and the lazy inputs alone are worth switching to it for.

Categoryovum/loop

Inputs (3)

NameTypeDefaultDescription
booleanBOOLEAN
on_true*
on_false*

Outputs (1)

NameTypeDescription
**