ComfyUI Node

Simple Counter

A bare number that goes up, when that's all you need

By trunksn1·Created 10 months ago·Updated 3 months ago· 1
Simple Counter
    • value
    start0
    step1

    The smallest node in the pack

    SimpleCounter does one thing: every time it runs, it outputs an integer that has increased by step since the last run. Two inputs (start, step), one output (value), no state to configure, no actions to pick. It's the stripped-down sibling of BatchIndexCounter - that one has increment/set/reset and named counters; this one is just a monotonically climbing number you can hang off anything that wants a per-step integer.

    It's part of this pack because checkpoint rotation runs on counters, but it's the most generic node here. You'll find yourself feeding its value into things that have nothing to do with models - an iteration tracker, a step counter for a scheduling node, a way to vary something per queue. It's a utility; that's its whole personality.

    How it works

    State is a single class-level _value, starting at your start value. On each execution it returns the current value, then adds step. If it ever climbs past 1,000,000 it wraps back to start, which is just a safety valve so the counter can't overflow into nonsense after a very long session.

    The two inputs:

    • start - where the count begins (default 0).
    • step - how much it climbs per execution (default 1).

    And one output, value (INT). That's the entire API.

    The gotcha to keep in mind

    Like BatchIndexCounter, this node has no IS_CHANGED, and its inputs never change - so ComfyUI's execution caching can kick in and it simply won't tick unless the graph around it forces a re-execution. In practice you drive it from a loop or from a graph that's genuinely re-running each iteration, which is the same requirement every counter in this pack has. If your counter is frozen at one number, that's usually ComfyUI doing its job caching, not a bug in the node.

    Also note the class-level state: two copies of SimpleCounter in one workflow share the same underlying value, because it's one variable on the class, not one per node. If you need two independent counts, the sibling BatchIndexCounter with separate counter_ids is the right tool - that's the reason both exist.

    Install

    It ships in the rotation pack, so installation is the same one-liner:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/trunksn1/comfyui-change-checkpoint-randomly
    

    Restart ComfyUI and confirm the green Checkpoint Rotation Node loaded successfully! message. No pip dependencies, no models, no extra config. You'll find it under Add Node → utils → Simple Counter, sitting right next to BatchIndexCounter. If a plain climbing integer is all you need, it's the simplest node you'll install all week.

    Categoryutils

    Inputs (2)

    NameTypeDefaultDescription
    startINT00–1000000Starting value
    stepINT11–1000Increment step

    Outputs (1)

    NameTypeDescription
    valueINT