How do I get permission?
Hi All,
I can't run the model. Without a token I get this message:
Cannot access gated repo for url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/model_index.json.
Access to model black-forest-labs/FLUX.1-dev is restricted. You must be authenticated to access it.
With token the error is:
Invalid token passed!
How do I get permission to run the model?
import torch
from diffusers import FluxPipeline
from huggingface_hub import login
login(token='Trying FLUX.1-dev2', add_to_git_credential=True)
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
prompt = "A cat holding a sign that says hello world"
image = pipe(
prompt,
height=1024,
width=1024,
guidance_scale=3.5,
num_inference_steps=50,
max_sequence_length=512,
generator=torch.Generator("cpu").manual_seed(0)
).images[0]
image.save("flux-dev.png")
First, request access to the repo. Then, use your access token like this:
from huggingface_hub import login
login(token="your_access_token")
You can create an access token in your account settings.
After adding the :
from huggingface_hub import login
login(token="my_access_token")
I get this error in my console :
raise LocalEntryNotFoundError(
huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.
But I'm certain I have connexion ...
First, request access to the repo. Then, use your access token like this:
from huggingface_hub import login login(token="your_access_token")
You can create an access token in your account settings.
I have created access token from my account settings, but does this mean that I've requested access for this particular model?
I have created access token from my account settings, but does this mean that I've requested access for this particular model?
No, you must also go to https://huggingface.co/black-forest-labs/FLUX.1-dev and press the button to be granted access to the model.
I had a similar issue. I solved it by adding read/write access to fine-grained token while generating it.
I had a similar issue. I solved it by adding read/write access to fine-grained token while generating it.
"Read access to contents of all public gated repos you can access" is the option
agreed
I had a similar issue. I solved it by adding read/write access to fine-grained token while generating it.
"Read access to contents of all public gated repos you can access" is the option
You shuld go to the model and agree terms to use!
Did anyone manage to get it working with ComfyUI? If so - where to put the token?
Did anyone manage to get it working with ComfyUI? If so - where to put the token?
in the settings select the secret and enter
After adding the :
from huggingface_hub import login login(token="my_access_token")
I get this error in my console :
raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.
But I'm certain I have connexion ...
I am also facing same issue, after using the fine-grained access token and I have repo access too. Does anyone know how to solve this?
It works great for me... follow his instructions.
Log in to Hugging Face, click on your Profile up on the right, choose "Access tokens" then "Create new token",
add token name... whatever, scroll down to "Repositories permissions" and choose "Search for repos" and enter "black-forest-labs/FLUX.1-dev"... check "Read access to contents of selected repos"
The scroll down to bottom and click on "Create token"
Copy the token value and enter it into:
from huggingface_hub import login
login(token="my_access_token")
Enter the token value where it says "my_access_token"