Skip to content

Latest commit

 

History

History
 
 

docker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Docker and compose support for Stable Diffusion web UI

This folder contains files necessary to build and run Stable Diffusion web UI as a docker container.
As for now, only the Nvidia acceleration on Linux is supported.
This docker image is intended mainly for people already familiar with docker and looking for additional security provided by container isolation, for example when running untrusted scripts or models. Additional functionality as integration with docker-gen and acme-companion for automatic access via SSL might come in handy too.

Requirements

HOWTO

  1. Make sure you have Nvidia docker runtime installed and configured properly, i.e. docker run --rm --runtime=nvidia --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi outputs the information about your GPU.
  2. Enter this very directory stable-diffusion-webui/docker.
  3. Build the container using ./build.sh or docker compose build.
  4. Run the container with ./run.sh
  5. Wait for the UI to start then open the URL displayed on the screen:
 ./run.sh
[+] Running 1/1
 ⠿ Container docker-stable-diffusion-webui-1  Started                                                                                                                                                                                                                              11.2s

Wait for the UI to start then point your browser to: http://localhost:xxxxx   <-----

To stop showing the logs precc CTRL-C
...

Further info

  1. This image uses two volumes. One is used to store ~/.cache, the other for stable-diffusion-webui/modules. The latter is mounted in the docker-compose.yml to a corresponding location inside the local path on your host. This is intended to make it easier for the user to manipulate model files.
  2. Beware though that inside container the UI is run as root. This has the implication that files written to volumes mounted to local path are owned by root! When needed you may change the ownership of existing files with sudo chown -R $UID:$GID modules.
  3. To change the command line arguments or other configuration copy the docker-compose.yml file as docker-compose.override.yml and make necessary changes there. It's the compose mechanism and this way it won't conflict with the git. The part you are looking for is at the very end of the YAML file: command: python3 launch.py --listen