ComfyUI Node Runs on cloud

Incrementer

A simple auto-incrementing counter node

By BadCafeCode·Created 3 years ago·Updated 2 years ago· 479
Incrementer
    • INT
    seed0
    max_value1

    Incrementer (the node's class name is MasqueradeIncrementer, but it shows up in the menu as just "Incrementer") is a small counter that holds a value and steps it up by one each time you tell it to. It's the same underlying mechanic as the "control after generate" behavior you already know from a KSampler's seed widget, pulled out into its own standalone node so you can drive anything with an auto-incrementing number, not just a sampler's seed - a filename suffix, an index into a list of prompts, a batch counter, whatever needs a number that steadily counts up across queue runs.

    Like any INT widget in ComfyUI, this node's seed value carries the standard right-click "control after generate" option (fixed, increment, decrement, randomize). Set it to Increment and the value goes up by one on every run instead of staying fixed - that's what actually makes this a counter rather than a static number. Leave it on "fixed" and it behaves exactly like typing a constant into any other INT input.

    The inputs that matter

    • seed (INT, default 0, min −1) - the counter's current value. This is both the starting point and, once increment mode is on, the thing that changes run to run.
    • max_value (INT, default 1, min 1) - the modulus. Once the counter would exceed this, it wraps back around rather than growing without bound - set it to however many items you're cycling through (say, 10 if you're rotating between ten saved prompts) so the count loops instead of running off the end of whatever list you're indexing into.

    The single output is an INT - the current counter value, ready to wire into a filename prefix node, a Prompt Selector-style index, or anywhere else that takes a plain integer.

    Installing it

    Incrementer is part of Masquerade Nodes. Install via ComfyUI Manager (search "Masquerade Nodes") or manually: cd ComfyUI/custom_nodes && git clone https://github.com/BadCafeCode/masquerade-nodes-comfyui, then restart ComfyUI. No models, no extra Python packages - it's a stateful counter, nothing more.

    Common issues

    The most common confusion is expecting the number to change without setting "control after generate" to Increment first - left on "fixed" (or whatever the default widget mode is), the value just stays put run after run, which looks like the node is broken when it's actually working exactly as configured. The other one is forgetting max_value exists: if you're using this to index into a fixed-length list downstream and don't set max_value to match that list's length, the counter will happily keep climbing past the end of your list and whatever's consuming the index will either error or silently wrap in a way you didn't intend. Set max_value to the actual size of whatever you're cycling through, not left at its default of 1.

    CategoryMasquerade Nodes

    Inputs (2)

    NameTypeDefaultDescription
    seedINT0-1–18446744073709550000
    max_valueINT11–18446744073709550000

    Outputs (1)

    NameTypeDescription
    INTINT