carloscar's picture
Installation fixes and updates to run as shared UI
6316350 verified
|
raw
history blame
6.22 kB
---
title: Stable Diffusion WebUI + ControlNet
emoji: πŸ¦„
colorFrom: pink
colorTo: yellow
sdk: docker
app_port: 7860
pinned: true
tags:
- stable-diffusion
- stable-diffusion-diffusers
- text-to-image
models:
- stabilityai/stable-diffusion-2-1
- runwayml/stable-diffusion-v1-5
- lllyasviel/ControlNet
- webui/ControlNet-modules-safetensors
- dreamlike-art/dreamlike-diffusion-1.0
- Anashel/rpg
- Lykon/DreamShaper
---
## Stable Diffusion WebUI + ControlNet
Private image builds with both with Stable Diffusion 2.1 models and Stable Diffusion 1.5 models and bundles several popular extensions to [AUTOMATIC1111's WebUI]([https://github.com/AUTOMATIC1111/stable-diffusion-webui]), including the [ControlNet WebUI extension](https://github.com/Mikubill/sd-webui-controlnet). ControlNet models primarily works best with the SD 1.5 models at the time of writing.
Shared UI space would usually load with a model based on Stable Diffusion 1.5.
🐳 πŸ¦„ Builds a Docker image to be run as a Space at [Hugging Face](https://huggingface.co/) using A10G or T4 hardware.
### Setup on Hugging Face
1. Duplicate this space to your Hugging Face account or clone this repo to your account.
2. Under the *"Settings"* tab of your space you can choose which hardware for your space, that you will also be billed for.
3. The [`on_start.sh`](./on_start.sh) file will be run when the container is started, right before the WebUI is initiated. This is where you can install any additional extensions or models you may need. Make sure the env value `IS_SHARED_UI` is set to `0` or is unset for your space, or else only the lightweight model installation will run and some features will be disabled.
---
### Relevant links for more information
#### Repo for this builder
This repo, containing the `Dockerfile`, etc. for building the image can originally be found on both [`πŸ€— Hugging Face βž” carloscar/stable-diffusion-webui-docker`](https://huggingface.co/spaces/carloscar/stable-diffusion-webui-docker) and [`πŸ™ GitHub βž” kalaspuff/stable-diffusion-webui-docker`](https://github.com/kalaspuff/stable-diffusion-webui-docker).
#### Stable Diffusion Web UI
* Source Code: [https://github.com/AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
* Documentation: [https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki)
#### WebUI extension for ControlNet
* Source Code: [https://github.com/Mikubill/sd-webui-controlnet](https://github.com/Mikubill/sd-webui-controlnet)
#### ControlNet models
* Trained models: [https://github.com/lllyasviel/ControlNet](https://github.com/lllyasviel/ControlNet)
* Pre-extracted models: [https://huggingface.co/webui/ControlNet-modules-safetensors/tree/main](https://huggingface.co/webui/ControlNet-modules-safetensors/tree/main)
#### Licenses for using Stable Diffusion models and ControlNet models
* [https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE-MODEL](https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE-MODEL)
* [https://huggingface.co/spaces/CompVis/stable-diffusion-license](https://huggingface.co/spaces/CompVis/stable-diffusion-license)
* [https://github.com/lllyasviel/ControlNet/blob/main/LICENSE](https://github.com/lllyasviel/ControlNet/blob/main/LICENSE)
### Enable additional models (checkpoints, LoRA, VAE, etc.)
Enable the models you want to use on the bottom of the [`on_start.sh`](./on_start.sh) file. This is also the place to add any additional models you may want to install when starting your space.
```bash
## Checkpoint Β· Example:
download-model --checkpoint "FILENAME" "URL"
## LORA (low-rank adaptation) Β· Example:
download-model --lora "FILENAME" "URL"
## VAE (variational autoencoder) Β· Example:
download-model --vae "FILENAME" "URL"
```
#### Some examples of additional (optional) models
Some models such as additional checkpoints, VAE, LoRA, etc. may already be present in the [`on_start.sh`](./on_start.sh) file. You can enable them by removing the `#` in front of their respective line or disable them by removing the line or adding a leading `#` before `download-model`.
* [Checkpoint Β· Dreamlike Diffusion 1.0](https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0) ([license](https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0/blob/main/LICENSE.md))
* [Checkpoint Β· Dreamshaper 3.31](https://huggingface.co/Lykon/DreamShaper)
* [Checkpoint Β· The Ally's Mix III: Revolutions](https://civitai.com/models/10752/the-allys-mix-iii-revolutions)
* [Checkpoint Β· Deliberate v2](https://civitai.com/models/4823/deliberate)
* [Checkpoint Β· dalcefo_painting](https://civitai.com/models/5396/dalcefopainting)
* [Checkpoint Β· RPG v4](https://huggingface.co/Anashel/rpg)
* [Checkpoint Β· A to Zovya RPG Artist's Tools (1.5 & 2.1)](https://civitai.com/models/8124/a-to-zovya-rpg-artists-tools-15-and-21)
* [LoRA Β· epi_noiseoffset v2](https://civitai.com/models/13941/epinoiseoffset)
* [VAE Β· sd-vae-ft-mse-original](https://huggingface.co/stabilityai/sd-vae-ft-mse-original)
* [Embedding Β· bad_prompt_version2](https://huggingface.co/datasets/Nerfgun3/bad_prompt)
* See [https://huggingface.co/models?filter=stable-diffusion](https://huggingface.co/models?filter=stable-diffusion) and [https://civitai.com/](https://civitai.com/) for more.
Visit the individual model pages for more information on the models and their licenses.
### Extensions
* [GitHub βž” deforum-art/deforum-for-automatic1111-webui](https://github.com/deforum-art/deforum-for-automatic1111-webui)
* [GitHub βž” yfszzx/stable-diffusion-webui-images-browser](https://github.com/yfszzx/stable-diffusion-webui-images-browser)
* [GitHub βž” Vetchems/sd-civitai-browser](https://github.com/Vetchems/sd-civitai-browser)
* [GitHub βž” kohya-ss/sd-webui-additional-networks](https://github.com/kohya-ss/sd-webui-additional-networks)
* [GitHub βž” Mikubill/sd-webui-controlnet](https://github.com/Mikubill/sd-webui-controlnet)
### Additional acknowledgements
A lot of inspiration for this Docker build comes from [GitHub βž” camenduru](https://github.com/camenduru). Amazing things! πŸ™