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
This commit is contained in:
lslowmotion 2024-05-02 15:24:58 +07:00
parent 473672f9be
commit 5dc305607e
4 changed files with 63 additions and 42 deletions

View file

@ -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.

View file

@ -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:

View file

@ -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

View file

@ -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 .