Nodes/DarkPrompts/Dark Checkpoint Randomizer
ComfyUI Node

Dark Checkpoint Randomizer

Stick a checkpoint, keep it for N generations, then switch — automatically

By darkpixel·Created 3 years ago·Updated about a year ago· 11
Dark Checkpoint Randomizer
    • ckpt_name
    seed0
    use_for_iterations10
    checkpoint_names

    If you batch-generate across several checkpoints - say you want to A/B test models, or you run long unattended queues and want variety - DarkCheckpointRandomizer is the node that picks the checkpoint for you. You give it a list, it picks one at random, uses it for a set number of generations, then picks another. The "stick with it for N iterations" part is the thing that makes it actually useful, because it stops each batch from being a chaotic mix of models.

    How it works

    The core loop is straightforward: a text list of checkpoint filenames, one per line, and a seed - same reproducibility deal as DarkPrompt. Each call, it checks how many times the current checkpoint has been used, and once that hits use_for_iterations, it rolls a new one.

    The clever bit is that it doesn't forget between queues. State is persisted to a small JSON file in ComfyUI's temp directory (darkcheckpointrandomizer.json), so if you queue 5 jobs, walk away, come back and queue 5 more, the iteration counter keeps counting - it doesn't reset just because you weren't watching. It also validates every line against your actual checkpoints directory before doing anything: lines that don't exist are dropped and logged to the console, blank lines and comments are stripped, and if nothing in the list exists it raises a clear error rather than silently failing halfway through a 200-image overnight queue. That's the failure the author explicitly designed against, and it's a thoughtful one.

    What to set

    • checkpoint_names (multiline STRING) - one filename per line, exactly as they appear in your models/checkpoints folder (e.g. sdXL_v10.safetensors).
    • use_for_iterations (INT, default 10) - how many generations the picked checkpoint is locked in for. Set to 1 for full randomness on every run; higher for stable batches.
    • seed (INT, wireable) - controls the pick, not the stick: same seed re-rolls to the same next checkpoint.

    The output, ckpt_name, is a checkpoint filename string, not a loaded model - you wire it into the ckpt_name input of a standard CheckpointLoader node, which does the actual loading.

    A thing people miss

    The randomizer doesn't hot-swap mid-generation - it picks a name and the loader loads it, so switching costs a model load. With SDXL-sized files that's a few seconds each switch, which is why use_for_iterations above 1 is usually the right call. And since state lives in the temp directory, clearing temp (or --temp-directory quirks) resets the counter. Not a bug, but it will surprise you once.

    Install

    ComfyUI Manager → search "DarkPrompts" → install, restart. Or the manual route, same as every node in this pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/darkpixel/darkprompts.git
    

    Restart ComfyUI. No models to download, no pip deps. Watch the console on first run - it prints which checkpoint it chose, and any lines it quietly rejected.

    CategoryDarkPrompt

    Inputs (3)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000
    use_for_iterationsINT10
    checkpoint_namesSTRING

    Outputs (1)

    NameTypeDescription
    ckpt_name