Nodes/Jovimetrix/IF-THEN-ELSE (JOV) πŸ”€
ComfyUI Node

IF-THEN-ELSE (JOV) πŸ”€

The ternary operator as a node

By AmoranoΒ·Created 3 years agoΒ·Updated 12 months agoΒ· 397
IF-THEN-ELSE (JOV) πŸ”€
  • πŸ‡Ή
  • πŸ‡«
  • πŸ‘
◄⁉️falseβ–Ί

IF-THEN-ELSE (JOV) πŸ”€ is a plain-Jane conditional: it looks at a boolean, and routes one of two values through. True β†’ send the T value, False β†’ send the F value. It's the node equivalent of Python's a if cond else b, and it's what you reach for when a workflow has to make a decision - use the upscale branch or not, pass the original image or the corrected one, apply the LoRA or skip it. Output was a single πŸ‘ carrying whichever input won, any type.

Like several nodes on this pack's roster, this is the pre-2.0 version of the idea. In current Jovimetrix, the conditional logic lives on as COMPARISON (JOV) πŸ•΅πŸ½, which is strictly more capable: it compares two inputs with a real operator menu (equal, greater-than, less-than, AND/OR/XOR, IS, IN…), evaluates, and routes a SUCCESS value or a FAIL value to OUT - that's the same if-then-else shape, plus the ability to actually decide rather than just route a pre-made boolean. If a workflow references IF-THEN-ELSE (JOV) πŸ”€ and it's missing after a pack update, COMPARISON is where it went.

How it worked

Three inputs, no ceremony:

  • ⁉️ - the condition. True or false.
  • πŸ‡Ή - the value sent through when the condition is true.
  • πŸ‡« - the value sent through when it's false.

The output πŸ‘ was just whichever branch won. Because the inputs were untyped, you could switch between images, floats, strings, whatever - the node didn't care, it just passed the winning one along. That untyped flexibility was the whole appeal: one conditional that didn't need a separate node per data type.

Installing it

It ships in Jovimetrix:

# ComfyUI Manager: search "Jovimetrix" and install
cd ComfyUI/custom_nodes
git clone https://github.com/Amorano/Jovimetrix.git
cd Jovimetrix
pip install -r requirements.txt

Restart ComfyUI. If the node is gone after updating, that's the 2.0 rename - the README warns against updating past 1.7.48 if you depend on legacy nodes.

Troubleshooting

  • Node missing after update - expected; use COMPARISON (JOV) πŸ•΅πŸ½ with its SUCCESS/FAIL inputs. Same idea, more operators, still current.
  • Condition fires on the wrong branch - classic wiring slip: the output is whichever input won, so if you expected "false" but wired T and F backwards, the node is faithfully following your cable. Swap them.
  • You can't tell which branch ran - right, there's no indicator. In the modern COMPARISON node, the VAL output reports the comparison result, which makes debugging easier.

If you only need "route A or B based on a boolean," the idea survives fine in COMPARISON (JOV). Just think of SUCCESS/FAIL as then/else and you're home.

CategoryJOVIMETRIX πŸ”ΊπŸŸ©πŸ”΅/FLOW

Inputs (3)

NameTypeDefaultDescription
πŸ‡Ήopt*β€”
πŸ‡«opt*β€”
⁉️optBOOLEANfalseβ€”

Outputs (1)

NameTypeDescription
πŸ‘*β€”