Nodes/comfyui-gpu-resident-loader/Checkpoint Loader Resident
ComfyUI Node

Checkpoint Loader Resident

A full checkpoint loader that stops rebuilding what's already in VRAM

By xmarre·Created 5 months ago·Updated 5 months ago· 2
Checkpoint Loader Resident
    • MODEL
    • CLIP
    • VAE
    ckpt_name
    weight_dtype
    compute_dtypedefault
    patch_cublaslinearfalse
    sage_attentiondisabled
    enable_fp16_accumulationfalse
    policy_override

    Checkpoint Loader Resident is the drop-in replacement for ComfyUI's stock "Load Checkpoint" that wants to be smarter about VRAM. It takes a single checkpoint file and gives you MODEL, CLIP, and VAE - same three outputs as the built-in loader, same place in your graph - but underneath it behaves differently in two ways that matter.

    First, it composes the result from component loaders instead of always materializing the whole checkpoint state dict. If an equivalent CLIP or VAE is already alive in memory, it reuses that live object rather than rebuilding it from disk. Load a checkpoint, then switch to another one that shares the same text encoder, and the CLIP portion doesn't get re-ingested. That's the "reuse live components" behavior this pack is built around, and it's the biggest practical win for anyone who juggles a handful of checkpoints that share components.

    Second, it carries the same tuning knobs as the pack's diffusion-model loader for the model component:

    • weight_dtype - default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2, fp16, bf16, fp32.
    • compute_dtype - applied to the diffusion model patcher after load.
    • patch_cublaslinear - ComfyUI's cublas performance toggle, off by default.
    • sage_attention - SageAttention attention override. Leave on disabled unless you've installed SageAttention yourself; the pack doesn't install it.
    • enable_fp16_accumulation - fp16 matmul accumulation toggle, off by default.
    • Optional policy_override - a residency policy string; connect Set Global Residency Policy here.

    The only required input is ckpt_name, the checkpoint file. Outputs are MODEL, CLIP, and VAE - wire them wherever you'd wire the stock loader's outputs.

    The fast-path caveat applies exactly as it does everywhere in this pack: the selective-loading and GPU-ingest tricks are built around .safetensors. Pickle-based .ckpt and .pt files go through CPU-first torch.load() - tracked, reusable, but no direct-to-GPU magic. If you're running a hot pickle checkpoint, convert it once with the included scripts/convert_checkpoint_to_safetensors.py.

    Install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xmarre/ComfyUI-GPU-Resident-Loader
    cd ComfyUI-GPU-Resident-Loader
    pip install -r requirements.txt
    

    Then restart ComfyUI (or find it by searching "comfyui-gpu-resident-loader" in ComfyUI Manager).

    Honest take: if your workflow just loads one checkpoint once and generates, this node buys you little - stock ComfyUI is fine. Its value appears when you're doing multi-model passes (img2img with a different model, a/b model comparisons, video work where the UNet is huge and you reload it constantly) or when you run with --highvram / --gpu_only, which makes the pack's sticky_gpu policy kick in and auto-pins the loaded model and CLIP so the next run finds them still resident. It's not a speed-up you'll feel on a single image; it's a workflow that reloads models a lot and is tired of paying for it.

    CategoryGPU Resident Loader/loaders

    Inputs (7)

    NameTypeDefaultDescription
    ckpt_nameCOMBOCheckpoint file to load.
    weight_dtypeCOMBO7 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2, fp16, bf16, +1
    compute_dtypeCOMBOdefaultCompute dtype to apply to the diffusion model patcher after load.
    patch_cublaslinearBOOLEANfalseToggle ComfyUI's cublas_ops performance feature.
    sage_attentionCOMBOdisabledPatch optimized attention override on the loaded model.
    enable_fp16_accumulationBOOLEANfalseSet torch.backends.cuda.matmul.allow_fp16_accumulation.
    policy_overrideoptSTRINGOptional residency policy override. Connect Set Global Residency Policy here.

    Outputs (3)

    NameTypeDescription
    MODELMODEL
    CLIPCLIP
    VAEVAE