commit ce324b577a31367f4208e5001cc70c2bd63b15be Author: Massaki Archambault Date: Wed Aug 2 23:18:38 2023 -0400 setup automatic1111 webui in docker container for 5700xt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8ea8d39 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.10-bullseye + +RUN useradd -ms /bin/bash -u 1000 stable-diffusion \ + && apt update \ + && apt install -y pciutils bc mesa-utils google-perftools \ + && rm -rf /var/lib/apt/lists/* + +USER stable-diffusion + +EXPOSE 7860 + +ENTRYPOINT [ "/bootstrap.sh" ] +CMD [] + +COPY bootstrap.sh /bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..4a9842c --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /shared/stable-diffusion-webui +cd /shared/stable-diffusion-webui +exec ./webui.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..735720d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3" +services: + stable-diffusion: + build: . + environment: + - HSA_OVERRIDE_GFX_VERSION=10.3.0 + - COMMANDLINE_ARGS=--precision full --no-half + network_mode: host + # for 5700xt compat + # ref: https://old.reddit.com/r/StableDiffusion/comments/ww436j/howto_stable_diffusion_on_an_amd_gpu/imcpmo8/ + devices: + - /dev/kfd + - /dev/dri + volumes: + - ./shared:/shared + working_dir: /shared + group_add: + - video + ipc: host + cap_add: + - SYS_PTRACE + security_opt: + - seccomp=unconfined \ No newline at end of file diff --git a/shared/.gitignore b/shared/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/shared/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file