trying to create a space with the open model, i am new please help.

#16
by iceborg - opened

Traceback (most recent call last):
File "app.py", line 13, in
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True, revision="fp16", torch_dtype=torch.float16)
File "/home/user/.local/lib/python3.8/site-packages/diffusers/pipeline_utils.py", line 154, in from_pretrained
cached_folder = snapshot_download(
File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_deprecation.py", line 93, in inner_f
return f(*args, **kwargs)
File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/_snapshot_download.py", line 115, in snapshot_download
raise EnvironmentError(
OSError: You specified use_auth_token=True, but a Hugging Face token was not found.

this is a demo not a model

how would one make a demo like this ?

Try the colab version

Hi @iceborg , in order to make a demo on a Spaces or for local deployment, you would need to create a User Access Token here https://huggingface.co/settings/tokens and add this token to the Repo secrets here:
image.png

Then visit https://huggingface.co/CompVis/stable-diffusion-v1-4, read and accept the LICENSE if you agree
However, this code won't work out of the box on cloned Spaces because right now Spaces that use GPU are restricted to some demos. In order to run on CPU you also have to not use the autocast part of the code. I have updated the codebase with some comments to make this process easier to follow

In case you are running locally, you can either:

  • Run huggingface-cli login or
  • Paste the token here pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token="YOUR_GENERATED_TOKEN", revision="fp16", torch_dtype=torch.float16)

@iceborg also to add to this, to make a gradio demo you can follow this google colab notebook: https://colab.research.google.com/drive/1NfgqublyT_MWtR5CsmrgmdnkWiijF3P3?usp=sharing

Sign up or log in to comment