Nodes/ComfyUI-JakeUpgrade/Int Binary Condition JK๐Ÿ‰
ComfyUI Node

Int Binary Condition JK๐Ÿ‰

Compare two integers, get a boolean you can branch on

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 146
Int Binary Condition JK๐Ÿ‰
    • BOOLEAN
    โ—„opโ–พโ–บ
    โ—„a0โ–บ
    โ—„b0โ–บ

    CM_IntBinaryCondition compares two integers, a and b, and returns a BOOLEAN based on the comparison in the op dropdown: Eq, Neq, Gt, Lt, Geq (greater-or-equal), Leq (less-or-equal). Six operators, two inputs, one yes/no answer - it's the "is it in range / is it time yet" node.

    Where it earns its keep

    ComfyUI graphs run on "if this number is past that number, change behavior," and this node is the clean way to express it:

    • Step windows. "Run the refine pass only while step <= 40" - compare the current step against a constant, feed the boolean into a switch.
    • Bounds checks. A computed value that must stay within a range: a >= 0 And a <= 64 using two conditions and a Bool AND gate.
    • Thresholds. A detector's confidence or count exceeding a cutoff before a branch fires.
    • Seed/state logic. "When this index equals that index, do the special path" - Eq is a one-node equality test.

    The Geq/Leq variants matter more than people expect: because integers are exact, Gt vs Geq is the difference between > n and โ‰ฅ n, and off-by-one bugs in loops are the classic way to get a workflow that runs but is subtly wrong.

    Installing it

    Part of ComfyUI-JakeUpgrade:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
    cd ComfyUI-JakeUpgrade
    # Windows standalone: install.bat
    # or: python_embeded\python.exe -s -m pip install -r requirements.txt
    pip install -r requirements.txt   # non-Windows
    

    Or ComfyUI Manager, search "JakeUpgrade", install, restart.

    Gotchas

    • Equality on computed integers is safe - unlike floats, exact integers compare exactly, so Eq isn't the footgun here that it is in the float condition node.
    • Gt vs Geq, Lt vs Leq - pick deliberately. Off-by-one boundaries are the most common bug; decide whether the boundary value itself should pass before wiring.
    • Chains with gates. Two comparisons + Bool Binary And is how you build "between X and Y" without a dedicated range node.
    • Manager's JakeUpgrade / IPAdapter_plus conflict warning is a false positive from the pack's replacement/ folder.
    • ComfyUI-MultiGPU causes CUDA errors with recent ComfyUI - disable it per the README.
    Category๐Ÿ‰ JK/โœ–๏ธ Math/๐ŸŽก Int

    Inputs (3)

    NameTypeDefaultDescription
    opCOMBOSelect comparison operation
    aINT0First integer input
    bINT0Second integer input

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEANโ€”