ComfyUI Node

Abs Int

The one-line math node that saves you a converter

By denyazzolin·Created 3 months ago·Updated 9 days ago· 3
Abs Int
    • abs_value
    value0

    Abs Int is exactly what it sounds like: feed it an integer, get its absolute value back. No config, no options, no surprises. It's the kind of node you look at and wonder why it exists - and then, three weeks later, you're the one searching for it because some node upstream just handed you a negative seed.

    It comes from comfyui-daz-tools, a small utility pack by deny azzolin, and it does one thing: abs(value).

    The inputs that matter

    There's exactly one. value (INT, default 0, range -2,147,483,648 to 2,147,483,647). The output is abs_value (INT). That's the whole node.

    Where it actually earns its keep

    Honest answer: it's a convenience node, not a power tool. The realistic use cases:

    • Seed and counter math. Random seeds, offsets from loops, and subtraction-heavy arithmetic can throw negatives into a downstream node that expects a positive int. One AbsInt converts and you stop getting "invalid seed" errors.
    • Mirroring and symmetry. Negative coordinates or offsets (frame indices, batch positions) that you want to fold to positive before feeding an image or mask node.
    • Anchoring a math chain. In a graph full of IntMath-style nodes, a dedicated absolute-value step is more readable than burying abs() in a big expression node - it's self-documenting, which is worth something when you come back to a workflow six months later.

    The alternative is wrapping the math in a generic expression node or adding a switch, and for the "I just need the positive version of this int" case that's overkill. This is the overkill-free version.

    Installing it

    It ships in the pack, so it comes along with the whole family:

    cd ComfyUI/custom_nodes
    git clone https://github.com/denyazzolin/comfyui-daz-tools
    

    Restart ComfyUI. It's also in ComfyUI Manager under comfyui-daz-tools. No dependencies - it's a few lines of pure Python.

    Any gotchas?

    None worth losing sleep over. The input is INT-typed, so you'll need a FLOAT-to-INT conversion node if you're coming from float math, and the same if you need the result back as a float. That's the whole list. This is a tiny node doing a tiny job, and it does it without drama - which, in a 40-node workflow full of things that are drama, is quietly the point.

    Categorymath

    Inputs (1)

    NameTypeDefaultDescription
    valueINT0-2147483648–2147483647

    Outputs (1)

    NameTypeDescription
    abs_valueINT