From 5dc305607e56971bd989886a6477e5976b033ea5 Mon Sep 17 00:00:00 2001 From: lslowmotion Date: Thu, 2 May 2024 15:24:58 +0700 Subject: [PATCH] Add support for podman-compose profile - Cleaned up unnecessary compose yml - Added simple documentation - Added support for podman-compose profile Next: Stable Diffusion Web UI other than AUTOMATIC1111 support --- README.md | 31 +++++++++++++++++++--- docker-compose.yml | 53 ++++++++++++++++++++++++-------------- podman-compose.yml | 20 -------------- services/invoke/Dockerfile | 1 + 4 files changed, 63 insertions(+), 42 deletions(-) delete mode 100644 podman-compose.yml diff --git a/README.md b/README.md index 95e10c3..24f85d9 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,34 @@ -# Stable Diffusion WebUI Docker +# Stable Diffusion WebUI Podman -Run Stable Diffusion on your machine with a nice UI without any hassle! +Run Stable Diffusion on your Radeon machine with a nice UI without any hassle! + +NOTE: +- Project in progress +- Only ROCm supported for now +- CUDA support to be worked on later +- Requires podman-compose 1.1.0 or newer ## Setup & Usage -Visit the wiki for [Setup](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup) and [Usage](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Usage) instructions, checkout the [FAQ](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/FAQ) page if you face any problems, or create a new issue! +> Note: In progress (TBD) + +**Set allow container to use devices on SELinux** +``` +$ sudo setsebool -P container_use_devices=true + +``` + +**Download necessary models** +``` +$ podman-compose --profile download build +$ podman-compose --profile download up -d +``` + +**Run AUTOMATIC1111 Stable Diffusion Web UI** +``` +$ podman-compose --profile auto build +$ podman-compose --profile auto up -d +``` ## Features @@ -53,4 +77,5 @@ Special thanks to everyone behind these awesome projects, without them, none of - [ComfyUI](https://github.com/comfyanonymous/ComfyUI) - [CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion) - [Sygil-webui](https://github.com/Sygil-Dev/sygil-webui) +- [AbdBarho/stable-diffusion-webui-docker](https://github.com/AbdBarho/stable-diffusion-webui-docker) - and many many more. diff --git a/docker-compose.yml b/docker-compose.yml index 9e4d30c..698a949 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,20 @@ version: '3.9' x-base_service: &base_service ports: - "${WEBUI_PORT:-7860}:7860" + volumes: + - &v1 ./data:/data:Z + - &v2 ./output:/output:Z + # security: + # - security-opt label=disable + devices: + - /dev/dri + - /dev/kfd + ipc: + - host + # ulimit: + # - host + # cgroupns: + # - host # volumes: # - &v1 ./data:/data # - &v2 ./output:/output @@ -24,13 +38,13 @@ name: webui-docker services: download: build: ./services/download/ - # profiles: ["download"] - # volumes: - # - *v1 + profiles: ["download"] + volumes: + - *v1 auto: &automatic <<: *base_service - # profiles: ["auto"] + profiles: ["auto"] build: ./services/AUTOMATIC1111 image: sd-auto:72 environment: @@ -45,14 +59,15 @@ services: # environment: # - CLI_ARGS=--no-half --precision full --allow-code --enable-insecure-extension-access --api # - # invoke: &invoke - # <<: *base_service - # profiles: ["invoke"] - # build: ./services/invoke/ - # image: sd-invoke:30 - # environment: - # - PRELOAD=true - # - CLI_ARGS=--xformers + invoke: &invoke + <<: *base_service + profiles: ["invoke"] + build: ./services/invoke/ + image: sd-invoke:30 + environment: + - PRELOAD=true + # - CLI_ARGS=--xformers + - CLI_ARGS= # invoke-cpu: # <<: *invoke @@ -61,13 +76,13 @@ services: # - PRELOAD=true # - CLI_ARGS=--always_use_cpu - # comfy: &comfy - # <<: *base_service - # profiles: ["comfy"] - # build: ./services/comfy/ - # image: sd-comfy:6 - # environment: - # - CLI_ARGS= + comfy: &comfy + <<: *base_service + profiles: ["comfy"] + build: ./services/comfy/ + image: sd-comfy:6 + environment: + - CLI_ARGS= # # # comfy-cpu: diff --git a/podman-compose.yml b/podman-compose.yml deleted file mode 100644 index 6c035bb..0000000 --- a/podman-compose.yml +++ /dev/null @@ -1,20 +0,0 @@ -x-base_service: &base_service - volumes: - - &v1 ./data:/data - - &v2 ./output:/output - # runtime: nvidia - # security_opt: - # - label=type:nvidia_container_t - -services: - download: - volumes: - - *v1 - - auto: &automatic - <<: *base_service - devices: - - /dev/dri - - /dev/kfd - ipc: - - host diff --git a/services/invoke/Dockerfile b/services/invoke/Dockerfile index 16d8db1..4c2dfbc 100644 --- a/services/invoke/Dockerfile +++ b/services/invoke/Dockerfile @@ -24,6 +24,7 @@ WORKDIR ${ROOT} RUN --mount=type=cache,target=/root/.cache/pip,Z \ git reset --hard f3b2e02921927d9317255b1c3811f47bd40a2bf9 && \ + pip install --upgrade pip && \ pip install -e .