Ver código fonte

Update Versions (#256)

sygil:
https://github.com/sd-webui/stable-diffusion-webui/commit/5291437085bddd16d752f811b6552419a2044d12
Also, switch to pip instead of conda because it is really slow

invoke:
https://github.com/invoke-ai/InvokeAI/commit/ed9186b09950f2652a0b07c93a08490f475435f7
AbdBarho 3 anos atrás
pai
commit
1423b274b1
3 arquivos alterados com 22 adições e 26 exclusões
  1. 3 2
      docker-compose.yml
  2. 8 6
      services/invoke/Dockerfile
  3. 11 18
      services/sygil/Dockerfile

+ 3 - 2
docker-compose.yml

@@ -42,13 +42,14 @@ services:
     <<: *base_service
     profiles: ["sygil"]
     build: ./services/sygil/
-    image: sd-sygil:12
+    image: sd-sygil:13
     environment:
       - CLI_ARGS=--optimized-turbo
       - USE_STREAMLIT=0
 
   sygil-sl:
     <<: *sygil
+    profiles: ["sygil-sl"]
     environment:
       - USE_STREAMLIT=1
 
@@ -57,7 +58,7 @@ services:
     <<: *base_service
     profiles: ["invoke"]
     build: ./services/invoke/
-    image: sd-invoke:10
+    image: sd-invoke:11
     environment:
       - PRELOAD=true
       - CLI_ARGS=

+ 8 - 6
services/invoke/Dockerfile

@@ -3,10 +3,11 @@
 FROM python:3.10-slim
 SHELL ["/bin/bash", "-ceuxo", "pipefail"]
 
-ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w  PIP_PREFER_BINARY=1 PIP_NO_CACHE_DIR=1
+ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w  PIP_PREFER_BINARY=1
 
 
-RUN pip install torch==1.12.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
+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
 
@@ -14,7 +15,7 @@ RUN git clone https://github.com/invoke-ai/InvokeAI.git /stable-diffusion
 
 WORKDIR /stable-diffusion
 
-RUN <<EOF
+RUN --mount=type=cache,target=/root/.cache/pip <<EOF
 git reset --hard 5c31feb3a1096d437c94b6e1c3224eb7a7224a85
 git config --global http.postBuffer 1048576000
 pip install -r binary_installer/py3.10-linux-x86_64-cuda-reqs.txt
@@ -32,8 +33,8 @@ cd /usr/lib/x86_64-linux-gnu/pkgconfig/
 ln -sf opencv4.pc opencv.pc
 EOF
 
-ARG BRANCH=main SHA=38cd968130e386d188bdef68f9fbfbbbfabb2da0
-RUN <<EOF
+ARG BRANCH=main SHA=ed9186b09950f2652a0b07c93a08490f475435f7
+RUN --mount=type=cache,target=/root/.cache/pip <<EOF
 git fetch
 git reset --hard
 git checkout ${BRANCH}
@@ -41,7 +42,8 @@ git reset --hard ${SHA}
 pip install -r binary_installer/py3.10-linux-x86_64-cuda-reqs.txt
 EOF
 
-RUN pip install --force-reinstall opencv-python-headless && python3 -c "from patchmatch import patch_match"
+RUN --mount=type=cache,target=/root/.cache/pip \
+  pip install --force-reinstall opencv-python-headless && python3 -c "from patchmatch import patch_match"
 
 
 COPY . /docker/

+ 11 - 18
services/sygil/Dockerfile

@@ -1,41 +1,34 @@
 # syntax=docker/dockerfile:1
 
-FROM continuumio/miniconda3:4.12.0
+FROM python:3.8-slim
 
 SHELL ["/bin/bash", "-ceuxo", "pipefail"]
 
-ENV DEBIAN_FRONTEND=noninteractive
+ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1
 
-RUN conda install python=3.8.5 && conda clean -a -y
-RUN conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch && conda clean -a -y
+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 gcc -y && apt-get clean
+RUN apt-get update && apt install gcc libsndfile1 ffmpeg build-essential zip unzip git -y && apt-get clean
 
-
-ENV PIP_PREFER_BINARY=1 PIP_NO_CACHE_DIR=1
-
-RUN <<EOF
+RUN --mount=type=cache,target=/root/.cache/pip <<EOF
 git config --global http.postBuffer 1048576000
 git clone https://github.com/Sygil-Dev/sygil-webui.git stable-diffusion
 cd stable-diffusion
-git reset --hard 091520bed06f913c9f432f9f47ccbe22b46068d7
-conda env update --file environment.yaml -n base
-conda clean -a -y
+git reset --hard 5291437085bddd16d752f811b6552419a2044d12
+pip install -r requirements.txt
 EOF
 
-RUN apt-get update && apt install libsndfile1 ffmpeg -y && apt-get clean
 
-ARG BRANCH=dev SHA=18a3b809275c395b9a2730c78d6bc0f9b06671e1
-RUN <<EOF
+ARG BRANCH=master SHA=5291437085bddd16d752f811b6552419a2044d12
+RUN --mount=type=cache,target=/root/.cache/pip <<EOF
 cd stable-diffusion
 git fetch
 git checkout ${BRANCH}
 git reset --hard ${SHA}
-conda env update --file environment.yaml -n base
-conda clean -a -y
+pip install -r requirements.txt
 EOF
 
-RUN pip install transformers==4.24.0
+RUN --mount=type=cache,target=/root/.cache/pip pip install transformers==4.24.0
 
 # add info
 COPY . /docker/