ComfyUI Node

M Int Neg

M Int Neg for offset seeds and inverted values

By Madlumi·Created 8 months ago·Updated 8 months ago· 0
M Int Neg
    • neg
    x0

    Negation is the arithmetic equivalent of "turn it around." M Int Neg takes one integer x and returns neg, its negative. Five characters of Python - -x - and yet it keeps appearing in real graphs because flipping a sign is a recurring move, not a one-off.

    Three ways it shows up:

    • Direction reversal in offsets. If your workflow computes "step + margin," the negation of that same value is "step − margin," derived from one source instead of retyped. A single neg node after your arithmetic gives you both directions of an offset with zero drift.
    • Inverting a delta. A value meant as "increase by this much" becomes "decrease by this much" with one node, which is handy when a parameter's semantics are backwards relative to your intent.
    • Seed variation mirroring. Negative seeds behave differently from positive ones in most samplers, so negating a seed is a cheap way to get a distinctly different variation from the same absolute number.

    Input is signed 32-bit INT, default 0, output is the negated value as a plain INT. It's one of the pack's unary trio alongside M Int Abs and M Int Sign - the three single-input nodes that round out the arithmetic toolkit.

    It ships in ComfyUiNodes (repo Madlumi/ComfyUiNodes, author "Madanie"), a small personal grab-bag 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
    

    Then restart ComfyUI. No pip requirements or model downloads. Find it under Add Node → mnodes → int.

    Honestly, negation is the node you'll use as a stepping stone more than a destination - but when you need "the same number, other direction," it's the one-line answer that keeps your graph honest instead of hand-typed and half-forgotten.

    Categorymnodes/int

    Inputs (1)

    NameTypeDefaultDescription
    xINT0-2147483648–2147483647

    Outputs (1)

    NameTypeDescription
    negINT