EasyUse/Logicgenerated

If else(IfElse)

The If else node is a logic branching node from the ComfyUI-Easy-Use package.

If Else

on_true
on_false
*
boolean
Easy Use

Description

The If else node is a logic branching node from the ComfyUI-Easy-Use package. It evaluates a Boolean condition and returns one of two arbitrary input values: on_true when the condition is True, or on_false when the condition is False. The node is located under EasyUse/Logic.

Inputs

  • boolean (BOOLEAN, required):
    The condition to evaluate. When True, the on_true value is passed through; when False, the on_false value is passed through.

  • on_true (ANYTYPE, required):
    The value returned when boolean is True. Because this input accepts ANYTYPE, it can be connected to almost any ComfyUI data type, including numbers, strings, images, latents, models, or custom structures.

  • on_false (ANYTYPE, required):
    The value returned when boolean is False. Like on_true, this input accepts any data type.

Outputs

  • ANYTYPE:
    The selected input value. The output will be on_true if boolean is True, otherwise it will be on_false.

Usage Notes

  • This node does not short-circuit. In ComfyUI, both upstream branches connected to on_true and on_false will be executed before the condition is evaluated, because inputs are resolved before the node runs. Keep this in mind if one branch is expensive or potentially invalid.

  • The input and output types are ANYTYPE, so both branches do not need to have the same type. The output type will simply follow whichever branch is selected. However, downstream nodes that expect a specific type may require consistent branch types depending on the workflow.

  • This node is useful for simple conditional routing in a workflow, such as selecting between two alternative parameters, models, or image-processing paths based on a Boolean flag.

Comments

Sign in with GitHub to join the discussion.

Loading comments…