π² Load Random Checkpoint
Roll a Different Checkpoint Every Run Without Rewiring Anything
- model
- clip
- vae
- path
If you have six realism checkpoints and you want to know which one actually handles your prompt, the boring answer is to swap the loader six times. The π² Load Random Checkpoint node from ComfyUI-mnemic-nodes does it in one queue: you list the models, hit Queue Prompt repeatedly, and get a different checkpoint each run - same graph, no rewiring. It's a batch-variation tool, not a sampler.
How it works
The checkpoints box takes one entry per line, and each line can be four different things. A bare name like realvis is fuzzy-matched against your models/checkpoints folder. A relative path like SDXL/Realistic/ is resolved from that folder. An absolute path points straight at a file. A directory path pulls in every .ckpt and .safetensors inside it, recursively. So Realism/ on its own line is a legitimate way to say "all of these".
Matching is generous by design: it looks for a case-insensitive substring hit first, and only falls back to difflib fuzzy scoring if nothing contains your string (it gives up below a 0.3 ratio). You do not need the full filename, and you do not need the extension.
Then it builds a pool, sorts it, shuffles it once with a fixed seed, and caches it. Selection is seed // repeat_count, so the index into that pool is what changes - and that's why the author's tooltip repeats the same warning twice: control_after_generate must be set to increment or nothing ever changes.
shuffle picks the mode. False gives you the "each model gets used before any repeats" behaviour - the pool order is fixed at load, so within a session you cycle through everything. True picks at random for each index instead, which means the same checkpoint can come up twice in a row. Once the loaded checkpoint is actually in memory, consecutive runs on the same index reuse it rather than reloading the file.
Inputs and outputs that matter
Four inputs: checkpoints, seed, repeat_count, shuffle. repeat_count is the interesting one - set it to 3 and seeds 0, 1, 2 all resolve to the same model, then 3, 4, 5 move to the next. That's how you generate a few samples per checkpoint instead of one, which matters because a single image is a terrible basis for judging a model.
Outputs are the standard loader trio plus a bonus: model, clip, vae, and path - the full file path of whatever it picked. Wire path into a Save Image filename prefix (or just read it off the console) and you can tell later which model produced which image. That's the difference between a useful experiment and forty unattributed files.
Install
ComfyUI Manager β search "ComfyUI-mnemic-nodes" β install β restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes
No API key, no model downloads. Note that the pack as a whole pulls in its full requirements.txt (transformers, opencv-python, tiktoken and friends) even if you only want this one node - those exist for its Groq and metadata nodes, not for this one.
Common issues
Nothing changes between runs. Either seed isn't incrementing, or repeat_count is bigger than the number of runs you've done. This is the number one complaint with index-based loader nodes.
"Could not resolve any valid checkpoint files." The pool came back empty. Usually a relative path that doesn't sit under models/checkpoints, or a name fuzzy-matching to nothing. The node logs its matching to the console if you enable the pack's console-logging setting, so you can see exactly what it picked.
A checkpoint you didn't want keeps winning. Fuzzy matching is substring-first, so Realistic can grab CyberRealistic and epiCRealism both. Use a directory line or a fuller path when you care.
It reloads a 6.5GB model every run. Only when the index moves. Keep repeat_count at 2β4 and let it amortise the load; that's also why the cached-pool behaviour exists.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| checkpoints | STRING | Enter checkpoint names, file paths, or directory paths - one per line. β’ Names (model_one) are fuzzy-matched against checkpoint files β’ Relative paths (SDXL/Realistic/) based from checkpoints folder β’ Absolute paths (C:/path/to/model.safetensors) β’ Directory paths add all .ckpt/.safetensors files within them β’ Empty lines are ignored | |
| seed | INT | 00β18446744073709550000 | Controls checkpoint selection. Works with repeat_count: β’ repeat_count=1: Each seed gives different checkpoint β’ repeat_count=3: Seeds 0,1,2 β same checkpoint, seeds 3,4,5 β same different checkpoint Set 'Control After Generate' to 'Increment' for repeat_count to work. |
| repeat_count | INT | 11β1000 | Set 'Control After Generate' to 'Increment' for repeat_count to work. How many consecutive seeds use the same checkpoint. β’ 1 = Each seed picks a different checkpoint β’ 3 = Seeds 0,1,2 all use checkpoint A, seeds 3,4,5 all use checkpoint B |
| shuffle | BOOLEAN | false | Selection mode: β’ False: Checkpoints will not repeat until all possible candidates has been used β’ True: Random selection from the pool. The same checkpoint could be used multiple times in a row |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| model | MODEL | The loaded checkpoint model (MODEL) |
| clip | CLIP | The CLIP model from the checkpoint (CLIP) |
| vae | VAE | The VAE model from the checkpoint (VAE) |
| path | STRING | The full file path of the selected checkpoint file (STRING) |