From 821e0bc97732a12264b0d5299ef02bc4e45d7f99 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jan 2023 16:18:04 -0300 Subject: [PATCH] Are Tests --- docker-compose.yml | 58 +++++-------------- output/.gitignore | 2 - .../Dockerfile | 0 .../config.json | 0 .../entrypoint.sh | 0 .../{AUTOMATIC1111_0 => AUTOMATIC_0}/info.py | 0 .../Dockerfile | 2 +- .../config.json | 0 .../entrypoint.sh | 0 .../{AUTOMATIC1111_1 => AUTOMATIC_1}/info.py | 0 services/invoke/Dockerfile | 58 ------------------- services/invoke/entrypoint.sh | 46 --------------- services/invoke/models.yaml | 23 -------- services/sygil/Dockerfile | 46 --------------- services/sygil/info.py | 13 ----- services/sygil/mount.sh | 32 ---------- services/sygil/run.sh | 10 ---- services/sygil/userconfig_streamlit.yaml | 11 ---- 18 files changed, 14 insertions(+), 287 deletions(-) delete mode 100644 output/.gitignore rename services/{AUTOMATIC1111_0 => AUTOMATIC_0}/Dockerfile (100%) rename services/{AUTOMATIC1111_0 => AUTOMATIC_0}/config.json (100%) rename services/{AUTOMATIC1111_0 => AUTOMATIC_0}/entrypoint.sh (100%) rename services/{AUTOMATIC1111_0 => AUTOMATIC_0}/info.py (100%) rename services/{AUTOMATIC1111_1 => AUTOMATIC_1}/Dockerfile (98%) rename services/{AUTOMATIC1111_1 => AUTOMATIC_1}/config.json (100%) rename services/{AUTOMATIC1111_1 => AUTOMATIC_1}/entrypoint.sh (100%) rename services/{AUTOMATIC1111_1 => AUTOMATIC_1}/info.py (100%) delete mode 100644 services/invoke/Dockerfile delete mode 100755 services/invoke/entrypoint.sh delete mode 100644 services/invoke/models.yaml delete mode 100644 services/sygil/Dockerfile delete mode 100644 services/sygil/info.py delete mode 100755 services/sygil/mount.sh delete mode 100755 services/sygil/run.sh delete mode 100644 services/sygil/userconfig_streamlit.yaml diff --git a/docker-compose.yml b/docker-compose.yml index 18d95de..ffa2a49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,10 @@ version: '3.9' x-base_service: &base_service - ports: - - "7860:7860" - - "7861:7861" volumes: - &v1 ./data:/data - - &v2 ./output:/output - - &v3 ./output0:/output0 - - &v4 ./output1:/output1 + - &v2 ./output0:/output0 + - &v3 ./output1:/output1 deploy: resources: reservations: @@ -17,7 +13,7 @@ x-base_service: &base_service device_ids: ['0,1'] capabilities: [gpu] -name: webui-docker +name: webui-docker-multi-gpu services: download: @@ -29,47 +25,19 @@ services: auto0: &automatic0 <<: *base_service profiles: ["auto0"] - build: ./services/AUTOMATIC1111_0 - image: sd-auto0:33 + build: ./services/AUTOMATIC_0 + image: sd-auto-0:33 + ports: + - "7860:7860" environment: - - CLI_ARGS=--allow-code --xformers --enable-insecure-extension-access --api + - CLI_ARGS=--allow-code --xformers --enable-insecure-extension-access --api --device-id 0 --port 7860 auto1: &automatic1 <<: *base_service profiles: ["auto1"] - build: ./services/AUTOMATIC1111_1 - image: sd-auto1:33 + build: ./services/AUTOMATIC_1 + image: sd-auto-1:33 + ports: + - "7861:7861" environment: - - CLI_ARGS=--allow-code --xformers --enable-insecure-extension-access --api - - auto-cpu: - <<: *automatic - profiles: ["auto-cpu"] - deploy: {} - environment: - - CLI_ARGS=--no-half --precision full - - invoke: - <<: *base_service - profiles: ["invoke"] - build: ./services/invoke/ - image: sd-invoke:17 - environment: - - PRELOAD=true - - CLI_ARGS= - - - sygil: &sygil - <<: *base_service - profiles: ["sygil"] - build: ./services/sygil/ - image: sd-sygil:16 - environment: - - CLI_ARGS=--optimized-turbo - - USE_STREAMLIT=0 - - sygil-sl: - <<: *sygil - profiles: ["sygil-sl"] - environment: - - USE_STREAMLIT=1 + - CLI_ARGS=--allow-code --xformers --enable-insecure-extension-access --api --device-id 1 --port 7861 \ No newline at end of file diff --git a/output/.gitignore b/output/.gitignore deleted file mode 100644 index 11b4bb1..0000000 --- a/output/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/* -!/.gitignore \ No newline at end of file diff --git a/services/AUTOMATIC1111_0/Dockerfile b/services/AUTOMATIC_0/Dockerfile similarity index 100% rename from services/AUTOMATIC1111_0/Dockerfile rename to services/AUTOMATIC_0/Dockerfile diff --git a/services/AUTOMATIC1111_0/config.json b/services/AUTOMATIC_0/config.json similarity index 100% rename from services/AUTOMATIC1111_0/config.json rename to services/AUTOMATIC_0/config.json diff --git a/services/AUTOMATIC1111_0/entrypoint.sh b/services/AUTOMATIC_0/entrypoint.sh similarity index 100% rename from services/AUTOMATIC1111_0/entrypoint.sh rename to services/AUTOMATIC_0/entrypoint.sh diff --git a/services/AUTOMATIC1111_0/info.py b/services/AUTOMATIC_0/info.py similarity index 100% rename from services/AUTOMATIC1111_0/info.py rename to services/AUTOMATIC_0/info.py diff --git a/services/AUTOMATIC1111_1/Dockerfile b/services/AUTOMATIC_1/Dockerfile similarity index 98% rename from services/AUTOMATIC1111_1/Dockerfile rename to services/AUTOMATIC_1/Dockerfile index 093036a..edc531b 100644 --- a/services/AUTOMATIC1111_1/Dockerfile +++ b/services/AUTOMATIC_1/Dockerfile @@ -90,4 +90,4 @@ WORKDIR ${ROOT} ENV CLI_ARGS="" EXPOSE 7861 ENTRYPOINT ["/docker/entrypoint.sh"] -CMD python3 -u webui.py --listen --port 7860 ${CLI_ARGS} +CMD python3 -u webui.py --listen --port 7861 ${CLI_ARGS} \ No newline at end of file diff --git a/services/AUTOMATIC1111_1/config.json b/services/AUTOMATIC_1/config.json similarity index 100% rename from services/AUTOMATIC1111_1/config.json rename to services/AUTOMATIC_1/config.json diff --git a/services/AUTOMATIC1111_1/entrypoint.sh b/services/AUTOMATIC_1/entrypoint.sh similarity index 100% rename from services/AUTOMATIC1111_1/entrypoint.sh rename to services/AUTOMATIC_1/entrypoint.sh diff --git a/services/AUTOMATIC1111_1/info.py b/services/AUTOMATIC_1/info.py similarity index 100% rename from services/AUTOMATIC1111_1/info.py rename to services/AUTOMATIC_1/info.py diff --git a/services/invoke/Dockerfile b/services/invoke/Dockerfile deleted file mode 100644 index deee597..0000000 --- a/services/invoke/Dockerfile +++ /dev/null @@ -1,58 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM python:3.10-slim -SHELL ["/bin/bash", "-ceuxo", "pipefail"] - -ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1 - - -RUN --mount=type=cache,target=/root/.cache/pip \ - pip install torch==1.12.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 - -RUN apt-get update && apt-get install git -y && apt-get clean - -RUN git clone https://github.com/invoke-ai/InvokeAI.git /stable-diffusion - -WORKDIR /stable-diffusion - -RUN --mount=type=cache,target=/root/.cache/pip <For help and advanced usage guides,', """ -

- Created using stable-diffusion-webui-docker. -

-

For help and advanced usage guides, -""", 1) -) diff --git a/services/sygil/mount.sh b/services/sygil/mount.sh deleted file mode 100755 index cc0dc9d..0000000 --- a/services/sygil/mount.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -declare -A MOUNTS - -ROOT=/stable-diffusion/src - -# cache -MOUNTS["/root/.cache"]=/data/.cache -# ui specific -MOUNTS["${PWD}/models/realesrgan"]=/data/RealESRGAN -MOUNTS["${PWD}/models/ldsr"]=/data/LDSR -MOUNTS["${PWD}/models/custom"]=/data/StableDiffusion - -# hack -MOUNTS["${PWD}/models/gfpgan/GFPGANv1.3.pth"]=/data/GFPGAN/GFPGANv1.4.pth -MOUNTS["${PWD}/models/gfpgan/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth -MOUNTS["${PWD}/gfpgan/weights"]=/data/.cache - - -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 - -# streamlit config -ln -sf /docker/userconfig_streamlit.yaml /stable-diffusion/configs/webui/userconfig_streamlit.yaml diff --git a/services/sygil/run.sh b/services/sygil/run.sh deleted file mode 100755 index 89f7959..0000000 --- a/services/sygil/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -echo "USE_STREAMLIT = ${USE_STREAMLIT}" -if [ "${USE_STREAMLIT}" == "1" ]; then - python -u -m streamlit run scripts/webui_streamlit.py -else - python3 -u scripts/webui.py --outdir /output --ckpt /data/StableDiffusion/v1-5-pruned-emaonly.ckpt ${CLI_ARGS} -fi diff --git a/services/sygil/userconfig_streamlit.yaml b/services/sygil/userconfig_streamlit.yaml deleted file mode 100644 index 07a20af..0000000 --- a/services/sygil/userconfig_streamlit.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# https://github.com/Sygil-Dev/sygil-webui/blob/master/configs/webui/webui_streamlit.yaml -general: - version: 1.24.6 - outdir: /output - default_model: "Stable Diffusion v1.5" - default_model_path: /data/StableDiffusion/v1-5-pruned-emaonly.ckpt - outdir_txt2img: /output/txt2img - outdir_img2img: /output/img2img - outdir_img2txt: /output/img2txt - optimized: True - optimized_turbo: True