This is a personal project. This means you can use it as you like, but please note that I expect nothing of you, and promise nothing to you.
This sets up stable-diffusion web UI in a docker image, with the ability to use the system's AMD GPU. It works on my system (Ubuntu 22.04.3 with ROCm 5.6 installed, and AMD RX 6700 XT) as of 2023-10-17, but perhaps not yours.
- have ROCm installed on the host machine.
- clone this repo.
- cd into the repo.
sudo docker build . -t 'stable-diffusion-webui-rocm'xhost +local: && sudo docker run --rm -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/dockerx:/dockerx -e DISPLAY=${DISPLAY} stable-diffusion-webui-rocm- inside the docker image, run
pylaunchguifor the GUI, orpylaunchapifor API only.
-
The xhost stuff is adapted from this DockerHub page.
-
Following a successful build and user test, you may wish to re-build using a newer commit than the one I hard-coded in the Dockerfile.
-
There's a lot of experimentation in finding good prompts. There are good guides, however.
-
The aspect ratio of an output image will affect its contents. The same prompt, model, and seed at 512x512 will likely result in a markedly different image to those params at 512x768, for example.
-
If you have limited VRAM, try launching with the "--medvram" or "--lowvram" parameters.
-
stable-diffusion XL models seem to require a lot of VRAM.