Checkpoint Pair Cycler Loader (Nukun)
The A/B checkpoint matrix, driven by one counter
- MODEL_1
- CLIP_1
- MODEL_2
- CLIP_2
- VAE
- modelname_1
- modelname_2
- combined_modelname
- ckpt_name_1
- ckpt_name_2
- folder
- pair_index
- model_index_1
- model_index_2
- total_pairs
Sometimes one checkpoint isn't the unit you want to batch over - you want pairs. Two different checkpoints fed into the same graph, crossed against each other, every combination tested. That's the "all-with-all" matrix, and doing it by hand in ComfyUI means managing two loaders, two counters, and praying they stay in sync.
NukunCheckpointPairCyclerLoader turns the whole matrix into a single pair_index. One number steps through every ordered pair of checkpoints in a folder, and the node handles the indexing so you don't have to.
How the matrix works
Give it a checkpoint_folder - the dropdown only lists checkpoint subfolders, and each folder is a separate choice - and it builds an ordered matrix of N × N pairs from the checkpoints inside. The indexing is the thing to get your head around: MODEL_2 advances fastest, one step per pair_index increment, while MODEL_1 advances only after a full pass through the folder.
And the matrix is full: it includes self-pairs and reversed pairs. So with models A, B, C you'll get A×A, A×B, A×C, then B×A, B×B, ... - every ordered combination, which matters if your workflow treats the two model inputs asymmetrically (say, one drives a reference, one drives composition).
Two extra inputs shape the sweep:
model_index_start/model_index_end- restrict the matrix to an inclusive global index range, e.g.20..49. Handy when you're resuming a long run that died at pair 20, or splitting a giant matrix across multiple queues.vae_name-checkpointkeeps the VAE fromMODEL_2(which is the last model loaded), or pick an external VAE to override the shared output.
What comes out
The full bus: MODEL_1/CLIP_1 and MODEL_2/CLIP_2, a shared VAE, and the metadata you need for filenames - modelname_1, modelname_2, and a combined_modelname that joins them as modelname_1__x__modelname_2 (filename-safe, directly usable as a save prefix). pair_index, model_index_1, model_index_2, and total_pairs come out too, and total_pairs is the one that matters for chunking: it tells you the size of the full matrix so you know where your wrap point is.
The README's tip for long runs: set pair_index to increment-wrap, and wrap it over the reduced total_pairs value when you're using an index range. That way the counter loops cleanly inside your restricted slice.
Installing it
Same one-time pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
Restart ComfyUI or install via ComfyUI Manager ("Nukun").
The honest caveat
The all-with-all matrix is a blunt instrument - for 10 checkpoints that's 100 runs, 50 of them A×A self-pairs you may not care about. That's not a defect, it's the design: it guarantees complete coverage. If you only want directed A/B tests without the self-pairs, you're better off with the single CheckpointCyclerLoader and a second fixed loader. But when you genuinely want every combination tested and can let the queue run overnight, this node is the cleanest way to get it - one counter, zero index math on your part.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| pair_index | INT | 00–18446744073709550000 | Single matrix index. The second checkpoint advances fastest; the first advances after one full folder pass. |
| checkpoint_folder | COMBO | Checkpoint subfolder used to build the ordered all-with-all matrix. | |
| vae_name | COMBO | checkpoint | Use 'checkpoint' to keep the second checkpoint VAE, or select an external VAE to override it. |
| model_index_start | INT | 00–18446744073709550000 | First global model index included in the checkpoint matrix. |
| model_index_end | INT | 184467440737095500000–18446744073709550000 | Last global model index included in the checkpoint matrix. Values past the folder end use the last model. |
Outputs (15)
| Name | Type | Description |
|---|---|---|
| MODEL_1 | MODEL | — |
| CLIP_1 | CLIP | — |
| MODEL_2 | MODEL | — |
| CLIP_2 | CLIP | — |
| VAE | VAE | — |
| modelname_1 | STRING | — |
| modelname_2 | STRING | — |
| combined_modelname | STRING | — |
| ckpt_name_1 | STRING | — |
| ckpt_name_2 | STRING | — |
| folder | STRING | — |
| pair_index | INT | — |
| model_index_1 | INT | — |
| model_index_2 | INT | — |
| total_pairs | INT | — |