mirror of
https://github.com/AbdBarho/stable-diffusion-webui-docker.git
synced 2026-02-03 22:24:19 +01:00
Add ComfyUI service.
This commit is contained in:
parent
063665eae1
commit
3becc055b3
1
.github/pull_request_template.md
vendored
1
.github/pull_request_template.md
vendored
|
|
@ -11,3 +11,4 @@ Closes issue #
|
|||
- auto: https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/
|
||||
- sygil: https://github.com/Sygil-Dev/sygil-webui/commit/
|
||||
- invoke: https://github.com/invoke-ai/InvokeAI/commit/
|
||||
- comfy: https://github.com/comfyanonymous/ComfyUI/commit/
|
||||
|
|
|
|||
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
|
|
@ -16,6 +16,7 @@ jobs:
|
|||
- auto
|
||||
- sygil
|
||||
- invoke
|
||||
- comfy
|
||||
- download
|
||||
runs-on: ubuntu-latest
|
||||
name: ${{ matrix.profile }}
|
||||
|
|
|
|||
|
|
@ -63,3 +63,11 @@ services:
|
|||
profiles: ["sygil-sl"]
|
||||
environment:
|
||||
- USE_STREAMLIT=1
|
||||
|
||||
comfy: &comfy
|
||||
<<: *base_service
|
||||
profiles: ["comfy"]
|
||||
build: ./services/comfy/
|
||||
image: sd-comfy:1
|
||||
environment:
|
||||
- CLI_ARGS=
|
||||
|
|
|
|||
35
services/comfy/Dockerfile
Normal file
35
services/comfy/Dockerfile
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM python:3.10.9-slim
|
||||
|
||||
SHELL ["/bin/bash", "-ceuxo", "pipefail"]
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip pip install torch==1.13.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
|
||||
|
||||
RUN apt-get update && apt install fonts-dejavu-core rsync git jq moreutils -y && apt-get clean
|
||||
|
||||
ARG BRANCH=master SHA=ee46bef03a98903831c01d31094a0c30ea411b28
|
||||
RUN --mount=type=cache,target=/root/.cache/pip <<EOF
|
||||
git config --global http.postBuffer 1048576000
|
||||
git clone https://github.com/comfyanonymous/ComfyUI.git stable-diffusion
|
||||
cd stable-diffusion
|
||||
git checkout ${BRANCH}
|
||||
git reset --hard ${SHA}
|
||||
pip install -r requirements.txt
|
||||
EOF
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip pip install -U 'transformers>=4.24'
|
||||
|
||||
# add info
|
||||
COPY . /docker/
|
||||
RUN <<EOF
|
||||
chmod +x /docker/entrypoint.sh
|
||||
EOF
|
||||
|
||||
WORKDIR /stable-diffusion
|
||||
ENV PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
|
||||
EXPOSE 7860
|
||||
ENTRYPOINT ["/docker/entrypoint.sh"]
|
||||
CMD python -u main.py --listen --port 7860 ${CLI_ARGS}
|
||||
34
services/comfy/entrypoint.sh
Normal file
34
services/comfy/entrypoint.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
declare -A MOUNTS
|
||||
|
||||
ROOT=/stable-diffusion
|
||||
|
||||
# cache
|
||||
MOUNTS["/root/.cache"]=/data/.cache
|
||||
# ui specific
|
||||
MOUNTS["${ROOT}/models/checkpoints"]="/data/StableDiffusion"
|
||||
MOUNTS["${ROOT}/models/clip"]="/data/comfy/clip"
|
||||
MOUNTS["${ROOT}/models/clip_vision"]="/data/comfy/clip_vision"
|
||||
MOUNTS["${ROOT}/models/controlnet"]="/data/comfy/controlnet"
|
||||
MOUNTS["${ROOT}/models/embeddings"]="/data/embeddings"
|
||||
MOUNTS["${ROOT}/models/loras"]="/data/Lora"
|
||||
MOUNTS["${ROOT}/models/style_models"]="/data/comfy/style_models"
|
||||
MOUNTS["${ROOT}/models/t2i_adapter"]="/data/comfy/t2i_adapter"
|
||||
MOUNTS["${ROOT}/models/upscale_models"]="/data/comfy/upscale_models"
|
||||
MOUNTS["${ROOT}/models/vae"]="/data/VAE"
|
||||
|
||||
MOUNTS["${ROOT}/output"]="/output/comfy"
|
||||
|
||||
for to_path in "${!MOUNTS[@]}"; do
|
||||
set -Eeuo pipefail
|
||||
from_path="${MOUNTS[${to_path}]}"
|
||||
rm -rf "${to_path}"
|
||||
mkdir -p "$(dirname "${to_path}")"
|
||||
ln -sT "${from_path}" "${to_path}"
|
||||
echo Mounted $(basename "${from_path}")
|
||||
done
|
||||
|
||||
exec "$@"
|
||||
Loading…
Reference in a new issue