ComfyUI Node

Smart Model Loader

One loader for .safetensors and GGUF, with the name as a string output

By slvslvslv·Created 2 years ago·Updated 7 days ago· 3
Smart Model Loader
    • model
    • model_name
    gguffalse
    unet_name
    weight_dtype
    gguf_name

    Smart Model Loader is the "stop deciding which loader node to use" node. It loads a diffusion model from either .safetensors (the core Load Diffusion Model path) or .gguf (the ComfyUI-GGUF path), chosen with one boolean - and it also hands you the model's filename as a string, so you can log which weights a render used.

    If you're on a video workflow, this is a quiet quality-of-life win. Wan and HunyuanVideo models show up in both formats - full .safetensors when you have the VRAM, GGUF quants when you don't - and the format you pick for a given render can change. One node that speaks both means you never rebuild the graph when you switch from a Q5 GGUF to a full-precision file to test quality.

    How it works

    Two modes, one boolean:

    • gguf: false → loads unet_name from diffusion_models via ComfyUI's standard loader, with an optional fp8 cast from weight_dtype.
    • gguf: true → loads gguf_name by importing city96's ComfyUI-GGUF nodes on the fly and calling its UnetLoaderGGUF.

    The weight_dtype options - default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2 - are the memory lever for the safetensors mode. fp8 is the community's "just use it" quantization for video: half the VRAM, near-invisible quality loss, and for 14B-class models on consumer cards it's frequently the difference between running and not. fp8_e4m3fn is the standard pick.

    The model_name output is the underrated bit. It's the filename as a plain string, so it can flow into a SmartSaveText log or a SmartFormatString filename - your render's metadata can record which model file it used, which is the reproducibility piece the core loaders don't give you.

    The inputs that matter

    • gguf - the format switch (default false).
    • unet_name - safetensors model from diffusion_models.
    • gguf_name - GGUF file, active when gguf is on.
    • weight_dtype - fp8 casting for safetensors mode.

    Outputs: model (MODEL) and model_name (STRING).

    Installing it

    It's part of SmartHelperNodes; install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/slvslvslv/ComfyUI-SmartHelperNodes
    

    Restart ComfyUI, or ComfyUI Manager → "SmartHelperNodes". The pack has no pip deps, but the GGUF half of this node requires city96/ComfyUI-GGUF - without it, flipping gguf on raises a clear error pointing you to that repo. Install it from ComfyUI Manager too if you plan to use quantized models.

    Common issues

    The classic mistake is flipping gguf on without ComfyUI-GGUF installed - the node tells you exactly that. The subtler one is assuming weight_dtype matters in GGUF mode: it doesn't - quantization is baked into the GGUF file, so the fp8 selector only applies to safetensors loading. And remember the GGUF dropdowns and the safetensors dropdowns are separate lists; a file you expect to see may be hiding in the other mode's list.

    CategorySmartHelperNodes

    Inputs (4)

    NameTypeDefaultDescription
    ggufBOOLEANfalse
    unet_nameCOMBO0 options:
    weight_dtypeCOMBO4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2
    gguf_nameCOMBO0 options:

    Outputs (2)

    NameTypeDescription
    modelMODEL
    model_nameSTRING