Nodes/comfyui-toml-prompt/CheckPointLoaderFromString
ComfyUI Node

CheckPointLoaderFromString

Drive your checkpoint from a text file instead of a dropdown

By morino-kumasan·Created 2 years ago·Updated a day ago· 1
CheckPointLoaderFromString
    • MODEL
    • CLIP
    • VAE
    ckpt_name
    clip_name
    vae_name
    stop_at_clip_layer0

    Everyone reaches the point where they want to be able to change the checkpoint without opening the graph and re-picking from a dropdown. Config-driven generation: one text file at the top, everything downstream follows. CheckPointLoaderFromString is that idea for the model itself - the checkpoint, the CLIP, and the VAE all arrive as plain strings, which means they can come from anywhere: a note you paste, a Primitive node, or the exports block of a TOML prompt file in this same pack.

    On its own it's a novelty. Wired to a JSON/TOML config, it's the difference between "swap the model" being an edit and being a re-plumbing job.

    How it works

    Under the hood it's a thin shell around four core ComfyUI nodes. It calls CheckpointLoaderSimple for the model, CLIPLoader for an optional external text encoder, VAELoader for an optional VAE, and CLIPSetLastLayer if you ask it to stop the text encoder early. Nothing is reimplemented, so the thing loads exactly what the stock loader would load from the same filename.

    The two behaviours worth knowing come straight from the source:

    • Empty strings fall back. Leave clip_name or vae_name blank and you get the checkpoint's own CLIP and VAE, not an error. clip = self.clip_loader.load_clip(clip_name)[0] if clip_name else ckpt[1].
    • stop_at_clip_layer only acts when it's negative. The check is if stop_at_clip_layer is not None and stop_at_clip_layer < 0. Leave it at its 0 default and the core CLIPSetLastLayer node is never called. Set -2 and it clips.

    The inputs that matter

    ckpt_name is the only one you have to get right: the filename as CheckpointLoaderSimple would see it, relative to your models/checkpoints folder (sd15/model.safetensors if it's in a subfolder). clip_name and vae_name are for the 2026 habit of shipping the text encoder and VAE as separate files; blank means "use the checkpoint's". stop_at_clip_layer is 0 to -24.

    Outputs are the familiar trio - MODEL, CLIP, VAE - so it drops in anywhere a checkpoint loader sits.

    Clip skip, briefly

    stop_at_clip_layer = -2 is CLIP skip 2, the Danbooru-lineage convention: condition on the text encoder's penultimate layer instead of its last one. It's genuinely load-bearing on SD 1.5 anime models and most of what descended from them. On SDXL it usually changes nothing (both encoders already default to the penultimate layer), and on the 2026 Qwen3/Mistral-encoded models there are no CLIP layers left to stop at. So it's a compatibility switch for one model family, not a dial to tune.

    Install

    ComfyUI Manager is the easy path - search the pack name and restart. If it doesn't come up, clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/morino-kumasan/comfyui-toml-prompt
    

    then restart ComfyUI. There's no pip step: requirements.txt in this repo is empty, and the README's install block is stale on two counts - it still calls the repo comfyui-utils and uses an SSH clone URL ([email protected]:...) that fails unless you have GitHub keys configured. Use the HTTPS URL above.

    Where people get burned

    There's no dropdown, so there's no validation. A typo in ckpt_name doesn't turn the widget red - the graph validates fine and you find out at queue time when the loader throws on a missing file. That's the price of the feature. If you're wiring these strings from a config, put the config and the filename side by side when you set it up the first time.

    Filename formats don't travel. \ separators from a Windows-typed path will not resolve on Linux and vice versa - stick to /.

    A mismatched VAE doesn't error, it just looks wrong. If vae_name points at a VAE that isn't the one the checkpoint expects, you get washed-out, greyish output rather than a crash. Same failure as the stock loader, but here it's easier to do by accident because the field accepts anything you type.

    Categoryloaders

    Inputs (4)

    NameTypeDefaultDescription
    ckpt_nameSTRING
    clip_nameSTRING
    vae_nameSTRING
    stop_at_clip_layerINT0-24–0

    Outputs (3)

    NameTypeDescription
    MODELMODELMODEL
    CLIPCLIPCLIP
    VAEVAEVAE