From 7735daa0ca4feeb7e8d6af7fe442e73378038d46 Mon Sep 17 00:00:00 2001 From: AbdBarho Date: Sun, 16 Apr 2023 10:27:19 +0200 Subject: [PATCH] clean up --- docker-compose.yml | 20 ++++++-------------- services/AUTOMATIC1111/Dockerfile | 5 ++--- services/invoke/Dockerfile | 2 -- services/sygil/Dockerfile | 5 +---- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1f88163..e005e77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,11 +15,6 @@ x-base_service: &base_service device_ids: ['0'] capabilities: [gpu] -x-gpu-config: &gpu_config - security_opt: - - label=type:nvidia_container_t - runtime: nvidia - name: webui-docker services: @@ -29,25 +24,23 @@ services: volumes: - *v1 - auto-cpu: &automatic + auto: &automatic <<: *base_service - profiles: ["auto-cpu"] + profiles: ["auto"] build: ./services/AUTOMATIC1111 image: sd-auto:51 environment: - - CLI_ARGS=--no-half --precision full --allow-code --enable-insecure-extension-access --api + - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api - auto: + auto-cpu: <<: *automatic - <<: *gpu_config - profiles: ["auto"] + profiles: ["auto-cpu"] deploy: {} environment: - - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api + - CLI_ARGS=--no-half --precision full --allow-code --enable-insecure-extension-access --api invoke: <<: *base_service - <<: *gpu_config profiles: ["invoke"] build: ./services/invoke/ image: sd-invoke:26 @@ -58,7 +51,6 @@ services: sygil: &sygil <<: *base_service - <<: *gpu_config profiles: ["sygil"] build: ./services/sygil/ image: sd-sygil:16 diff --git a/services/AUTOMATIC1111/Dockerfile b/services/AUTOMATIC1111/Dockerfile index c39882e..a610d0c 100644 --- a/services/AUTOMATIC1111/Dockerfile +++ b/services/AUTOMATIC1111/Dockerfile @@ -1,5 +1,3 @@ -# syntax=docker/dockerfile:1 - FROM alpine/git:2.36.2 as download COPY clone.sh /clone.sh @@ -26,7 +24,8 @@ FROM python:3.10.9-slim ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 -RUN PIP_NO_CACHE_DIR=1 pip install torch==1.13.1+cu117 torchvision --extra-index-url https://download.pytorch.org/whl/cu117 +RUN --mount=type=cache,target=/root/.cache/pip \ + pip install torch==1.13.1+cu117 torchvision --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 diff --git a/services/invoke/Dockerfile b/services/invoke/Dockerfile index 3bf435f..b6045ab 100644 --- a/services/invoke/Dockerfile +++ b/services/invoke/Dockerfile @@ -1,5 +1,3 @@ -# syntax=docker/dockerfile:1 - FROM alpine:3.17 as xformers RUN apk add --no-cache aria2 RUN aria2c -x 5 --dir / --out wheel.whl 'https://github.com/AbdBarho/stable-diffusion-webui-docker/releases/download/5.0.0/xformers-0.0.17.dev449-cp310-cp310-manylinux2014_x86_64.whl' diff --git a/services/sygil/Dockerfile b/services/sygil/Dockerfile index dcb5d28..7ed2b5e 100644 --- a/services/sygil/Dockerfile +++ b/services/sygil/Dockerfile @@ -1,5 +1,3 @@ -# syntax=docker/dockerfile:1 - FROM python:3.8-slim ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 @@ -28,8 +26,7 @@ RUN --mount=type=cache,target=/root/.cache/pip pip install -U 'transformers>=4.2 # add info COPY . /docker/ -RUN \ - python /docker/info.py /stable-diffusion/frontend/frontend.py && \ +RUN python /docker/info.py /stable-diffusion/frontend/frontend.py && \ chmod +x /docker/mount.sh /docker/run.sh && \ # streamlit \ sed -i -- 's/8501/7860/g' /stable-diffusion/.streamlit/config.toml