Search code examples
google-colaboratoryhuggingface-datasetshuggingface

StableDiffusion Colab - How to "make sure you're logged in with `huggingface-cli login`?"


I'm trying to run the Colab example of the Huggingface StableDiffusion generative text-to-image model:

https://huggingface.co/CompVis/stable-diffusion https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb#scrollTo=xSKWBKFPArKS

However it gets stuck on the loading of the model:

enter image description here

Using the model requires registration at Huggingface and a token - I have one, I also got a token, which was accepted in the previous cell:

enter image description here

After the error I also executed the suggested command: !git config --global credential.helper store

Although I don't think it's what has to be done.

I found this: https://huggingface.co/docs/hub/repositories-getting-started (Although I won't be pushing, but only downloading.)

To be able to push your code to the Hub, you’ll need to authenticate somehow. The easiest way to do this is by installing the huggingface_hub CLI and running the login command:

python -m pip install huggingface_hub
huggingface-cli login

I installed it and run it:

!python -m pip install huggingface_hub
!huggingface-cli login

enter image description here

I logged in with my token (Read) - login successful.

However it still returns the same error on the attempt to download the model.

How to "make sure I'm logged in with huggingface-cli login"?

Thanks!


Solution

  • Found a solution on HackerNews in https://news.ycombinator.com/item?id=32555028

    Quoting PunkSpider (stop by the thread and give them an upvote):

    The solution seems to be to visit https://huggingface.co/CompVis/stable-diffusion-v1-4 and check a checkbox and click the button to confirm access.