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

Checkpoint Model Loader Resident

Load just the UNet from a checkpoint, with the resident fast path

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

    Checkpoint Model Loader Resident is the diffusion-model-only version of the pack's full checkpoint loader. Give it a checkpoint file and you get back a single MODEL - the CLIP and VAE never get built. If you're generating images in a graph that loads the text encoder and VAE separately anyway, this is how you avoid pulling two components you never use.

    The mechanism is where it gets interesting. For .safetensors checkpoints this node takes the same selective UNet fast path as the pack's Diffusion Model Loader Resident: it reads the file header, picks out only the detected UNet keys, and attempts a direct GPU ingest instead of the stock CPU-read-then-copy. If the direct read fails it falls back to CPU plus tensor-by-tensor copy. It also reuses a live equivalent model when one's already in memory, and before a GPU-bound load it estimates the footprint and trims only enough lower-priority residency to fit.

    The tuning knobs match the full checkpoint loader exactly:

    • ckpt_name - the checkpoint file.
    • weight_dtype - default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2, fp16, bf16, fp32.
    • compute_dtype - applied to the patcher after load.
    • patch_cublaslinear - cublas performance toggle, off by default.
    • sage_attention - attention override; leave disabled unless you've installed SageAttention yourself.
    • enable_fp16_accumulation - fp16 matmul accumulation, off by default.
    • Optional policy_override - residency policy string; connect Set Global Residency Policy here.

    One output: MODEL, straight into your sampler.

    Where this fits in practice is the staged-checkpoint workflow. Load the UNet here, the CLIP through Checkpoint Clip Loader Resident, the VAE through Checkpoint VAE Loader Resident, and each piece is loaded and tracked independently - with its own residency controls if you want them. That's useful when a checkpoint shares components with another you're also using, or when you want to pin the expensive UNet resident while letting the smaller pieces come and go. On a big GPU running with --highvram or --gpu_only, the pack's sticky_gpu policy auto-pins the loaded model, so it stays in VRAM between runs.

    Caveats, same as the rest of the pack: the fast path is .safetensors-only, pickle formats are CPU-first, and this node inherits the pack's startup patches whether you use the residency features or not. If you only ever want the whole checkpoint, the full Checkpoint Loader Resident is one node instead of three.

    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 search "comfyui-gpu-resident-loader" in ComfyUI Manager.

    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 (1)

    NameTypeDescription
    MODELMODEL