Nodes/ComfyUI-Lora-Manager/Random Checkpoint Loader (LoraManager)
ComfyUI Node

Random Checkpoint Loader (LoraManager)

Roll the dice on a checkpoint — for A/B testing and happy accidents

By willmiao·Created 2 years ago·Updated about 8 hours ago· 1,373
Random Checkpoint Loader (LoraManager)
    • MODEL
    • CLIP
    • VAE
    • model_name
    ckpt_name
    select_at_randomfalse
    base_modelAny

    Every ComfyUI user hits the same wall eventually: you've got forty checkpoints and one really good prompt, and you're manually swapping ckpt_name in the loader, running, comparing, swapping again. Tedious doesn't cover it. Random Checkpoint Loader (LoraManager) is the lazy fix - a drop-in replacement for the standard Load Checkpoint that can pick a random checkpoint from your whole pool on every run, optionally filtered by base model.

    It's a genuinely weird node to reach for until you understand the two things it's actually good at. First, discovering: when you're not sure which of your models handles a prompt best, rolling through them at random surfaces candidates you'd never have bothered testing. Second, honesty-checking a prompt: if a workflow only works on one specific checkpoint, random loading finds out fast. And when it picks something you love, the model_name output tells you exactly what got loaded.

    How it works

    The node pulls its checkpoint list from the LoRA Manager scanner cache - the same index the manager UI browses - which means it sees your standard ComfyUI folders and any extra model folders you've registered in the manager. That extra-folder reach is a real upgrade over the stock loader.

    The interesting mechanism is IS_CHANGED. ComfyUI caches node results and skips re-running when the widget values haven't changed - which would break "random on every run" instantly, since the widgets don't change. So when select_at_random is on, the node returns a non-cacheable value and forces a fresh random pick every queue run. Flip it off and it behaves like a normal loader.

    Three inputs, and only two really matter:

    • select_at_random - the toggle. On = ignore ckpt_name and pick randomly each run; off = load whatever's in ckpt_name.
    • base_model - restricts the random pool to one base model, e.g. "SDXL" or "SD 1.5". This is the filter that keeps a Pony checkpoint from landing on an Illustrious-only workflow. Any uses everything.
    • ckpt_name - the explicit pick, used when randomization is off.

    Outputs are MODEL, CLIP, VAE (wire them exactly like a stock Load Checkpoint) plus model_name - a STRING with the loaded checkpoint's name. That string is the secret sauce: feed it into prompt text, the pack's metadata, or a recipe so you always know which model produced a given image.

    Install

    This is one node inside willmiao/ComfyUI-Lora-Manager. Via ComfyUI Manager: Manager → Custom Node Manager → search lora-manager → Install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/willmiao/ComfyUI-Lora-Manager
    cd ComfyUI-Lora-Manager
    pip install -r requirements.txt
    # restart ComfyUI
    

    The pack's Python deps are light; nothing heavy downloads at install. One thing to know: the checkpoint list comes from the manager's scanner, so your first launch needs to finish indexing before the random pool is meaningful.

    Where people get burned

    • Random model + random seed = unreproducible. If you're A/B testing, lock the seed (or use a Seed node) so a random checkpoint swap is the only variable. Otherwise you'll spend an evening not knowing whether the checkpoint or the seed changed the image.
    • "value not in list" / "not found in cache." The node only offers checkpoints that still exist on disk and are indexed - a freshly downloaded model may not be in the scanner cache yet, so the random pool can lag reality. Refresh or restart ComfyUI after adding models.
    • Empty pool for a base model. Pick a base_model nobody in your collection matches and you get a clean FileNotFoundError telling you to change the filter or disable randomization. That's by design - it'd rather error than silently load wrong.
    • Randomizing in a shared recipe. A workflow you share with select_at_random on will behave differently for whoever opens it. Great for you, confusing for a collaborator. Use it deliberately.
    CategoryLora Manager/loaders

    Inputs (3)

    NameTypeDefaultDescription
    ckpt_nameCOMBOThe name of the checkpoint (model) to load.
    select_at_randomBOOLEANfalseIgnore ckpt_name and pick a random checkpoint from the pool (optionally filtered by base_model) on every run.
    base_modelCOMBOAnyRestrict random selection to this base model. 'Any' uses the full pool.

    Outputs (4)

    NameTypeDescription
    MODELMODELThe model used for denoising latents.
    CLIPCLIPThe CLIP model used for encoding text prompts.
    VAEVAEThe VAE model used for encoding and decoding images to and from latent space.
    model_nameSTRINGThe name of the checkpoint that was loaded (useful when select_at_random is enabled).