Nodes/ComfyUI-AutoFlow/Condition Checker
ComfyUI Node

Condition Checker

The little comparator that gives your graph an if/else

By ZXL-Xinram·Created about a year ago·Updated 9 months ago· 4
Condition Checker
    • result
    data_typeString
    conditionequals
    string1
    string2
    int10
    int20
    float10.00
    float20.00

    Every workflow eventually needs a decision: is this CFG above 7, does the filename contain "v2", is the denoise strength high enough to bother with an upscale pass? ComfyUI gives you no native comparison node worth using, so you end up hand-rolling boolean logic or reaching for a big switch pack. Condition Checker is the small, typed comparator that turns a comparison into a single BOOLEAN output you can feed straight into Condition Assignment (same pack) or any boolean-driven node.

    It's nothing exotic - which is the point. You pick a data type, pick a condition, plug in two values, get one true/false.

    How it works

    The node is organized around a data_type switch (String, Int, or Float). You select the type and it evaluates the pair of inputs for that type using the selected condition. The comparison happens at graph-execution time, and the node's IS_CHANGED method makes sure the output updates whenever any of its inputs change - so you don't have to force a re-run after tweaking a value.

    Inputs that matter

    • data_type - String, Int, or Float. This determines which input pair is actually compared. Switching it re-reads the other inputs.
    • condition - equals, contains, not_equals, greater_than, or greater_or_equal. Pick honestly: for String, only equals, contains, and not_equals do anything meaningful. For Int/Float, greater_than and greater_or_equal join the party, and contains isn't supported.
    • string1 / string2, int1 / int2, float1 / float2 - the value pairs. Note the quirk in contains: an empty string2 inside a non-empty string1 returns false (it's a real substring check, and empty string isn't a "hit"). If both are empty, it returns true.

    Output: result, a BOOLEAN. That's it - one wire.

    Install

    Same as every node in this pack - ComfyUI Manager (search "ComfyUI-AutoFlow") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow
    

    Restart after cloning. No models, no new Python packages; it only uses stdlib plus ComfyUI's own type definitions.

    Where people get burned

    • Selecting a condition the type can't do. greater_than on a String doesn't error - it just returns false and prints a warning to the console. Easy to miss if you're not watching the terminal.
    • It's a comparator, not a gate. The output is a value; it doesn't pause or skip execution. To actually branch on the result, wire it into Condition Assignment or a switch, and remember both sides of a branch still execute in this pack (see that node's notes).
    • No less-than. The condition list covers equals, not-equals, contains, greater-than, greater-or-equal. If you need less_than, swap the operands and use greater_than.

    For a beginner the honest take: this node is a convenience, not a necessity - the same logic is three nodes deep in most big utility packs. But if you're already installing AutoFlow for its path and string helpers, the Condition Checker + Condition Assignment pair gives you a tiny, readable branch primitive without pulling in another dependency. That's worth something.

    CategoryAutoFlow/Utilities

    Inputs (8)

    NameTypeDefaultDescription
    data_typeCOMBOString3 options: String, Int, Float
    conditionCOMBOequals5 options: equals, contains, not_equals, greater_than, greater_or_equal
    string1optSTRING
    string2optSTRING
    int1optINT0-999999–999999
    int2optINT0-999999–999999
    float1optFLOAT0.00-999999–999999
    float2optFLOAT0.00-999999–999999

    Outputs (1)

    NameTypeDescription
    resultBOOLEAN