Checkpoint Loader Iterator
Run One Prompt Against Every Checkpoint You Own, Automatically
- MODEL
- CLIP
- VAE
- CKPT_NAME
You've got eighteen checkpoints downloaded, and a prompt you're not sure which one handles best. The stock ComfyUI loader forces you to hand-swap the model, rerun, hand-swap again - and by the fourth iteration you've lost track of which image came from which 6 GB file. The Checkpoint Loader Iterator exists to end that chore: it loads a different checkpoint on every queue execution, cycles through your whole models/checkpoints folder, and wraps when it runs out. Queue the prompt, go make tea, come back to one image per model.
It's a tiny, honestly-named utility - one node, no dependencies, no model downloads - and it's the right tool for one job: prompt testing across a batch of models. The iterator part is the whole trick. It's not the node you reach for when you need a specific checkpoint; it's the one you reach for when you specifically don't want to think about which one is loaded.
How it works
The mechanism is refreshingly simple, and the source is short enough to read in one go. The node takes no inputs at all - nothing to configure, no index, no list. On each execution it reads folder_paths.get_filename_list("checkpoints"), which is just your ComfyUI models/checkpoints folder, picks index % len(checkpoints), and increments a counter. Modulo is why it wraps: after the last checkpoint, execution number N+1 starts back at the first.
That counter is a class-level variable, not per-node, which is worth knowing. Every Checkpoint Loader Iterator in your session shares the same counter, so if you drop two of these into one graph they'll interleave and duplicate instead of behaving independently. And IS_CHANGED returns NaN, the standard trick that tells ComfyUI "I changed, always re-execute me" - so the node fires on every queue run even if nothing else in your graph is dirty.
Two decisions in the code deserve credit. First, before loading the next model it calls unload_all_models() plus soft_empty_cache() plus gc.collect() - it deliberately clears VRAM between swaps so a big Flux checkpoint doesn't pile on top of the last SD 1.5 one. The honest tradeoff is that every swap is a cold load from disk, which is slower. For a sweep node, that's the right call. Second, it loads through ComfyUI's own load_checkpoint_guess_config, the same path the stock loader uses, so it works across architectures - SD 1.5, SDXL, Illustrious, Flux - whatever you've parked in the folder. It also guesses the right config for each, which is exactly what you want in a mixed folder.
The outputs
- MODEL, CLIP, VAE - the standard trio. MODEL into your KSampler, CLIP into the conditioning (or your text encoders if you're on Flux), VAE wherever your pipeline expects it.
- CKPT_NAME - a string with the exact filename of the currently loaded checkpoint. This is the quiet hero. Route it into a filename prefix or a save-image node that accepts text, and every output image names its own parent model. Without it, comparing a sweep means squinting at image metadata.
Install
ComfyUI Manager: search "Checkpoint Loader Iterator" (or "Checkpoint-Iterator") and install. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Ni-zav/ComfyUI-Checkpoint-Iterator.git
Then restart ComfyUI. There's no requirements.txt, no Python deps, no weights to fetch - the node only reads what's already in your checkpoints folder. It shows up under Add Node → loaders → Checkpoint Loader Iterator.
Gotchas
The README spells out the trap most people hit first: sampler batch size is not iteration count. Bumping KSampler's batch to 8 gives you 8 images from one model. To iterate, you queue 8 separate executions - hit the Queue button, or queue a batch of prompts. Bigger batch, one model. More queue entries, many models.
The rest are worth knowing before you start:
- It sweeps everything in the folder. That abandoned 20 GB test file you forgot about is a checkpoint, as far as it's concerned. It'll be one of your samples.
- There's no way to skip or start somewhere. No index input, no "start at model 5" - fire and forget. If you get a
ValueError: No checkpoints found., ComfyUI isn't seeing your checkpoints folder at all. - State carries across queues. Because the counter wraps rather than resetting, your next sweep starts where the last one left off, not at model 0. Restart ComfyUI if you want a clean cycle.
For a one-job node, it does the job. Small, free, zero maintenance - and it saves you the most tedious kind of manual work in the whole pipeline.
Inputs (0)
No inputs
Outputs (4)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| VAE | VAE | — |
| CKPT_NAME | STRING | — |