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.
- A docker of course.
- Nvidia docker runtime.
- 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. - Enter this very directory
stable-diffusion-webui/docker
. - Build the container using
./build.sh
ordocker compose build
. - Run the container with
./run.sh
- 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
...
- This image uses two volumes. One is used to store
~/.cache
, the other forstable-diffusion-webui/modules
. The latter is mounted in thedocker-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. - 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
. - To change the command line arguments or other configuration copy the
docker-compose.yml
file asdocker-compose.override.yml
and make necessary changes there. It's thecompose
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