Nodes/ComfyUI-N-Nodes/Integer Variable
ComfyUI Node Runs on cloud

Integer Variable

A plain number you can plug into two places at once

By Nuked88·Created 3 years ago·Updated 2 years ago· 237
Integer Variable
    • INT
    value0

    This node does one thing, and the README is refreshingly honest about why it exists: ComfyUI's built-in Primitive node has a real limitation where you can't link certain matched widget pairs together - the README's own example is that you can't wire a KSampler's start_at_step to another KSampler's steps the way you'd want to. Integer Variable is Nuked88's workaround: a plain integer value with an output pin, so instead of two disconnected widgets that have to be kept in sync by hand, you set the number once here and wire that single output to both places that need it.

    How it works

    There's no processing happening here - it's a single-widget node that holds one number and exposes it as an INT output. That's the entire mechanism, and it's deliberately dumb: the value only changes when you change it, so anywhere you wire this output, you're guaranteed both consumers are using the exact same number, all the time, without you having to remember to update two fields whenever you tweak one.

    The input and output

    value is the only input - a plain integer, defaulting to 0. INT is the only output. That's it. If you're used to rgthree-comfy's fancier graph-plumbing tools (Context, Power Puter, Reroute), this is a much smaller idea in the same family: instead of solving the general problem of linking arbitrary widgets, it solves one specific case - a number two or more nodes need to agree on - with the smallest possible node.

    Installing the pack

    • ComfyUI Manager - search "ComfyUI-N-Nodes," install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Nuked88/ComfyUI-N-Nodes.git, then restart ComfyUI.

    No models, no extra dependencies - this is about as lightweight as a custom node gets, and it doesn't touch anything the video or GPT sides of the pack need.

    Common issues & troubleshooting

    "Why not just use ComfyUI's own Primitive node?" Try it first on the specific pair of widgets you're trying to link - if ComfyUI lets you connect them directly, you don't need this node at all. It only earns its keep in the specific cases the Primitive node can't reach, which is exactly the KSampler-to-KSampler example the README calls out. Once you hit one of those, an Integer Variable node is the simplest fix available.

    You changed the value and something downstream didn't seem to update. Double check you actually wired the output to both places you meant to sync - it's a common slip to update the widget on this node and then realize one of the two consumers was still connected to its own local widget instead of this node's output. The whole benefit only holds if every consumer that needs the same number is actually pulling from this one node.

    You need a float or a string instead. Same pack ships Float Variable and String Variable - identical idea, different type. There's no single "Any Variable" node here; each type gets its own small node.

    CategoryN-Suite/Variables

    Inputs (1)

    NameTypeDefaultDescription
    valueINT0

    Outputs (1)

    NameTypeDescription
    INTINT