Nodes/ComfyUI-SmartModelLoaders-MXD/Smart Model Loader MXD
ComfyUI Node

Smart Model Loader MXD

The UNET Loader That Doesn't Care If You Feed It GGUF or Safetensors

By Maxed-Out-99·Created about a year ago·Updated 6 months ago· 2
Smart Model Loader MXD
    • MODEL
    unet_name

    The whole point of the Smart Model Loader MXD is that you pick a file, not a format. Normally, testing GGUF quants against a full safetensors checkpoint means swapping nodes - core UNETLoader for your fp16, city96's GGUF loader for your Q5. This node is one dropdown that shows both kinds of files and routes to the right machinery on its own. The name isn't marketing; it just never makes you think about what the file is.

    How it works

    It's a drop-in replacement for the built-in UNETLoader, and the mechanism is refreshingly boring. The dropdown is a merged list of everything in models/diffusion_models plus any .gguf files in that same folder - the pack registers a parallel "unet_gguf" folder key that points at your normal diffusion models directory, so there's no second model folder to learn. GGUF files just show up alongside safetensors in the one list.

    At load time it checks the file extension:

    • Ends in .gguf → the GGUF path: gguf_sd_loader reads the state dict as fake quantized tensors, ComfyUI builds the model with GGMLOps custom operations, and the result gets wrapped in a GGUFModelPatcher so weight patching (LoRAs, etc.) still works. This is the same machinery as city96/ComfyUI-GGUF - this pack is literally a fork of it, so don't install both for this node's sake.
    • Anything else → comfy.sd.load_diffusion_model, the exact code path the core UNETLoader runs. Zero behavior change for your existing safetensors checkpoints.

    Inputs and outputs

    The only input that matters is unet_name, the dropdown of model files. That's it - no type selector, no per-quant settings. GGUF quants carry their own metadata, so the node knows what it's loading.

    The single output is MODEL, and it wires into everything you'd expect: the "model" port on a KSampler, CLIP Text Encode chains, LoRA stackers, or a patcher like a ControlNet or T5 adapter. It's a straight swap for the built-in node's output, so you can replace the node in an existing workflow without rewiring anything.

    Why you'd actually use it

    Two honest reasons. First, quant A/B testing: the KB's own consensus is that Q8 is "99% identical" to fp16 at half the VRAM, and Q4_K_M is the accepted compromise on 12GB cards. When you're flip-flopping between quant levels and a full checkpoint to see where quality breaks, doing it in one node instead of two is genuinely nicer. Second, the low-VRAM grind: if your Flux or video model only fits as GGUF, this is the loader you leave in the graph permanently - it'll load whatever you drop in the folder, quantized or not.

    Install

    ComfyUI Manager is the easy route - search "Smart Model Loaders" and install. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Maxed-Out-99/ComfyUI-SmartModelLoaders-MXD
    cd ComfyUI-SmartModelLoaders-MXD
    pip install -r requirements.txt
    

    Restart ComfyUI and it appears under advanced/loaders in the node menu. The requirements are light - gguf>=0.13.0 plus sentencepiece and protobuf (those two are for GGUF text-encoder tokenizers, not this node). No model downloads; it only reads files you already have. It's under the hood an Apache-2.0 fork of city96's GGUF pack, so trust-wise it's about as mainstream as these re-skins get.

    Common issues

    • "Could not detect GGUF model type" - the file's architecture isn't in the loader's supported list (flux, sd1, sdxl, sd3, aura, hidream, cosmos, ltxv, wan, lumina2, qwen_image, hyvid). Usually means an odd or custom conversion, not a broken install.
    • LoRAs feel slow on GGUF - expected, not a bug. Every layer gets dequantized, patched, and requantized, and the KB notes the fix when you're VRAM-capped is to drop a quant level, not swear at the node.
    • VRAM still tight after quantizing the model - the text encoder is often the real hog on large models. Quantize the CLIP/T5 too; that's what the CLIP loader siblings in this pack are for.

    The trap worth naming: if your model fits comfortably as fp8, this node buys you nothing. GGUF's advantage starts where fp8 stops fitting. If it fits, just run fp16/fp8 and skip the whole quant saga.

    Categoryadvanced/loaders

    Inputs (1)

    NameTypeDefaultDescription
    unet_nameCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    MODELMODEL