Nodes/ComfyUI-FluxExt-MZ/MinusZone - Flux1CheckpointLoader_cpuDynOffload
ComfyUI Node

MinusZone - Flux1CheckpointLoader_cpuDynOffload

A full-precision Flux checkpoint loader that pages around your VRAM

By MinusZoneAI·Created 2 years ago·Updated 2 years ago· 344
MinusZone - Flux1CheckpointLoader_cpuDynOffload
    • MODEL
    • CLIP
    • VAE
    ckpt_name
    double_blocks_cuda_size7
    single_blocks_cuda_size7

    You don't want to quantize your Flux checkpoint - fair, fp16 is fp16. But it won't fit in VRAM, and the usual answers (fp8 cast, GGUF, NF4) all change the weights. MZ_Flux1CheckpointLoader_cpuDynOffload is the other route: it's a drop-in replacement for ComfyUI's built-in CheckpointLoaderSimple, except it pages Flux's transformer blocks between CPU and GPU while the sampler runs, so you keep full precision and just eat the slower transfer speed.

    What it is

    Under the hood this node calls the stock CheckpointLoaderSimple, then runs the pack's core patch - the same mechanism as MZ_Flux1PartialLoad_Patch - on the loaded model. Flux's transformer is 19 double blocks plus 38 single blocks, and the patch loads them onto the GPU in chunks just before they execute, evicting the previous chunk to CPU as it goes. Peak VRAM during sampling drops from "the whole 12B transformer" to roughly one chunk of it. It's the same idea ComfyUI's built-in lowvram handling does automatically, but with explicit chunk-size control tuned for Flux.

    Inputs and outputs

    • ckpt_name - the dropdown of checkpoints in ComfyUI/models/checkpoints. Put your Flux checkpoint there.
    • double_blocks_cuda_size - INT, 0–16, default 7. How many of the 19 double blocks stay resident at once.
    • single_blocks_cuda_size - INT, 0–37, default 7. Same for the 38 single blocks.

    Outputs are MODEL, CLIP, and VAE, exactly like a standard checkpoint loader - wire them into your sampler, positive/negative conditioning, and VAE decode. So swapping this in for CheckpointLoaderSimple doesn't change your workflow at all, which is the point. Bigger block sizes = more VRAM but fewer swaps; smaller = slower but tiny footprint.

    Installing it

    ComfyUI Manager (search ComfyUI-FluxExt-MZ) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MinusZoneAI/ComfyUI-FluxExt-MZ
    

    Restart. No pip dependencies, no model downloads - it just wraps a loader you already have. The pack is GPL-3.0, a single August 2024 commit, and the README is in Chinese; think of it as a utility someone shipped for their own low-VRAM card.

    The gotchas

    • Only the MODEL is offloaded. The CLIP output still includes the full T5-XXL encoder, which is its own VRAM hog. On a small card you'll still want an fp8 T5 or a quantized text encoder alongside this.
    • The model has to fit in system RAM, because that's where the parked blocks live while off the GPU.
    • Don't set either block size to 0 - the patch's range(0, depth, 0) throws a Python error. The minimum in the UI is 0 but it isn't usable.
    • Re-running with different parameters after a generation "has bugs" - that's the author's own README warning. The hooks mutate the model in place; restart ComfyUI to get a clean one before you fiddle with the sizes.
    • It's slower than just loading the model, sometimes a lot slower - every chunk swap is a trip over PCIe. On a 20-step image that's tolerable; on batches, budget for it.
    CategoryMinusZone - FluxExt

    Inputs (3)

    NameTypeDefaultDescription
    ckpt_nameCOMBO0 options:
    double_blocks_cuda_sizeINT70–16
    single_blocks_cuda_sizeINT70–37

    Outputs (3)

    NameTypeDescription
    MODELMODEL
    CLIPCLIP
    VAEVAE