if/elif/.../else

Basic data handling: IfElifElse

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.

Pack: Basic data handling

custom_nodes.ComfyUI-basic_data_handling

Inputs (5)

NameTypeRequired
ifBOOLEANrequired
then*required
elif_0BOOLEANoptional
then_0*optional
else*optional

Outputs (1)

NameType
result*