Nodes/ComfyUI Checkpoint Rotation Node/Checkpoint Rotation (Batch)
ComfyUI Node

Checkpoint Rotation (Batch)

The 'Batch' rotation node that secretly isn't per-batch

By trunksn1·Created 10 months ago·Updated 3 months ago· 1
Checkpoint Rotation (Batch)
    • model
    • clip
    • vae
    • info
    counter0
    subfolder
    change_every4
    reset_on_nextfalse

    The main event - and its one big lie

    This is the node the pack's author marks with a star: Checkpoint Rotation (Batch) is the recommended way in, and it's genuinely the smoothest of the loaders to set up. You wire a counter into it, pick how often to change, and it rotates through your checkpoints. But the display name contains the trap that trips up just about everyone on first use: "Batch" here does not mean it rotates per image inside a batch.

    Read that twice. ComfyUI executes this loader once per queue, loads one checkpoint, and the KSampler renders every image in that queue with it - batch_size: 20 in one queue gets you 20 images from one model, not twenty from twenty. The pack's own research notes spell this out in black and white: with batch generation, "All images use checkpoint_1 (even though counter changed)." The name is describing the counter's behavior, not the model switching.

    What it actually does

    The setup is the unusual part, because there's no counter inside the node. The counter input's tooltip gives you the recipe: "Connect a Primitive INT with 'control_after_generate: increment'." So:

    1. Right-click the counter input → Convert to input.
    2. Add a Primitive INT, connect it to counter.
    3. Double-click the left side of the primitive and set control_after_generate to increment.

    That primitive's increment fires after each queue completes - so with a single-image workflow queued N times, the counter ticks up once per image and the rotation works. Loop-based generation does the same thing per iteration. The math is the pack's standard formula: checkpoint_index = (counter // change_every) % num_checkpoints, where the counter is normalized by an internal offset that powers the reset feature.

    The reset_on_next toggle is a small lifesaver and a footgun at once: flip it on and the node records your current counter as an offset, so the next generation starts back at checkpoint 1 instead of continuing the cycle. The catch, printed in the console in all caps, is that you must flip it back off after that run - leave it on and it keeps re-anchoring the offset every generation.

    Inputs and outputs that matter

    • counter (INT) - the Primitive with increment, as above. This is the whole game.
    • subfolder - checkpoint folder relative to models/checkpoints/; empty for root.
    • change_every - images per checkpoint, default 4.
    • reset_on_next (boolean) - the reset-to-start toggle, sticky by design.

    Outputs are the standard model / clip / vae plus an info string that helpfully reports "Next change at image #N" so you can see where the cycle is heading. There's no checkpoint_name output on this one - the pack expects you to pair it with Save Image (with Checkpoint Info)'s own wiring, or use the debug loader if you need the name as a string.

    The workflow you actually want

    [Loop Start: N iterations] → [CheckpointRotationWithCounter]
      → [KSampler batch_size=1] → [SaveImageWithCheckpoint] → [Loop End]
    

    KSampler batch_size: 1 is non-negotiable, and you need a loop (the pack's notes point at the ComfyUI-Loop extension) or a queued-batch approach. If your images aren't changing checkpoints, nine times out of ten it's a batch-size or no-loop problem, not a node problem.

    Install

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

    Restart ComfyUI, watch for the green Checkpoint Rotation Node loaded successfully! message. No requirements.txt, no pip installs, no model downloads - just ComfyUI plus at least two checkpoints. It lives under Add Node → loaders → Checkpoint Rotation (Batch).

    Categoryloaders

    Inputs (4)

    NameTypeDefaultDescription
    counterINT00–100000Connect a Primitive INT with 'control_after_generate: increment'
    subfolderSTRINGCheckpoint subfolder name (leave empty for root)
    change_everyINT41–1000Change checkpoint every N images
    reset_on_nextBOOLEANfalseEnable this to reset counter to 0 on next generation, then disable it

    Outputs (4)

    NameTypeDescription
    modelMODEL
    clipCLIP
    vaeVAE
    infoSTRING