ComfyUI Node

Integer Compare

A true/false gate for your workflow, with a readable receipt

By turnbros·Created 11 months ago·Updated 10 months ago· 0
Integer Compare
    • result
    • expression
    comparisonequal
    a0
    b0

    Integer Compare is the "is A bigger than B?" node, and it's the closest thing this pack has to a conditional gate. You pick a comparison, feed it two integers, and it returns a BOOLEAN result you can use to switch behavior downstream - plus an expression string (5 > 3 = True) so you can see the reasoning in a text display.

    ComfyUI has no built-in if statement, which is why compare nodes exist. The pattern goes: compute some integer (a batch size, a frame count, a seed), compare it to a threshold, and let the boolean wire into whatever respects it - a bypass, a switch, a conditional router from another pack. The pack itself doesn't ship a node that consumes booleans to branch, so think of this as the decision half; you pair it with whatever branching mechanism you already use. Where it genuinely shines is sanity-guarding: "only run the upscale if the batch is under 32 frames" is a real workflow question, and this makes it a wire.

    Inputs and outputs

    comparison is a dropdown with six options: equal, not_equal, greater_than, less_than, greater_equal, less_equal. a and b are INTs, both wireable, so you can compare a computed value against a constant. Outputs:

    • result - a BOOLEAN. The answer, ready to wire.
    • expression - a STRING like 10 <= 8 = False. The receipt, for when you're debugging why a gate didn't fire.

    Installing it

    ComfyBros installs like any custom node pack. ComfyUI Manager - search "ComfyBros" - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/turnbros/ComfyBros
    

    Then restart ComfyUI. The README's mention of requirements.txt is stale - the real deps live in pyproject.toml and Manager installs them. Integer Compare lives under ComfyBros/Math.

    Gotchas

    The obvious trap is the classic off-by-one with greater_than versus greater_equal - decide whether "exactly 8" should pass before you wire it. And because both operands are integers, a float comparison won't plug in directly; you'd need to round or use a float-comparing node. Beyond that, it's a two-integer decision box with a paper trail - about as reliable as this pack gets.

    CategoryComfyBros/Math

    Inputs (3)

    NameTypeDefaultDescription
    comparisonCOMBOequal6 options: equal, not_equal, greater_than, less_than, greater_equal, less_equal
    aINT0-2147483648–2147483647
    bINT0-2147483648–2147483647

    Outputs (2)

    NameTypeDescription
    resultBOOLEAN
    expressionSTRING