ComfyUI Node

M Int Abs

Distance as a number, signedness gone

By Madlumi·Created 8 months ago·Updated 8 months ago· 0
M Int Abs
    • abs
    x0

    Sometimes you don't care whether a value is over or under - you care how far off it is. M Int Abs takes one integer x and returns its absolute value, abs, as a plain INT. The sign is stripped; the magnitude survives.

    It's one of the pack's unary nodes - one input instead of two - and the uses all circle around "distance, not direction":

    • Error and delta math. The difference between two values, made unsigned. If you have a target and a current value, abs(current - target) is "how far off am I" regardless of which direction you missed. That's a clean gate condition for "close enough yet?"
    • Magnitude checks. A strength or offset that can legitimately be negative but must never exceed a magnitude - abs first, compare second, and the comparison is meaningful in both directions.
    • Normalizing before logic. Turning a signed value into a non-negative one so downstream math (like the pack's min/max or comparisons) behaves predictably.

    Mechanically it's Python's abs(x). Input range is signed 32-bit INT, default 0, and the classic edge case is worth knowing: abs of the minimum 32-bit value would be outside the range, but with real workflow numbers you'll never approach that.

    It ships in ComfyUiNodes (repo Madlumi/ComfyUiNodes, author "Madanie"), a small personal pack of integer math, string helpers, and workflow-glue nodes. Install via ComfyUI Manager - search "ComfyUiNodes" - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Madlumi/ComfyUiNodes
    

    Restart ComfyUI afterward. No pip requirements or model downloads. It's under Add Node → mnodes → int.

    Honest verdict: abs is a "when you need it, you really need it" node. If your workflows compute differences and then compare them, this is the missing piece between the subtraction and the branch.

    Categorymnodes/int

    Inputs (1)

    NameTypeDefaultDescription
    xINT0-2147483648–2147483647

    Outputs (1)

    NameTypeDescription
    absINT