How do I get permission?

#84
by Ragged6 - opened

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

Sign up or log in to comment