Nodes/Duanyll Nodepack/HuggingFace Diffusion Model Loader
ComfyUI Node

HuggingFace Diffusion Model Loader

FLUX.1 dev without the folder-shuffling

By Duanyll·Created about a year ago·Updated 4 months ago· 2
HuggingFace Diffusion Model Loader
    • MODEL
    repo_idblack-forest-labs/FLUX.1-dev
    weight_dtype
    subfoldertransformer
    filename

    HuggingFace Diffusion Model Loader is the pack's way of loading a diffusion model directly from the Hugging Face cache, and its default repo_id tells you exactly who it's for: black-forest-labs/FLUX.1-dev. If you want to run FLUX.1 dev (the 12B non-commercial tier that reset the quality bar in 2024 and is still the baseline everything gets measured against - see the KB's flux-1 panel) without manually copying transformer weights into ComfyUI's models/diffusion_models folder, this node is the shortcut. It emits just the MODEL - no CLIP, no VAE - so you pair it with HfClipLoader and a VAE loader.

    Like every HF loader in this pack, it's cache-only: it will not download the model for you. The repo must already be in your local HF cache, or you point it at a local path. Run hf download black-forest-labs/FLUX.1-dev once, and every future workflow just works offline.

    The inputs

    • repo_id - defaults to black-forest-labs/FLUX.1-dev. Change it for any other diffusion repo.
    • weight_dtype - the memory/quality tradeoff: default, fp8_e4m3fn, fp8_e4m3fn_fast, or fp8_e5m2. The fp8 options load the model in 8-bit float, which is how people squeeze 12B models onto consumer cards - fp8_e4m3fn_fast adds FP8 matmul optimizations for speed, fp8_e5m2 is the slightly coarser variant. If the model fits in full precision, leave default; if VRAM is tight, fp8_e4m3fn is the sweet spot.
    • subfolder (optional) - defaults to transformer, where FLUX repos keep their weights.
    • filename (optional) - auto-detects; for sharded models, use the .index.json.

    One output: MODEL.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Duanyll/duanyll_nodepack
    cd duanyll_nodepack && pip install -r requirements.txt
    

    or ComfyUI Manager → "Duanyll Nodepack" → install → restart.

    The honest tradeoff

    The cache-only design cuts both ways. On one hand: no more hunting through ComfyUI's models tree, one hf download command manages everything, and it works fully offline with zero surprise disk writes at runtime. On the other: if you came from the ComfyUI world, the built-in UNETLoader/DiffusionModelLoader already handles local files, and this node adds nothing unless your models live in the HF cache. But for FLUX specifically, the cache path is where BFL publishes, the subfolder/type defaults are right, and the fp8 options cover the VRAM strategies everyone actually uses. It's the pack author's personal FLUX pipeline, packaged - and for the FLUX-in-HF-cache user, it's genuinely the cleanest loader in the bunch.

    Categoryduanyll/loaders

    Inputs (4)

    NameTypeDefaultDescription
    repo_idSTRINGblack-forest-labs/FLUX.1-devThe Hugging Face repo ID, an absolute path (/path/to/model), or a relative path (./models/...) from the ComfyUI root.
    weight_dtypeCOMBO4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2
    subfolderoptSTRINGtransformerThe subfolder where the model is located. Applies to both Hugging Face repos and local paths.
    filenameoptSTRINGThe 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
    MODELMODEL