Nodes/comfyui_bmad_nodes/CheckpointLoader (dirty)
ComfyUI Node Runs on cloud

CheckpointLoader (dirty)

The checkpoint loader whose filename is a text box, built for API automation

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
CheckpointLoader (dirty)
    • MODEL
    • CLIP
    • VAE
    config_name
    ckpt_name

    ComfyUI's normal checkpoint loaders have the filename baked into a dropdown. That's great for clicking, useless for automation - a script posting JSON to /prompt can't reach into the UI to pick a file. CheckpointLoader (dirty) is the API-friendly version: both the checkpoint name and the config name are plain text fields, so a string arriving from anywhere (a request body, this pack's RequestInputs node, a variable) can choose which model loads.

    The "dirty" in the name is the key idea: the input is loosely matched against what's actually on disk, instead of requiring the exact dropdown value. Under the hood it strips the file extension and matches against ComfyUI's checkpoint list by base filename. So "dreamshaper_8" and "dreamshaper_8.safetensors" both resolve to the same file - a small forgiveness that saves API callers from a whole class of off-by-one-string bugs.

    How it works

    • ckpt_name (STRING) - the checkpoint. Matched against models/checkpoints by base name.
    • config_name (STRING) - the config/checkpoint's sibling entry, also matched against the checkpoints list. Leave it as whatever the model expects; for most modern single-file checkpoints this is an empty/default config, and that's fine.
    • Outputs: MODEL, CLIP, VAE - identical to the standard CheckpointLoader, because it literally calls ComfyUI's own CheckpointLoader under the hood after resolving the names.

    Pair it with the pack's Get Models dump node: your script reads the real filename list from the JSON, picks one, sends it as a string, and this loader resolves it. That's the intended loop, and it's a tidy one.

    Install

    Part of bmad4ever/comfyui_bmad_nodes, under Bmad/api/dirty loaders:

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

    Restart, or ComfyUI Manager → search comfyui_bmad_nodes. No models to download - this node only loads the checkpoints you already have.

    Gotchas

    The match is by base name only. If no file matches, the node sets an error state with a "File '...' not found" message and the workflow fails - so whatever feeds this node should send a name that actually exists (that's why Get Models exists). Also note both fields resolve against the checkpoints folder list; if you're trying to load a LoRA or a UNet, this isn't the node - the pack has separate dirty loaders for those. And because it delegates to ComfyUI's own loader, everything you know about that node (VRAM, which formats work) applies unchanged.

    CategoryBmad/api/dirty loaders

    Inputs (2)

    NameTypeDefaultDescription
    config_nameSTRING
    ckpt_nameSTRING

    Outputs (3)

    NameTypeDescription
    MODELMODEL
    CLIPCLIP
    VAEVAE