Nodes/ComfyUI_Dif_GGUF/Dif_GGUF_Loader
ComfyUI Node

Dif_GGUF_Loader

The GGUF loader that stops fighting your newer diffusion models

By smthemex·Created 2 months ago·Updated 19 days ago· 20
Dif_GGUF_Loader
    • model
    gguf

    Quantized weights are the only way most people actually run the big new stuff - Flux 2, Klein 9B, Krea2, the whole "dif" generation of diffusion transformers. Dif_GGUF_Loader is a one-input, one-output model loader from smthemex (the author behind a dozen other ComfyUI packs) that drops a .gguf diffusion model into your graph the same way you'd use an UNETLoader, just without the shape-check fights. If you've used city96's ComfyUI-GGUF, this is the same idea, rewritten, and deliberately more tolerant of the newer model formats that older loaders choke on. Its own description sums up the selling point: quantized lazy dequant + shape-tolerant.

    GGUF is llama.cpp's single-file quantized format, adopted by the diffusion world the week Flux 1 shipped because 12B params priced most consumer GPUs out of fp16. The Q ladder is the whole pitch: Q8 is effectively identical to fp16 at half the size, Q5 is the last tier before visible loss, and Q4_K_M is the accepted compromise for 12GB cards. This loader doesn't care which tier you picked - it reads whatever's in the file and keeps it quantized all the way to the GPU.

    That last bit is the mechanism worth understanding. When you load a .gguf, the node doesn't dequantize the whole checkpoint into full-precision RAM like a naive loader would. It reads the tensors, wraps the quantized ones in a GGMLTensor, and reference-mounts them into the model instead of copying - so a Q4 file stays roughly Q4-sized in memory. Dequantization happens lazily, per layer, at inference time through custom ops, and a GGUFModelPatcher handles the model wrapper. It also bypasses Comfy's usual shape checks: if a stored tensor doesn't match the shape the architecture expected, it swaps it in anyway. That shape tolerance is exactly what the newer architectures need, and it's why the README suggests you just replace your existing single-UNet loader with this node and walk away. One honest catch: hidream-O1 isn't supported yet.

    You only really set one thing. The lone gguf input is a dropdown that lists .gguf files from both ComfyUI/models/gguf (created automatically when the pack loads) and ComfyUI/models/diffusion_models. Pick your file and you're done - there's no clip or vae handling here, and no config knobs. The single model output is a standard MODEL socket, so it wires straight into your sampler where the old UNETLoader's output went. If you point it at a file that isn't .gguf, it falls back to loading it as a normal diffusion model, so it doubles as a slightly smarter UNETLoader - it even sniffs fp8 dtypes from filenames containing fp8_e4m3fn or fp8_e5m2.

    Install is the usual two-liner:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smthemex/ComfyUI_Dif_GGUF
    

    Then restart ComfyUI. It's in the Comfy Registry too, so ComfyUI Manager's "Install Custom Nodes" search will find it by "ComfyUI_Dif_GGUF" - the easier route. Dependencies are just torch and gguf; if you already run city96's ComfyUI-GGUF pack, the gguf Python package is already installed and the README says you can skip pip install -r requirements.txt entirely. The pack ships two sibling loaders you'll want for full workflows - CLIP_GGUF_Loader and DualCLIP_GGUF_Loader for quantized text encoders, which is how you actually squeeze the VRAM budget tight.

    Where people get burned: this is a young, niche pack, so expect rougher edges than the battle-tested city96 equivalent. Leaving the dropdown on "none" just asserts and errors. And remember the KB's standing advice - on a 12GB card that already holds fp8, GGUF saves you little; quantize only when the model genuinely doesn't fit. LoRAs on quantized weights also pay a dequantize-patch-requantize tax, so if you're LoRA-heavy and VRAM-capped, drop a quant level to make room.

    Categorymodel/loaders

    Inputs (1)

    NameTypeDefaultDescription
    ggufCOMBO1 options: none

    Outputs (1)

    NameTypeDescription
    modelMODEL