Stable Diffusion: Installation with web UI

Base installation on host

Make sure you have Git and a compatible Python version (currently 3.10) installed and available in your path. Open a command prompt and execute the command below in a directory of your choice. Note that this will create a subdirectory called stable-diffusion-webui.

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

Download a model

Stable diffusion needs a model to work. You can download any model from https://huggingface.co/ or https://civitai.com/ (NSFW warning), but you typically start with the 1.5 base model. From the stable-diffusion-webui directory, run following commands…

cd models\Stable-diffusion
wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors

Warning: Models can contain executable code. Only download models from sources you trust, and check the hash if available. Use safetensors as the preferred format; these files can still contain malicious code, but only if the original author put it in – they cannot be tempered with afterwards.

Check model hash

Most popular model sites show the hash of the model file you are downloading. This hash is typically SHA256 and you can retrieve all hashes of your models with a single command, executed from your SD model directory

Powershell "Get-ChildItem -File | Get-FileHash"

Startup

Navigate to the directory where stable-diffusion-webui was installed and run either webui.bat or webui.sh. All requirements will be installed automatically after which the GUI will be available at address http://127.0.0.1:7861

There are a number of parameters you can add to either webui-user.bat or webui-user.sh. An overview of settings I used can be found here.

Command line extension installation

Extension can be installed from the Automatic1111 web UI, but they can also be (pre)installed from the command line. This is especially useful when installing to a Docker container or https://colab.research.google.com/. As an example run following commands:

cd extensions
git clone https://github.com/d8ahazard/sd_dreambooth_extension
git clone https://github.com/tkalayci71/embedding-inspector.git
git clone https://github.com/AlUlkesh/sd_save_intermediate_images
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git

Install and run as a Docker container

TBD

Update

Update the latest version of either the base install or one of the extensions by running git pull in the applicable directory.

git pull && cd extensions && for /f "delims=" %a in ('dir /ad/b') do @cd "%a" && git pull &&  cd ..

Leave Comment

Your email address will not be published. Required fields are marked *