Nodes/ComfyUiNodes/M Int Add (a + b)
ComfyUI Node

M Int Add (a + b)

The tiny node that makes your seed math explicit

By Madlumi·Created 8 months ago·Updated 8 months ago· 0
M Int Add (a + b)
    • a_plus_b
    a0
    b0

    The most common arithmetic in ComfyUI isn't fancy - it's "same seed plus one" for a variation, or "steps plus a bit" because you want to nudge something without retyping it. M Int Add is that operation as a node: a + b in, one integer out. It's the archetype for the whole family of math nodes in the ComfyUiNodes pack, and once you've used it you've understood all of them.

    It takes two INT inputs, a and b (both default to 0, both limited to signed 32-bit range), and returns a single output named a_plus_b. The implementation is one line - Python's a + b - which is exactly why it's worth having in a graph instead of doing it in your head: the moment you convert a KSampler's seed widget to an input and wire a_plus_b into it, "seed + 1 for the next variation" is a visible, reproducible part of the workflow rather than a number you retype and forget to increment.

    Where it actually earns its keep:

    • Seed variations. Wire a seed value into a and a constant into b, and every run steps the seed by a known amount - deterministic nudges instead of "randomize and hope."
    • Dimension offsets. Width plus a margin, steps plus a buffer, cfg plus a small tweak - the same value fanning out to several nodes from one place.
    • Dynamic math chains. Add is the primitive every other operation composes from, so when you're building a small calculation with the pack's other nodes, this is the connecting tissue.

    The inputs and outputs are exactly the two numbers and the sum - nothing hidden, no modes. Both sockets accept either typed values or wires from other nodes, and ComfyUI's "convert widget to input" gesture applies like anywhere else.

    It ships in the ComfyUiNodes pack (repo Madlumi/ComfyUiNodes, author "Madanie"), a small grab-bag that bundles 18 integer math nodes, two string helpers, and the two 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, no model downloads, nothing heavy - this pack is pure Python over ComfyUI's own deps. The node lives under Add Node → mnodes → int.

    The only thing to watch: every INT socket here is clamped to 32-bit signed range, which is roomy for anything you'll do with seeds and steps. And since this is a small personal pack, expect the odd quirk rather than polish. For the price of one clone, having add/subtract/multiply as first-class graph nodes beats doing seed math on a scratch pad every single time.

    Categorymnodes/int

    Inputs (2)

    NameTypeDefaultDescription
    aINT0-2147483648–2147483647
    bINT0-2147483648–2147483647

    Outputs (1)

    NameTypeDescription
    a_plus_bINT