How can i gain access to the model

#16
by eskayML - opened

image.png
I'm new to hugging face and deep learning in general.
It's shows that I need authorization from this page to access the model,

Yeah, you need to accept conditions for using this model. Open the model page, accept the terms below and then go to your profile and create a new access token with read permissions. You're now able to clone the repository including the binary model files using git:

git lfs install
git clone "https://huggingface.co/CompVis/stable-diffusion-v1-4"
git lfs pull
git lfs checkout

When asked for credentials, as username enter hf_user and as password use the newly-created token. After all this is said and done, you can then import your model from the subdirectory:

# ...
pipe = StableDiffusionPipeline.from_pretrained("./stable-diffusion-v1-4", torch_dtype=torch.float16)
# ...

Note that there are alternative methods which don't use git but the huggingface_hub python package instead.

from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=True)

Should work as well if you're logged in with:

huggingface-cli login

@patrickvonplaten

Using below code, I downloaded the model into my desktop. For my next usages, each run, do I need to download it all from beginning or is there any model assignment to pipe variable from my desktop? I think my model is downloaded into ./models path in my initial run. Am I right ?

pipe = StableDiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4",
torch_dtype=torch.float16,
scheduler=lms,
use_auth_token=True,
cache_dir=os.getenv("cache_dir", "./models")
).to(device)

Thank you,

Sign up or log in to comment