Nodes/ComfyUI-XJNodes/Integer Increment
ComfyUI Node

Integer Increment

Add a number to an integer, with a wire instead of a widget

By alexjx·Created 10 months ago·Updated 4 months ago· 0
Integer Increment
    • INT
    input
    increment1

    Integer Increment does exactly one thing: takes an integer in, adds a value to it, and hands the result back. input in, input + increment out. There's no state, no memory, no side effects - it's a wire-able +=, which is the entire point. In a graph editor, the difference between "widget I edit by hand" and "value that flows from another node" matters constantly.

    The concrete scenario: you're running a batch of generations and you want each one's seed (or step count, or latent size) to be a computed value rather than a typed one. Wire a base integer into this node, bump it by 1, feed the result into your sampler's seed input, and you have an off-by-one chain you can reason about - all without touching the number widget by hand between runs.

    How it works

    Nothing hidden here. Both inputs arrive as plain INTs, the node returns the sum. Notably, increment is declared with forceInput: true in the source, which means the field is designed to be wired from another node rather than only typed - you can drive the step size from a loop counter, a random integer, or whatever else produces an INT upstream. It lives in the XJNodes/util category along with its siblings Integer Decrement and Int Offset.

    Inputs and outputs

    • input - the INT to start from
    • increment - INT, default 1, minimum 1. How much to add

    The output is a single INT. There's no clamp and no overflow guard, so if you feed it a 2^63 value and add, Python just promotes it - usually fine, occasionally surprising.

    Installing it

    Same story as every node in the XJNodes pack. ComfyUI Manager → search "ComfyUI-XJNodes" → install → restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexjx/ComfyUI-XJNodes
    # restart ComfyUI
    

    Zero dependencies beyond ComfyUI's own Python. It appears under XJNodes/util.

    Honest assessment

    This is the kind of node you glance at and think "I could just type a number." True. But once you're chaining values through a workflow - a seed offset scheme, an index counter inside a loop, a size ladder that climbs a base resolution - having the arithmetic as a node you can rewire beats re-typing, and it keeps your workflow's math visible and diffable. It's not glamorous; it's plumbing. If you need to subtract instead, grab Integer Decrement from the same pack - the two are mirror images, and they're both simpler than the general-purpose Int Offset when all you want is a fixed step.

    CategoryXJNodes/util

    Inputs (2)

    NameTypeDefaultDescription
    inputINT
    incrementINT1

    Outputs (1)

    NameTypeDescription
    INTINT