AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
140.59k stars 26.61k forks source link

[Feature Request]: Add launch parameter to use HuggingFace Spaces #12270

Open shivanraptor opened 1 year ago

shivanraptor commented 1 year ago

Is there an existing issue for this?

What would your feature do ?

Currently, by using the --share flag, a 72-hour Gradio link will be generated. The output said that we can use HuggingFace Spaces for a permanent link. However, there is no way we can set the attributes of HuggingFace Spaces (link, credentials, etc.) and the Space requires an app.py to be committed and pushed to the Spaces repo.

How can we make use of HuggingFace Space?

Related unanswered discussions: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/1146

Proposed workflow

  1. (Optional, needed for private Space) Logged in with HuggingFace CLI and stored the credentials in keychain
  2. Launch SD Web UI via ./webui.sh --xformers --opt-sdp-no-mem-attention --enable-insecure-extension-access --api --share huggingface-username/huggingface-space-name
  3. The launch script will automatically connect and update the contents in the specified HuggingFace Space
  4. The SD Web UI will be launched with a HuggingFace Space link instead of 72-hour Gradio link

Additional information

No response

akx commented 1 year ago

It's unlikely we'll support HF Spaces out of the box – it's Gradio (the Huggingface project that's the UI for this project), not this project telling you you could use HF Spaces instead.

We already support ngrok for exposing your local installation with a public URL in addition to the Gradio --share feature.

By the way, you don't want --enable-insecure-extension-access with --share unless you want someone malicious installing and running anything they want on your machine.