Personal access tokens for HuggingFace and Civitai can be saved to your RunComfy account so that any ComfyUI machine you launch can download gated, private, or rate-limited models on your behalf — without re-entering credentials each session.
⚠️ Tip: Tokens are stored encrypted at rest and only exposed to your own ComfyUI / filebrowser containers as environment variables at launch time. They are never returned to the browser in plaintext after saving — only a short prefix is shown for visual reference, so you can tell which token is currently saved.
1. Where to save your tokens
Open your account Profile page and scroll to the Third-Party Tokens section (it sits just below API Tokens).
You will see one row per service:
Service | Where to generate a token |
HuggingFace | huggingface.co/settings/tokens — create a Read token (or Fine-grained with the gated-repos you need) |
Civitai | civitai.com/user/account — generate an API key |
Paste the token into the input and click Save. The row will flip to a Saved state showing the first 6 characters of your token followed by dots (for example hf_uTKP••••••••••••••••) so you can recognise which value is currently in use.
From that state you can:
- Click the pencil icon to replace the saved token with a new one.
- Click the trash icon to clear the saved token.
2. How tokens are used at launch
Each time you spin up a ComfyUI machine, your saved tokens are injected into the launching containers as environment variables:
Service | Environment variable | Consumed by |
HuggingFace | HUGGINGFACE_TOKENS | filebrowser (model downloads) |
Civitai | CIVITAI_TOKENS | filebrowser (model downloads) |
Saving a token is useful when you want to:
- Download gated HuggingFace repos (FLUX, Llama, Stable Diffusion 3, etc.) that require accepting terms-of-use against your personal account.
- Use a private HuggingFace repo owned by you or your team.
- Have Civitai rate-limits and access counted against your own account.
- Download Civitai models that are hidden from anonymous users.
⚠️ Tip: Environment variables are baked in at machine launch. After you save or clear a token, relaunch the machine (or trigger a Cloud Save and start a new session) for the change to take effect — existing running sessions will keep using the values they were started with.
3. Special Trainer settings
The HuggingFace token is shared with the Trainer settings page. Editing your HuggingFace token in either place automatically updates the other — there is no separate "training" vs "generation" token to keep in sync.
The Civitai token is only used by ComfyUI / filebrowser today and is not used by the Trainer.
Troubleshooting
- Filebrowser still returns 401 / "gated repo" after saving. Relaunch the machine — env vars are read at boot. Existing sessions don't pick up the new value.
- My HuggingFace download fails with 403 even though my token is saved. Visit the model's HuggingFace page while signed in and accept the gating terms. Token-based access still requires that your account has accepted the model's terms.
- My token works on
huggingface-clibut fails on RunComfy. Make sure you copied the full token (including thehf_prefix) with no leading or trailing whitespace, then paste and Save again.