Nodes/ComfyUI-SmartModelLoaders-MXD/Smart Dual CLIP Loader MXD
ComfyUI Node

Smart Dual CLIP Loader MXD

Mix a GGUF Text Encoder with a Safetensors One in a Single Loader

By Maxed-Out-99·Created about a year ago·Updated 6 months ago· 2
Smart Dual CLIP Loader MXD
    • CLIP
    clip_name1
    clip_name2
    type

    If you run Flux or SDXL, you run two text encoders, and this is the loader for that exact situation. The Smart Dual CLIP Loader MXD is a drop-in replacement for ComfyUI's built-in DualCLIPLoader - same two clip_name slots, same type dropdown - with one extra trick: each slot can hold a .gguf or a safetensors file, independently. So you can run a quantized GGUF T5-XXL next to a full-precision CLIP-L and the node just... figures it out.

    That mixed-format ability is the whole selling point, and it matters more than it sounds. On 12GB cards the text encoder is frequently the actual VRAM bottleneck rather than the diffusion model - the KB's guidance is blunt about it: quantize the encoder hard, keep precision in the model. The GGUF ecosystem exists mostly because of Flux's 12B checkpoint, but T5-XXL itself is nearly 5GB at fp16. Fitting a GGUF T5 next to a safetensors CLIP-L is the classic low-VRAM Flux setup, and most workflows make you do it across two different loader nodes. This one does it in one.

    How it works

    Under the hood it's a fork of city96/ComfyUI-GGUF's loader logic, wrapped in ComfyUI's standard load_clip shape. Each slot pulls from a merged list of everything in models/text_encoders (plus .gguf files living there). At load time:

    • Both files non-GGUF → the exact same comfy.sd.load_clip path the core loader uses. Nothing changes for your existing SDXL workflows.
    • Any GGUF → each file loads by format (GGUF through gguf_clip_loader, safetensors through the standard torch loader), then they're joined via load_text_encoder_state_dicts with GGML ops. GGUF T5-style tokenizers get rebuilt from the file's own metadata - that's why the pack pulls in sentencepiece and protobuf.

    The type parameter is forwarded straight from the core DualCLIPLoader, so it's the list you already know: sdxl, flux, sd3, hunyuan_video, hidream, kandinsky5, ltxv, and the rest. Set it to whatever you'd set on the built-in node - Flux needs flux, SDXL needs sdxl, and getting it wrong produces broken conditioning, not an error.

    The inputs that matter

    • clip_name1 / clip_name2 - pick one file per slot. Mixing formats is fine and is the point.
    • type - the architecture selector. Same list as the core node; don't overthink it.

    Output is a single CLIP, wired into a CLIP Text Encode (or CLIP Text Encode (Flux)) just like the node it replaces. Swap it in without rewiring.

    Install

    ComfyUI Manager - search "Smart Model Loaders". 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, and it shows up under advanced/loaders. The requirements are light (gguf>=0.13.0, sentencepiece, protobuf) and there are no model downloads - it reads your existing text encoder files.

    Common issues

    • Missing tokenizer / "incompatible with llama.cpp" - some GGUF text encoders, especially older T5 conversions, carry no usable tokenizer metadata. The loader errors rather than silently producing garbage; the fix is a compatible GGUF conversion (city96 and bullerwins keep good ones) or the safetensors encoder.
    • Garbage output with no error - almost always the type being wrong for the encoder combo, not the node. Double-check you're on flux/sdxl.
    • Quant too aggressive - a Q2 T5 is "completely fine" to some users and clearly worse to others; typography degrades first. Q8 T5 is the safe call if it fits.

    This is the node in the family most people actually want - Flux and SDXL users get a real reason to install the pack.

    Categoryadvanced/loaders

    Inputs (3)

    NameTypeDefaultDescription
    clip_name1COMBO0 options:
    clip_name2COMBO0 options:
    typeCOMBO12 options: sdxl, sd3, flux, hunyuan_video, hidream, hunyuan_image, +6

    Outputs (1)

    NameTypeDescription
    CLIPCLIP