Sign inSign up

helmos/amd-stable-diffusion

By helmos

•Updated over 2 years ago

Ready to use Stable Diffusion WebUI Image for AMD Radeon GPUs

Image
0

628

helmos/amd-stable-diffusion repository overview

⁠Stable Diffusion with AUTOMATIC1111 WebUI for AMD GPUs

This preconfigured image provides ready to use Stable Diffusion web UI build for AMD GPUs
It has been tested with Radeon PRO W6600, but should similarily work with Radeon RX6X00 XT lineup.
The image is assembled with the following component versions:

  • Ubuntu 22.04
  • AMD ROCm 5.7
  • Python 3.10
  • Pytorch 2.0.1
  • stable-diffusion-webui v1.5.0
⁠Execution Guidelines

The following instructions are given for linux environments only
Validated on Ubuntu 22.04.3 host with Docker 24.0.7 and kernel 6.2.0-39-generic
To initialize the container for the first time:

docker run -d \
--name=amd-stable-diffusion \
--network=host \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--device=/dev/kfd \
--device=/dev/dri \
--group-add video \
--ipc=host \
--shm-size 8G \
docker.io/helmos/amd-stable-diffusion

To gracefully halt the container:

docker stop amd-stable-diffusion

For restarting the container::

docker start amd-stable-diffusion
⁠Accessing the UI

Wait a couple of seconds to let it initialize and open the following link in your browser:
http://localhost:7860⁠

⁠Building your own image

Simply create a Dockerfile with the following contents:

FROM rocm/pytorch:rocm5.7_ubuntu22.04_py3.10_pytorch_2.0.1

WORKDIR /

RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui \
 && cd stable-diffusion-webui \
 && git checkout v1.5.0 \
 && python -m pip install --upgrade pip wheel

ENV HSA_OVERRIDE_GFX_VERSION=10.3.0

WORKDIR /stable-diffusion-webui

RUN sed -i 's/pytorch_lightning/pytorch_lightning==1.6.5/g' requirements.txt \
 && echo 'fastapi==0.90.1' >> requirements.txt

RUN sed -i 's/start()/#start()/g' launch.py

RUN REQS_FILE='requirements.txt' python launch.py --skip-torch-cuda-test

RUN sed  '$ d' webui.py > foo.py \
 && echo "        initialize()" >> foo.py \
 && echo "        initialize_rest()" >> foo.py

RUN python foo.py

EXPOSE 7860

CMD python webui.py --listen --port 7860

And build a docker image with

docker build -t <user>/<image_name>:<tag> .

Tag summary

Content type

Image

Digest

sha256:1db6c583f…

Size

22.6 GB

Last updated

over 2 years ago

docker pull helmos/amd-stable-diffusion