From 4acf8e4402be55165babca7a2644ac6d551634f3 Mon Sep 17 00:00:00 2001 From: Tom Langan Date: Sun, 29 Oct 2023 01:07:40 +0000 Subject: [PATCH] initial checkin of server stuff --- docker-compose.yml | 8 +++++--- services/AUTOMATIC1111/Dockerfile | 33 ++++++++++++++++++++----------- services/download/download.sh | 10 +--------- services/download/links.txt | 20 ++++--------------- 4 files changed, 31 insertions(+), 40 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3f81ee2..ab0a0c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,18 +2,19 @@ version: '3.9' x-base_service: &base_service ports: - - "${WEBUI_PORT:-7860}:7860" + - "${WEBUI_PORT:-7880}:7880" volumes: - &v1 ./data:/data - &v2 ./output:/output stop_signal: SIGKILL + restart: always tty: true deploy: resources: reservations: devices: - driver: nvidia - device_ids: ['0'] + device_ids: ["0"] capabilities: [compute, utility] name: webui-docker @@ -30,8 +31,9 @@ services: profiles: ["auto"] build: ./services/AUTOMATIC1111 image: sd-auto:63 + restart: always environment: - - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api + - CLI_ARGS=--allow-code --medvram --enable-insecure-extension-access --xformers --api --listen --port 7880 --ckpt models/Stable-diffusion/sd_xl_base_1.0.safetensors auto-cpu: <<: *automatic diff --git a/services/AUTOMATIC1111/Dockerfile b/services/AUTOMATIC1111/Dockerfile index abca84f..3500601 100644 --- a/services/AUTOMATIC1111/Dockerfile +++ b/services/AUTOMATIC1111/Dockerfile @@ -44,9 +44,15 @@ RUN --mount=type=cache,target=/cache --mount=type=cache,target=/root/.cache/pip RUN --mount=type=cache,target=/root/.cache/pip \ git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git && \ cd stable-diffusion-webui && \ - git reset --hard 20ae71faa8ef035c31aa3a410b707d792c8203a3 && \ + git switch dev && \ + git pull && \ + git fetch && \ pip install -r requirements_versions.txt + +# git reset --hard 20ae71faa8ef035c31aa3a410b707d792c8203a3 && \ +# pip install -r requirements_versions.txt + RUN --mount=type=cache,target=/root/.cache/pip \ --mount=type=bind,from=xformers,source=/wheel.whl,target=/xformers-0.0.21.dev544-cp310-cp310-manylinux2014_x86_64.whl \ pip install /xformers-0.0.21.dev544-cp310-cp310-manylinux2014_x86_64.whl @@ -61,9 +67,12 @@ RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \ pip install pyngrok \ - git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \ - git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \ - git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b + git+https://github.com/openai/CLIP.git \ + git+https://github.com/TencentARC/GFPGAN.git + +# git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \ +# git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \ +# git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b # Note: don't update the sha of previous versions because the install will take forever # instead, update the repo state in a later step @@ -72,12 +81,12 @@ RUN --mount=type=cache,target=/root/.cache/pip \ RUN apt-get -y install libgoogle-perftools-dev && apt-get clean ENV LD_PRELOAD=libtcmalloc.so -ARG SHA=68f336bd994bed5442ad95bad6b6ad5564a5409a -RUN --mount=type=cache,target=/root/.cache/pip \ - cd stable-diffusion-webui && \ - git fetch && \ - git reset --hard ${SHA} && \ - pip install -r requirements_versions.txt +#ARG SHA=68f336bd994bed5442ad95bad6b6ad5564a5409a +#RUN --mount=type=cache,target=/root/.cache/pip \ +# cd stable-diffusion-webui && \ +# git fetch && \ +# git reset --hard ${SHA} && \ +# pip install -r requirements_versions.txt COPY . /docker @@ -91,6 +100,6 @@ RUN \ WORKDIR ${ROOT} ENV NVIDIA_VISIBLE_DEVICES=all ENV CLI_ARGS="" -EXPOSE 7860 +EXPOSE 7880 ENTRYPOINT ["/docker/entrypoint.sh"] -CMD python -u webui.py --listen --port 7860 ${CLI_ARGS} +CMD python -u webui.py ${CLI_ARGS} diff --git a/services/download/download.sh b/services/download/download.sh index fbe5a70..13bddd9 100755 --- a/services/download/download.sh +++ b/services/download/download.sh @@ -17,15 +17,7 @@ echo "Downloading, this might take a while..." aria2c -x 10 --disable-ipv6 --input-file /docker/links.txt --dir /data/models --continue -echo "Checking SHAs..." - -parallel --will-cite -a /docker/checksums.sha256 "echo -n {} | sha256sum -c" cat <