Nodes/Duanyll Nodepack/HuggingFace Triple CLIP Loader
ComfyUI Node

HuggingFace Triple CLIP Loader

The Three-Encoder Loader for SD3 and Friends, Minus the Folder Juggling

By Duanyll·Created about a year ago·Updated 4 months ago· 2
HuggingFace Triple CLIP Loader
    • CLIP
    repo_id_1stabilityai/stable-diffusion-3-medium
    repo_id_2stabilityai/stable-diffusion-3-medium
    repo_id_3stabilityai/stable-diffusion-3-medium
    subfolder_1text_encoders
    subfolder_2text_encoders
    subfolder_3text_encoders
    filename_1clip_l.safetensors
    filename_2clip_g.safetensors
    filename_3t5xxl_fp16.safetensors

    Stable Diffusion 3 and its family condition on three text encoders: CLIP-L, CLIP-G, and the big T5-XXL. That trio is why SD3 follows prompts about as well as it does - and why loading it is fiddly, because those three files live in one place in ComfyUI's mental model and another in Hugging Face's repo layout. HfTripleClipLoader sidesteps the whole thing: give it a repo, get a CLIP.

    It's the middle sibling of the pack's loader family (dual for Flux, quadruple for HiDream, triple here), and it solves the same annoying problem as the rest: files already sitting in your HF cache shouldn't have to be copied into models/text_encoders by hand.

    How it works

    The defaults are tuned for stabilityai/stable-diffusion-3-medium: all three repo_id fields point at that repo, the subfolder_1..3 defaults are text_encoders, and the filename defaults are clip_l.safetensors, clip_g.safetensors, and t5xxl_fp16.safetensors - which is exactly how SD3's repo lays out its encoders. So the stock case is: leave the defaults, hit run.

    Under the hood it's the pack's shared loader engine - resolve the HF cache snapshot (or a local path), auto-detect or use the explicit filename, merge shards if the checkpoint is split, and hand all three state dicts to Comfy's load_text_encoder_state_dicts. No type dropdown here; the encoders are detected from the state dicts themselves. Output is a single CLIP.

    Inputs and outputs

    • repo_id_1 / 2 / 3 - each accepts an HF repo ID, an absolute path, or a ./relative path from the ComfyUI root. All three must be set.
    • subfolder_1..3 and filename_1..3 - optional; the defaults already match the SD3 repo, but override them when you're loading a different repo or a sharded checkpoint (use the .index.json filename for sharded files).

    One CLIP out, wired into CLIPTextEncode as usual.

    Installing it

    It's part of Duanyll Nodepack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Duanyll/duanyll_nodepack
    

    or install "Duanyll Nodepack" through ComfyUI Manager and restart.

    Where people get burned

    Same as its siblings: the node reads your HF cache, it doesn't download. The description claims it "Downloads a model from Hugging Face," but the code raises FileNotFoundError with Run \hf download <repo>` first` if the repo isn't cached. Get SD3 medium cached once:

    hf download stabilityai/stable-diffusion-3-medium
    

    A second trap is the T5 half of the trio. T5-XXL is a ~9.5B encoder - most of SD3's RAM/VRAM footprint is that one file. If you're on a tight card, that's where a quantized T5 or the smaller T5 encoder makes the difference, and it's worth knowing the loader isn't the bottleneck. And as with every loader here: ambiguous folders need an explicit filename, or the node refuses to guess.

    Categoryduanyll/loaders

    Inputs (9)

    NameTypeDefaultDescription
    repo_id_1STRINGstabilityai/stable-diffusion-3-mediumThe Hugging Face repo ID, an absolute path (/path/to/model), or a relative path (./models/...) from the ComfyUI root.
    repo_id_2STRINGstabilityai/stable-diffusion-3-mediumThe Hugging Face repo ID, an absolute path (/path/to/model), or a relative path (./models/...) from the ComfyUI root.
    repo_id_3STRINGstabilityai/stable-diffusion-3-mediumThe Hugging Face repo ID, an absolute path (/path/to/model), or a relative path (./models/...) from the ComfyUI root.
    subfolder_1optSTRINGtext_encodersThe subfolder where the model is located. Applies to both Hugging Face repos and local paths.
    subfolder_2optSTRINGtext_encodersThe subfolder where the model is located. Applies to both Hugging Face repos and local paths.
    subfolder_3optSTRINGtext_encodersThe subfolder where the model is located. Applies to both Hugging Face repos and local paths.
    filename_1optSTRINGclip_l.safetensorsThe checkpoint file to load. If not specified, will auto-detect. For sharded checkpoints, use the index file (e.g., 'model.index.json').
    filename_2optSTRINGclip_g.safetensorsThe checkpoint file to load. If not specified, will auto-detect. For sharded checkpoints, use the index file (e.g., 'model.index.json').
    filename_3optSTRINGt5xxl_fp16.safetensorsThe checkpoint file to load. If not specified, will auto-detect. For sharded checkpoints, use the index file (e.g., 'model.index.json').

    Outputs (1)

    NameTypeDescription
    CLIPCLIP