Stable Diffusion AMD - rocm Debian

Hi, there are several posts about how to install stable diffusion on AMD Cards, but just for Ubuntu and not Debian. Docker can help us there

[need review] Stable Diffusion AMD Debian ROCm

I assume you already have Docker installed

Create Stable Diffusion Folder


mkdir SD
cd SD

Clone ROCm via Docker

sudo docker pull rocm/composable_kernel:ck_ub20.04_rocm5.7

Run the Docker container

docker run --name rocm -it -v $HOME/Software/docker/sd --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --group-add video rocm/composable_kernel:ck_ub20.04_rocm5.7

Stable Diffusion WebUI and env

Make Sure you replace the paths

Clone from Git

git clone

Install Python and Python-venv

apt update && apt install python3.11-venv
cd stable-diffusion-webui
python3 -m venv venv
source venv/bin/activate

python3 -m pip install --upgrade pip wheel
export PYTORCH_ROCM_ARCH="gfx1100"
export CMAKE_PREFIX_PATH=/Software/docker/sd/stable-diffusion-webui/venv/
pip install -r requirements.txt

pip remove torch torchvision
mkdir repositories
cd repositories
tar -xzvf pytorch-v2.1.0.tar.gz && cd pytorch-v2.1.0
pip install cmake ninja
pip install -r requirements.txt
pip install mkl mkl-include
python3 tools/amd_build/

- Does not work from here -

python3 install
cd ..
tar -xzvf v0.16.0.tar.gz
cd vision-0.15.1
python3 install
cd /SD/stable-diffusion-webui
python3 --listen