Nodes/ComfyUI-HfLoader/ControlNet Loader From HF
ComfyUI Node

ControlNet Loader From HF

Wire a ControlNet Into Your Graph Without Ever Downloading It

By olduvai-jp·Created 2 years ago·Updated 2 years ago· 4
ControlNet Loader From HF
    • CONTROL_NET
    repo_namecontrolnet_repo
    filenamecontrolnet_model.pt
    api_token

    ControlNet Loader From HF is the sibling of the pack's LoRA loader: instead of picking a ControlNet file from your local models/controlnet folder, you type a Hugging Face repo name and a filename, and the node downloads, loads, and hands you a ready-to-wire CONTROL_NET output. Same idea, one fewer drag-and-drop. If you're rebuilding a shared workflow and the ControlNet weights aren't on your machine yet, this is the fastest way to get them onto the graph short of manually downloading and moving files.

    How it works

    The mechanism is refreshingly small. On run, it calls hf_hub_download(repo_name, filename), then hands the downloaded path to comfy.controlnet.load_controlnet() - the exact same loader the stock ControlNetLoader uses, just pointed at a fresh file. Files cache in ComfyUI/models/hf_cache_dir/, the folder this pack registers, and the node keeps the last loaded ControlNet in memory so re-runs don't touch the network. ControlNet itself, per the wider context, is what lets you condition generation on spatial structure - edges, depth, pose - rather than just a prompt. This node doesn't do any of that conditioning; it just gets the model object ready for a ControlNetApply node to consume.

    The inputs, which are only three

    • repo_name - the owner/name of the HF repo. Real example: lllyasviel/control_v11p_sd15_canny. The default controlnet_repo is a placeholder that does not exist on the hub.
    • filename - the exact weights file inside that repo, e.g. control_v11p_sd15_canny.pth. Default is controlnet_model.pt; forget to change it and the download fails with a file-not-found.
    • api_token - empty for public repos, required only for gated or private ones (get it from HF → Settings → Access Tokens).

    The single output is CONTROL_NET, and it feeds the control_net input of a ControlNetApply or ControlNetApplyAdvanced node, alongside a preprocessed conditioning image.

    Installation

    Same pack as the LoRA loader, so this installs with it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/olduvai-jp/ComfyUI-HfLoader
    pip install huggingface-hub
    

    Restart ComfyUI after. That's the entire dependency list - huggingface-hub is the only requirement. Or search "ComfyUI-HfLoader" in ComfyUI Manager and skip the terminal.

    The catch, and it's a real one

    This loader only speaks single-file ControlNets. It downloads one filename, and comfy.controlnet.load_controlnet needs a complete weights file - that means classic SD 1.5/SDXL-era .pt or .safetensors ControlNets, the lllyasviel control_v11p_* line being the canonical example. It will not work with diffusers-format repos that store a config plus split weights across a folder, which is exactly how most modern union ControlNets ship - the Flux, Qwen-Image and Z-Image union repos on HF are directories, not single files, so this node can't fetch them. If you're on a post-SDXL architecture, this probably isn't the loader for you; it's aimed at the single-file era.

    Other notes: first load needs network, downloads live in models/hf_cache_dir (so don't go looking in your controlnet folder), and the in-memory cache means running a different repo+file in another node instance won't conflict - it just swaps the cached object cleanly. It's a thin, honest utility node from a tiny pack, zero community footprint, and it does exactly what its name says. Just keep it pointed at the flat-file repos it understands.

    CategoryHF_loaders

    Inputs (3)

    NameTypeDefaultDescription
    repo_nameSTRINGcontrolnet_repo
    filenameSTRINGcontrolnet_model.pt
    api_tokenSTRING

    Outputs (1)

    NameTypeDescription
    CONTROL_NETCONTROL_NET