-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access gated repository for FLUX.1-dev model #14
Comments
I referenced this link and added the following code, replacing it with my own token as a temporary solution:
This allowed me to resolve the issue for now. I don't know much about coding, but I understand that using a personal access token directly in the code is not the correct long-term solution, as it is not very scalable or secure. |
Hello, The other way to pass the access token is through the huggingface cli. In your terminal, type
This will ask for your HF Token, and you’ll be good to go after that. |
I am not fully sure what the cleanest/best way is to handle this in code at the moment (e.g maybe nothing should be added and authentication should purely be done outside this repo as I guess is the case for using |
User have to create API token from Hugging Face with Repositories permissions to 'black-forest-labs/FLUX.1-dev' search for repos. |
I am assuming you are referring to an .env file. Where do we place the token? |
@sanctimon Just trust You can also use env vars demo$ huggingface-cli login
_| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|
_| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|
_|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|
_| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|
_| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|
To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .
Enter your token (input will not be visible):
Add token as git credential? (Y/n)
Token is valid (permission: write).
Your token has been saved in your configured git credential helpers (osxkeychain).
Your token has been saved to /Users/username/.cache/huggingface/token
Login successful |
Thank you, that was really useful and I was able to run and activate. However, as I am running ComfyUI from within Pinokio, it still does not seem to recognise the token. I am sure I would need to install this in the venv that Pinokio is running ComfyUI in, but I cannot for the life of me find a way to access it. |
@sanctimon in that case, you can bypass the attempt by Pinokio to download itself, and just ask Try this in the terminal where you successfully logged in: huggingface-cli download black-forest-labs/FLUX.1-dev ^ should work for any model you find on HF, for any tool that uses it, not specific to mflux or Pinokio. |
Hi there,
I'm trying to use the FLUX.1-dev model from the black-forest-labs repository on the Hugging Face Hub, but I'm encountering an issue where I'm unable to access the gated repository. When running the code, I'm getting the following error:
huggingface_hub.utils._errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-66c53d39-68d77c7933c60a4939ed6363;0a757519-549c-463e-9f18-356e8663f1f5) Cannot access gated repo for url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/0ef5fff789c832c5c7f4e127f94c8b54bbcced44/tokenizer/merges.txt. Access to model black-forest-labs/FLUX.1-dev is restricted. You must be authenticated to access it.
I'm able to directly access the URL in my browser, but it seems that the code is unable to authenticate correctly when trying to download the files. I've double-checked my authentication credentials, but I'm still running into this issue.
Could you please help me troubleshoot this problem? I'd be happy to provide any additional information or logs that might be helpful.
The text was updated successfully, but these errors were encountered: