Skip to main content

HuggingFace gated model 401 / "access restricted" in ComfyUI — how to fix

A 401 on a model download means the weights are gated on HuggingFace (FLUX.1-dev, some Llama/Gemma repos) and the download had no accepted-license token. The node isn't missing — the download is being refused.

Also seen as: "401 Client Error", "gated repo", "access to model is restricted"

Direct answer

How do I fix "Gated Model Access"?

A 401 on a model download means the weights are gated on HuggingFace (FLUX.1-dev, some Llama/Gemma repos) and the download had no accepted-license token. The node isn't missing — the download is being refused.

Key facts

  • iThe model repo is gated and you have not accepted its license on huggingface.co.
  • iNo HF token passed to the download, or a token without access to that repo.
  • iA workflow that silently defaults to a gated base model (e.g. FLUX.1-dev) when an unknown model id is requested.

Next step

  1. 1Accept the license on the model's HuggingFace page while logged in.
  2. 2Create a read token (huggingface.co/settings/tokens) and pass it to the download / set HUGGINGFACE_API_TOKEN_READ.
  3. 3Prefer an ungated mirror or an equivalent open-license checkpoint where one exists.
  4. 4Verify the exact repo id — a typo can route to a gated default.

Not a fit when

  • A token still fails until you've clicked "accept" on the specific gated repo.

Not sure this workflow will run before you rent a GPU?

Paste your ComfyUI workflow JSON into the free checker — it flags missing nodes, model requirements, and the VRAM/GPU you actually need. No signup.

Other ComfyUI errors

Frequently Asked Questions

What causes "Gated Model Access" in ComfyUI?

The model repo is gated and you have not accepted its license on huggingface.co.

How do I fix "Gated Model Access"?

Accept the license on the model's HuggingFace page while logged in. Create a read token (huggingface.co/settings/tokens) and pass it to the download / set HUGGINGFACE_API_TOKEN_READ.