Nodes/Bjornulf_custom_nodes/๐ŸŽฒ Random Load checkpoint (Model Selector)
ComfyUI Node

๐ŸŽฒ Random Load checkpoint (Model Selector)

Pick a checkpoint at random, get its folder name too

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
๐ŸŽฒ Random Load checkpoint (Model Selector)
    • model
    • clip
    • vae
    • model_path
    • model_name
    • model_folder
    โ—„number_of_models3โ–บ
    โ—„model_1โ–พโ–บ
    โ—„model_2โ–พโ–บ
    โ—„model_3โ–พโ–บ
    โ—„model_4โ–พโ–บ
    โ—„model_5โ–พโ–บ
    โ—„model_6โ–พโ–บ
    โ—„model_7โ–พโ–บ
    โ—„model_8โ–พโ–บ
    โ—„model_9โ–พโ–บ
    โ—„model_10โ–พโ–บ
    โ—„seed0โ–บ

    Point this at a list of checkpoints and it loads one at random each run. Good for variety batches - you want the same prompt rendered across a rotating cast of base models without babysitting the loader. The pack has two ways to randomize a checkpoint, and this is the lighter one: it loads checkpoints on demand rather than preloading them all into memory. Slower to switch between them, but it doesn't hog VRAM holding every model resident, and it gives you extra string outputs the other version can't.

    Those string outputs are the reason to prefer it. It hands you the checkpoint's folder name, which turns out to be quietly powerful.

    How it works

    You list your candidate checkpoints, the seed picks one, and the node loads that checkpoint fresh and outputs its MODEL, CLIP, and VAE - same trio the core Load Checkpoint gives you. Because it loads on demand, only the chosen model sits in VRAM, not all of them. The trade-off, in the author's own words: you can't give each checkpoint its own separate config (a different CLIP Set Last Layer, a swapped VAE) - every model runs the exact same downstream graph.

    There's a neat side-trick: load it with a single checkpoint and it'll "randomly" pick that one every time - a cheap way to grab a checkpoint's folder name for use elsewhere.

    The inputs and outputs that matter

    • number_of_models (INT, default 3) - how many candidate slots, up to 20.
    • model_1 โ€ฆ model_10 (dropdowns) - your checkpoints, populated from models/checkpoints.
    • seed (INT) - drives the pick. Randomize for variety, fix to reproduce.

    Outputs: model, clip, vae (wire into your sampler / VAE decode), plus three strings - model_path, model_name, and model_folder. That last one returns the checkpoint's containing folder name, e.g. SDXL or SD1.5 if you organise checkpoints by type. Feed it into an If-Else to branch on model family, or into a save-folder node to sort outputs by the model that made them.

    How to install it

    ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/justUmen/Bjornulf_custom_nodes
    pip install -r Bjornulf_custom_nodes/requirements.txt
    

    then restart. Uses ComfyUI's own checkpoint loading; no special dependency.

    Common issues & troubleshooting

    It's slow to switch checkpoints. That's the intended trade-off - this variant loads on demand instead of preloading everything, to save VRAM. If you'd rather burn memory for speed (say you're rapidly cycling models), the pack's other node, Random (Model+Clip+Vae), preloads them all - faster switches, more VRAM, but no folder-name outputs.

    My per-model tweaks got ignored. By design: all checkpoints share one downstream graph, so you can't set a different clip-skip or VAE per model here. If you need that, use the preloading variant and wire each checkpoint's config separately.

    model_folder is empty or wrong. It returns the last folder in the checkpoint's path, so organise your checkpoints into type folders (SDXL/, Pony/) to get meaningful values. A checkpoint sitting loose in the root has no folder to report.

    Same model every run. Fixed seed - flip it to randomize.

    I want to run all of them. This picks one; for a full sweep use the loop version of the model selector instead.

    CategoryBjornulf

    Inputs (12)

    NameTypeDefaultDescription
    number_of_modelsINT31โ€“20โ€”
    model_1optCOMBO0 options:
    model_2optCOMBO0 options:
    model_3optCOMBO0 options:
    model_4optCOMBO0 options:
    model_5optCOMBO0 options:
    model_6optCOMBO0 options:
    model_7optCOMBO0 options:
    model_8optCOMBO0 options:
    model_9optCOMBO0 options:
    model_10optCOMBO0 options:
    seedoptINT00โ€“18446744073709550000โ€”

    Outputs (6)

    NameTypeDescription
    modelMODELโ€”
    clipCLIPโ€”
    vaeVAEโ€”
    model_pathSTRINGโ€”
    model_nameSTRINGโ€”
    model_folderSTRINGโ€”