Nodes/ComfyUI-Basic-Math/Integer Comparison | Basic
ComfyUI Node

Integer Comparison | Basic

Clean integer comparisons for seeds, steps, and sizes

By akatz-ai·Created about a year ago·Updated 11 months ago· 16
Integer Comparison | Basic
    • BOOLEAN
    a0
    b0
    operation

    IntegerComparison ("Integer Comparison | Basic") compares two whole numbers and returns true or false. That's the entire job, and it's a job every workflow needs eventually: "is this seed above 100000?", "are we under 20 steps?", "did the image land on exactly 1024 wide?"

    You feed it a and b, both INT widgets with the full 64-bit signed range and step 1, pick an operation from the six (==, !=, <, >, <=, >=), and get a BOOLEAN out. No tolerance input, no type juggling - integers compare exactly, which is one of the few places in computing where equality is reliable.

    The inputs that matter

    • a, b - the two integers.
    • operation - pick the comparison.

    Why you'd reach for it

    This is the boring, dependable member of the comparison family, and boring is good here. Because integer equality actually works, you can safely use == against a hard-coded value - comparing a batch count to 4, or a seed to a specific number - without the floating-point paranoia that makes FloatComparison's tolerance knob necessary.

    There's a judgment call to make across this pack: NumberComparison accepts INT or FLOAT and returns the same six operators; IntegerComparison is the strictly-typed version. If your values are already integers - and in ComfyUI, a lot of the interesting comparisons are (steps, seeds, dimensions, batch sizes) - the strictly-typed version is the one to reach for. It keeps ints as ints and refuses float wires, which is a feature when you want the graph to catch a type mistake early. The result feeds the same switches and logic nodes either way.

    Installing it

    Standard install for this pack, which is pure Python with zero dependencies:

    cd ComfyUI/custom_nodes
    git clone https://github.com/akatz-ai/ComfyUI-Basic-Math
    

    Restart ComfyUI and look under Basic Math ➕ → Boolean for "Integer Comparison | Basic". Or use ComfyUI Manager → Install Custom Nodes → search "ComfyUI-Basic-Math".

    The gotchas

    Two things to keep straight. First, the | Basic suffix on the menu name - this pack tags every node so it doesn't collide with lookalikes from other packs. Second, don't expect it to accept a float: this node is INT-only by design, so if your value might be fractional, use NumberComparison instead. And if you find yourself chaining several of these together, remember BooleanLogic (also in this pack) gives you AND/OR to combine the results into one decision.

    CategoryBasic Math ➕/Boolean

    Inputs (3)

    NameTypeDefaultDescription
    aINT0-18446744073709550000–18446744073709550000
    bINT0-18446744073709550000–18446744073709550000
    operationCOMBO6 options: ==, !=, <, >, <=, >=

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN