Some Stable Diffusion models on HuggingFace require authentication:
- Gated models: Models that require accepting terms (e.g., Stable Diffusion 2.x)
- Private models: Your own private models or organization models
- Rate limits: Authenticated users get higher download rate limits
- Open ImageAI GUI
- Go to Settings tab
- Select local_sd as the provider
- In the HuggingFace Authentication section:
- Click Login to HuggingFace
- Paste your token in the field that appears
- Click Save Token
# Login to HuggingFace
python download_models.py login
# You'll be prompted for your token (hidden input)
# The token will be saved for future use# Install huggingface-hub if not already installed
pip install huggingface-hub
# Login using the official CLI
huggingface-cli login- Go to https://huggingface.co/settings/tokens
- Sign up or log in to your HuggingFace account
- Click New token
- Give it a name (e.g., "ImageAI")
- Select Read permission (minimum required)
- Click Generate token
- Copy the token (starts with
hf_)
The GUI shows your authentication status:
- ✓ Logged in as: [username] - Successfully authenticated
- ⚠ Invalid token - Token exists but is invalid
- Not logged in - No authentication (can still download public models)
Most models work without authentication:
- runwayml/stable-diffusion-v1-5
- CompVis/stable-diffusion-v1-4
- Most community models
Some models require accepting terms:
- stabilityai/stable-diffusion-2-1
- stabilityai/stable-diffusion-xl-base-1.0
- Some newer Stability AI models
When downloading a gated model:
- Ensure you're logged in to HuggingFace
- Go to the model page on HuggingFace
- Accept the license terms if prompted
- Then download through ImageAI
- You need to authenticate with HuggingFace
- Run
python download_models.py loginor use the GUI
- You're authenticated but haven't accepted the model's terms
- Visit the model page on HuggingFace and accept the license
- Ensure your token starts with
hf_ - Check that it has at least Read permission
- Try generating a new token
- Your token is stored locally in
~/.huggingface/token - Never share your token or commit it to version control
- The token is used only for downloading models
- You can revoke tokens at any time from HuggingFace settings