Nodes/Basic data handling/if/elif/.../else
ComfyUI Node

if/elif/.../else

Implements a conditional branch (if/elif/else) in the workflow. This node takes a condition input and two value inputs. If the condition evaluates to True, the first value is returned; otherwise, the elif (else if) is evaluated and returned when true. This continues for all additional elifs. When none is true, the value of the else is returned. This allows conditional data flow in ComfyUI workflows.

By StableLlama·Created about a year ago·Updated 26 days ago· 45
if/elif/.../else
  • then
  • then_0
  • else
  • result
if
elif_0
CategoryBasic/flow control

Inputs (5)

NameTypeDefaultDescription
ifBOOLEAN
then*
elif_0optBOOLEAN
then_0opt*
elseopt*

Outputs (1)

NameTypeDescription
result*