From b78d718357615cca8be3ca66414561fe731e2bbc Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 20:41:04 +0200 Subject: [PATCH 01/32] use propper bearer authentication to dwnload model instead of --user username:token --- .github/workflows/create-caches.yml | 3 ++- .github/workflows/test-invoke-conda.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-caches.yml b/.github/workflows/create-caches.yml index 33ea3b82ed..23d17b1711 100644 --- a/.github/workflows/create-caches.yml +++ b/.github/workflows/create-caches.yml @@ -54,7 +54,8 @@ jobs: [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 [[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \ - || curl --user "${{ secrets.HUGGINGFACE_TOKEN }}" \ + || curl \ + -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ -o models/ldm/stable-diffusion-v1/model.ckpt \ -O -L https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 65e3e4e1e2..36624924b9 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -71,7 +71,8 @@ jobs: [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 [[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \ - || curl --user "${{ secrets.HUGGINGFACE_TOKEN }}" \ + || curl \ + -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ -o models/ldm/stable-diffusion-v1/model.ckpt \ -O -L ${{ matrix.stable-diffusion-model }} From 4a9209c5e8117bdbb977ac1c9b02cc7693b0ab13 Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 20:42:14 +0200 Subject: [PATCH 02/32] add debug branch to trigger run --- .github/workflows/test-invoke-conda.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 36624924b9..61b6ef9556 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -4,6 +4,7 @@ on: branches: - 'main' - 'development' + - 'use-bearer-token-to-download-model-debug' pull_request_target: branches: - 'main' From 2ac3c9e8fdd325d2953ba293d74c6ab0ef6d56bd Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 20:58:18 +0200 Subject: [PATCH 03/32] remove -O from curl arguments --- .github/workflows/create-caches.yml | 2 +- .github/workflows/test-invoke-conda.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-caches.yml b/.github/workflows/create-caches.yml index 23d17b1711..946025d78b 100644 --- a/.github/workflows/create-caches.yml +++ b/.github/workflows/create-caches.yml @@ -57,7 +57,7 @@ jobs: || curl \ -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ -o models/ldm/stable-diffusion-v1/model.ckpt \ - -O -L https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt + -L https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 61b6ef9556..2eab666d28 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -75,7 +75,7 @@ jobs: || curl \ -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ -o models/ldm/stable-diffusion-v1/model.ckpt \ - -O -L ${{ matrix.stable-diffusion-model }} + -L ${{ matrix.stable-diffusion-model }} - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 From 9f16ff1774900bcb12f3e22ccccff059da47c304 Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 21:01:06 +0200 Subject: [PATCH 04/32] remove cache for debugging --- .github/workflows/test-invoke-conda.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 2eab666d28..369d2cd596 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -56,16 +56,6 @@ jobs: - name: set conda environment name run: echo "CONDA_ENV_NAME=invokeai" >> $GITHUB_ENV - - name: Use Cached Stable Diffusion v1.4 Model - id: cache-sd-v1-4 - uses: actions/cache@v3 - env: - cache-name: cache-sd-${{ matrix.stable-diffusion-model }} - with: - path: models/ldm/stable-diffusion-v1/model.ckpt - key: ${{ env.cache-name }} - restore-keys: ${{ env.cache-name }} - - name: Download Stable Diffusion v1.4 Model if: ${{ steps.cache-sd-v1-4.outputs.cache-hit != 'true' }} run: | From 94253892400f18f09998a79b289bc21e39189c2c Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 21:07:59 +0200 Subject: [PATCH 05/32] prop. integrate stable-diffusion-model into matrix --- .github/workflows/test-invoke-conda.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 369d2cd596..3368e61795 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -15,16 +15,18 @@ jobs: strategy: fail-fast: false matrix: + stable-diffusion-model: + [ + https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt, + ] os: [ubuntu-latest, macos-latest] include: - os: ubuntu-latest environment-file: environment.yml default-shell: bash -l {0} - stable-diffusion-model: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt - os: macos-latest environment-file: environment-mac.yml default-shell: bash -l {0} - stable-diffusion-model: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt name: Test invoke.py on ${{ matrix.os }} with conda runs-on: ${{ matrix.os }} defaults: From 1ca1ab594c29cf20dcf5faa8a5bb9e11522215d6 Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 21:11:18 +0200 Subject: [PATCH 06/32] fix matrix --- .github/workflows/test-invoke-conda.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 3368e61795..f2259b3299 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -15,10 +15,7 @@ jobs: strategy: fail-fast: false matrix: - stable-diffusion-model: - [ - https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt, - ] + stable-diffusion-model: ['https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt'] os: [ubuntu-latest, macos-latest] include: - os: ubuntu-latest From 0d3a931e88961bec8b5c129b56192a5d7656e9a9 Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 23:11:07 +0200 Subject: [PATCH 07/32] update mac environment use conda packages where possible as mentioned in conda docs https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-non-conda-packages --- environment-mac.yml | 76 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index 16fcccb67f..0ccf7baaee 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -3,57 +3,57 @@ channels: - pytorch - conda-forge dependencies: - - python==3.9.13 - - pip==22.2.2 + - python=3.9.13 + - pip=22.2.2 # pytorch left unpinned - - pytorch==1.12.1 - - torchvision==0.13.1 + - pytorch=1.12.1 + - torchvision=0.13.1 # I suggest to keep the other deps sorted for convenience. # To determine what the latest versions should be, run: # # ```shell - # sed -E 's/ldm/ldm-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml - # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n ldm-updated | awk ' {print " - " $1 "==" $2;} ' + # sed -E 's/invokeai/invokeai-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml + # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n invokeai-updated | awk ' {print " - " $1 "==" $2;} ' # ``` - - albumentations==1.2.1 - - coloredlogs==15.0.1 - - diffusers==0.6.0 - - einops==0.4.1 - - grpcio==1.46.4 - - humanfriendly==10.0 - - imageio==2.21.2 - - imageio-ffmpeg==0.4.7 - - imgaug==0.4.0 - - kornia==0.6.7 - - mpmath==1.2.1 + - albumentations=1.2.1 + - coloredlogs=15.0.1 + - diffusers=0.6.0 + - einops=0.4.1 + - grpcio=1.46.4 + - humanfriendly=10.0 + - imageio=2.21.2 + - imageio-ffmpeg=0.4.7 + - imgaug=0.4.0 + - kornia=0.6.7 + - mpmath=1.2.1 - nomkl=1.0 - - numpy==1.23.2 - - omegaconf==2.1.1 - - openh264==2.3.0 - - onnx==1.12.0 - - onnxruntime==1.12.1 - - pudb==2022.1 - - pytorch-lightning==1.7.5 - - scipy==1.9.1 - - streamlit==1.12.2 - - sympy==1.10.1 - - tensorboard==2.10.0 - - torchmetrics==0.9.3 + - numpy=1.23.* + - omegaconf=2.1.1 + - openh264=2.3.0 + - onnx=1.12.0 + - onnxruntime=1.12.1 + - pudb=2022.1 + - pytorch-lightning=1.7.7 + - scipy=1.9.1 + - streamlit=1.12.2 + - sympy=1.10.1 + - tensorboard=2.10.0 + - torchmetrics=0.9.3 + - opencv=4.6.* + - flask=2.1.3 + - flask-socketio=5.3.0 + - flask_cors=3.0.10 + - eventlet=0.33.1 + - protobuf=3.20.* + - send2trash=1.8.0 + - transformers=4.23.* + - torch-fidelity=0.3.0 - pip: - - flask==2.1.3 - - flask_socketio==5.3.0 - - flask_cors==3.0.10 - dependency_injector==4.40.0 - - eventlet==0.33.1 - - opencv-python==4.6.0 - - protobuf==3.19.6 - realesrgan==0.2.5.0 - - send2trash==1.8.0 - test-tube==0.7.5 - - transformers==4.21.3 - - torch-fidelity==0.3.0 - -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers - -e git+https://github.com/openai/CLIP.git@main#egg=clip - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion From 7138faf5d3fca8dc8ecb5aef92639024d6e3a34c Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 23:51:17 +0200 Subject: [PATCH 08/32] include stable-diffusion-model in job name --- .github/workflows/test-invoke-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index f2259b3299..5d23f1f5b2 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -24,7 +24,7 @@ jobs: - os: macos-latest environment-file: environment-mac.yml default-shell: bash -l {0} - name: Test invoke.py on ${{ matrix.os }} with conda + name: Test invoke.py on ${{ matrix.os }} with ${{ matrix.stable-diffusion-model }} runs-on: ${{ matrix.os }} defaults: run: From 6c34b89cfb70f5711643ff087e14fdf45015e5ce Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 23:51:43 +0200 Subject: [PATCH 09/32] loosen pytorch and torchvision version --- environment-mac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index 0ccf7baaee..662c89d928 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -7,8 +7,8 @@ dependencies: - pip=22.2.2 # pytorch left unpinned - - pytorch=1.12.1 - - torchvision=0.13.1 + - pytorch=1.12.* + - torchvision=0.13.* # I suggest to keep the other deps sorted for convenience. # To determine what the latest versions should be, run: From f7a47c1b6758e0e1201b4e60a4195952a25d860a Mon Sep 17 00:00:00 2001 From: mauwii Date: Fri, 28 Oct 2022 23:56:13 +0200 Subject: [PATCH 10/32] reenable caching of sd model --- .github/workflows/test-invoke-conda.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 5d23f1f5b2..ca1f2e00d8 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -55,6 +55,16 @@ jobs: - name: set conda environment name run: echo "CONDA_ENV_NAME=invokeai" >> $GITHUB_ENV + - name: Use Cached Stable Diffusion Model + id: cache-stable-diffusion-model + uses: actions/cache@v3 + env: + cache-name: cache-sd-${{ matrix.stable-diffusion-model }} + with: + path: models/ldm/stable-diffusion-v1/model.ckpt + key: ${{ env.cache-name }} + restore-keys: ${{ env.cache-name }} + - name: Download Stable Diffusion v1.4 Model if: ${{ steps.cache-sd-v1-4.outputs.cache-hit != 'true' }} run: | From 78f7094a0b55f613733a89a1843f4821aed45096 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 01:24:38 +0200 Subject: [PATCH 11/32] set torchmetrics >=0.7.0 and use py-opencv=4.6.0 --- environment-mac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index 662c89d928..4d22c6920d 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -40,8 +40,8 @@ dependencies: - streamlit=1.12.2 - sympy=1.10.1 - tensorboard=2.10.0 - - torchmetrics=0.9.3 - - opencv=4.6.* + - torchmetrics>=0.7.0 + - py-opencv=4.6.0 - flask=2.1.3 - flask-socketio=5.3.0 - flask_cors=3.0.10 From da33e038ca6c7600a304be580198acb741d96ff8 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 02:06:33 +0200 Subject: [PATCH 12/32] unpin pytorch / torchvision also loosen verisons of scipy flask-socketio flask_cors --- environment-mac.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index 4d22c6920d..52dff7ab40 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -7,8 +7,8 @@ dependencies: - pip=22.2.2 # pytorch left unpinned - - pytorch=1.12.* - - torchvision=0.13.* + - pytorch + - torchvision # I suggest to keep the other deps sorted for convenience. # To determine what the latest versions should be, run: @@ -36,15 +36,15 @@ dependencies: - onnxruntime=1.12.1 - pudb=2022.1 - pytorch-lightning=1.7.7 - - scipy=1.9.1 + - scipy=1.9.* - streamlit=1.12.2 - sympy=1.10.1 - tensorboard=2.10.0 - torchmetrics>=0.7.0 - py-opencv=4.6.0 - flask=2.1.3 - - flask-socketio=5.3.0 - - flask_cors=3.0.10 + - flask-socketio=5.3.* + - flask_cors=3.0.* - eventlet=0.33.1 - protobuf=3.20.* - send2trash=1.8.0 From aa0165767897b95ac353890fbac233bb41def095 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 02:43:52 +0200 Subject: [PATCH 13/32] very fast on m1, synced with output of main branch --- environment-mac.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index 52dff7ab40..a3f64cad30 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -7,8 +7,8 @@ dependencies: - pip=22.2.2 # pytorch left unpinned - - pytorch - - torchvision + - pytorch=1.12.1 + - torchvision=0.13.1 # I suggest to keep the other deps sorted for convenience. # To determine what the latest versions should be, run: @@ -28,27 +28,27 @@ dependencies: - imgaug=0.4.0 - kornia=0.6.7 - mpmath=1.2.1 - - nomkl=1.0 - - numpy=1.23.* + - nomkl + - numpy=1.23.4 - omegaconf=2.1.1 - openh264=2.3.0 - onnx=1.12.0 - onnxruntime=1.12.1 - pudb=2022.1 - pytorch-lightning=1.7.7 - - scipy=1.9.* + - scipy=1.9.3 - streamlit=1.12.2 - sympy=1.10.1 - tensorboard=2.10.0 - torchmetrics>=0.7.0 - py-opencv=4.6.0 - flask=2.1.3 - - flask-socketio=5.3.* - - flask_cors=3.0.* + - flask-socketio=5.3.0 + - flask-cors=3.0.10 - eventlet=0.33.1 - - protobuf=3.20.* + - protobuf>=3.19 - send2trash=1.8.0 - - transformers=4.23.* + - transformers>=4.21.3 - torch-fidelity=0.3.0 - pip: - dependency_injector==4.40.0 From 31ef15210d49389e8eab449b6714d79a259a8e39 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 03:21:26 +0200 Subject: [PATCH 14/32] pin versions corelating between arm64 and x64 --- environment-mac.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index a3f64cad30..1f29733d93 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -28,7 +28,7 @@ dependencies: - imgaug=0.4.0 - kornia=0.6.7 - mpmath=1.2.1 - - nomkl + - nomkl # arm64 has only 1.0 while x64 has 3.0 - numpy=1.23.4 - omegaconf=2.1.1 - openh264=2.3.0 @@ -40,15 +40,15 @@ dependencies: - streamlit=1.12.2 - sympy=1.10.1 - tensorboard=2.10.0 - - torchmetrics>=0.7.0 + - torchmetrics=0.10.1 - py-opencv=4.6.0 - flask=2.1.3 - flask-socketio=5.3.0 - flask-cors=3.0.10 - eventlet=0.33.1 - - protobuf>=3.19 + - protobuf=3.20.1 - send2trash=1.8.0 - - transformers>=4.21.3 + - transformers=4.23.1 - torch-fidelity=0.3.0 - pip: - dependency_injector==4.40.0 From da5fd10bb9ac17e44949f7e6ae13fd070d6f253c Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 03:34:12 +0200 Subject: [PATCH 15/32] pin nomkl --- environment-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment-mac.yml b/environment-mac.yml index 1f29733d93..27d62a967d 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -28,7 +28,7 @@ dependencies: - imgaug=0.4.0 - kornia=0.6.7 - mpmath=1.2.1 - - nomkl # arm64 has only 1.0 while x64 has 3.0 + - nomkl=1.0 - numpy=1.23.4 - omegaconf=2.1.1 - openh264=2.3.0 From 3ab3a7d37af6ab95a9feafe111490379132db005 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 04:01:44 +0200 Subject: [PATCH 16/32] use same environment-mac.yml as in #1289 --- environment-mac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment-mac.yml b/environment-mac.yml index 27d62a967d..ea083185a1 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -6,7 +6,6 @@ dependencies: - python=3.9.13 - pip=22.2.2 - # pytorch left unpinned - pytorch=1.12.1 - torchvision=0.13.1 @@ -17,6 +16,7 @@ dependencies: # sed -E 's/invokeai/invokeai-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n invokeai-updated | awk ' {print " - " $1 "==" $2;} ' # ``` + - albumentations=1.2.1 - coloredlogs=15.0.1 - diffusers=0.6.0 @@ -28,7 +28,7 @@ dependencies: - imgaug=0.4.0 - kornia=0.6.7 - mpmath=1.2.1 - - nomkl=1.0 + - nomkl # arm64 has only 1.0 while x64 needs 3.0 - numpy=1.23.4 - omegaconf=2.1.1 - openh264=2.3.0 From b7fcf6dc048df0505f584f126a3eba734a00448c Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 04:49:43 +0200 Subject: [PATCH 17/32] readd conda env cache --- .github/workflows/test-invoke-conda.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index ca1f2e00d8..468ce85d79 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -76,6 +76,13 @@ jobs: -o models/ldm/stable-diffusion-v1/model.ckpt \ -L ${{ matrix.stable-diffusion-model }} + - name: Cache Conda env + uses: actions/cache@v2 + with: + path: ${{ env.CONDA }}/envs + key: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('${{ matrix.environment-file }}') }} + id: cache-conda-pkgs + - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 with: From 0a89d350d9fb95951d7c3953a96b0e800b552429 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 04:54:01 +0200 Subject: [PATCH 18/32] update conda cache to use actions/cache@v3 --- .github/workflows/test-invoke-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 468ce85d79..2441438960 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -77,7 +77,7 @@ jobs: -L ${{ matrix.stable-diffusion-model }} - name: Cache Conda env - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ env.CONDA }}/envs key: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('${{ matrix.environment-file }}') }} From bd3ba596c28ab80b3d6647d3d13c48f9b2f5b456 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 04:58:10 +0200 Subject: [PATCH 19/32] fix hashFiles function --- .github/workflows/test-invoke-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 2441438960..c8e9881f4a 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -80,7 +80,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ env.CONDA }}/envs - key: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('${{ matrix.environment-file }}') }} + key: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles(matrix.environment-file) }} id: cache-conda-pkgs - name: Activate Conda Env From ea6565088337be340d59d7682b336c4040fb4a82 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 05:49:12 +0200 Subject: [PATCH 20/32] add conda pkgs cache, remove conda env cache also directly setup correct conda env --- .github/workflows/test-invoke-conda.yml | 30 +++++++++---------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index c8e9881f4a..b7cca63726 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -26,6 +26,8 @@ jobs: default-shell: bash -l {0} name: Test invoke.py on ${{ matrix.os }} with ${{ matrix.stable-diffusion-model }} runs-on: ${{ matrix.os }} + env: + CONDA_ENV_NAME: invokeai defaults: run: shell: ${{ matrix.default-shell }} @@ -33,11 +35,17 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - - name: setup miniconda + - name: Cache conda packages + uses: actions/cache@v3 + with: + path: ~/conda_pkgs_dir + key: conda-pkgs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles(matrix.environment-file) }} + + - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 with: - auto-activate-base: false - auto-update-conda: false + activate-environment: ${{ env.CONDA_ENV_NAME }} + environment-file: ${{ matrix.environment-file }} miniconda-version: latest - name: set test prompt to main branch validation @@ -52,9 +60,6 @@ jobs: if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV - - name: set conda environment name - run: echo "CONDA_ENV_NAME=invokeai" >> $GITHUB_ENV - - name: Use Cached Stable Diffusion Model id: cache-stable-diffusion-model uses: actions/cache@v3 @@ -76,19 +81,6 @@ jobs: -o models/ldm/stable-diffusion-v1/model.ckpt \ -L ${{ matrix.stable-diffusion-model }} - - name: Cache Conda env - uses: actions/cache@v3 - with: - path: ${{ env.CONDA }}/envs - key: conda-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles(matrix.environment-file) }} - id: cache-conda-pkgs - - - name: Activate Conda Env - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: ${{ env.CONDA_ENV_NAME }} - environment-file: ${{ matrix.environment-file }} - - name: Use Cached Huggingface and Torch models id: cache-hugginface-torch uses: actions/cache@v3 From 63202e2467c34cd567c9c0325476150a453bc884 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 07:25:19 +0200 Subject: [PATCH 21/32] try to run matrix with different models --- .github/workflows/test-invoke-conda.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index b7cca63726..4b85432fca 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -11,12 +11,16 @@ on: - 'development' jobs: - os_matrix: + matrix: strategy: fail-fast: false matrix: - stable-diffusion-model: ['https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt'] - os: [ubuntu-latest, macos-latest] + stable-diffusion-model: + - 'https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt' + - 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt' + os: + - ubuntu-latest + - macos-latest include: - os: ubuntu-latest environment-file: environment.yml @@ -24,6 +28,12 @@ jobs: - os: macos-latest environment-file: environment-mac.yml default-shell: bash -l {0} + - stable-diffusion-model: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt + stable-diffusion-model-dl-path: models/ldm/stable-diffusion-v1/model.ckpt + stable-diffusion-model-switch: stable-diffusion-1.4 + - stable-diffusion-model: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt + stable-diffusion-model-dl-path: models/ldm/stable-diffusion-v1/v1-5-pruned-emaonly.ckpt + stable-diffusion-model-switch: stable-diffusion-1.5 name: Test invoke.py on ${{ matrix.os }} with ${{ matrix.stable-diffusion-model }} runs-on: ${{ matrix.os }} env: @@ -78,7 +88,7 @@ jobs: [[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \ || curl \ -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ - -o models/ldm/stable-diffusion-v1/model.ckpt \ + -o ${{ matrix.stable-diffusion-model-dl-path }} \ -L ${{ matrix.stable-diffusion-model }} - name: Use Cached Huggingface and Torch models @@ -97,8 +107,10 @@ jobs: - name: Run the tests run: | + echo "!switch ${{ matrix.stable-diffusion-model-switch }}" > testprompts.txt + cat ${{ env.TEST_PROMPTS }} >> testprompts.txt time python scripts/invoke.py \ - --from_file ${{ env.TEST_PROMPTS }} + --from_file testprompts.txt - name: export conda env run: | From d2e8ecbd4b46f34cf680642e473935e295e47f49 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 07:35:43 +0200 Subject: [PATCH 22/32] fix missing matrix-parameters --- .github/workflows/test-invoke-conda.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 4b85432fca..ced356a8d7 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -76,20 +76,19 @@ jobs: env: cache-name: cache-sd-${{ matrix.stable-diffusion-model }} with: - path: models/ldm/stable-diffusion-v1/model.ckpt + path: ${{ matrix.stable-diffusion-model-dl-path }} key: ${{ env.cache-name }} restore-keys: ${{ env.cache-name }} - - name: Download Stable Diffusion v1.4 Model + - name: Download ${{ matrix.stable-diffusion-model-switch }} if: ${{ steps.cache-sd-v1-4.outputs.cache-hit != 'true' }} run: | [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 - [[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \ - || curl \ - -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ - -o ${{ matrix.stable-diffusion-model-dl-path }} \ - -L ${{ matrix.stable-diffusion-model }} + curl \ + -H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ + -o ${{ matrix.stable-diffusion-model-dl-path }} \ + -L ${{ matrix.stable-diffusion-model }} - name: Use Cached Huggingface and Torch models id: cache-hugginface-torch From e5d0c9c224a71aecb4b5add61244d62e941ef3e3 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 08:08:15 +0200 Subject: [PATCH 23/32] include sd-switch in artifact name --- .github/workflows/test-invoke-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index ced356a8d7..d55fc2d8fd 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -119,5 +119,5 @@ jobs: - name: Archive results uses: actions/upload-artifact@v3 with: - name: results_${{ matrix.os }} + name: results_${{ matrix.os }}_${{ matrix.stable-diffusion-model-switch }} path: outputs/img-samples From 85b5fcd5e1a2bc8cdd359dabd449e6788fa88fbc Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 08:28:17 +0200 Subject: [PATCH 24/32] fix cache hit expression in download sd-model step - also update sd-cache display name to include current model --- .github/workflows/test-invoke-conda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index d55fc2d8fd..6f294c85a6 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -70,7 +70,7 @@ jobs: if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV - - name: Use Cached Stable Diffusion Model + - name: Use Cached ${{ matrix.stable-diffusion-model-switch }} id: cache-stable-diffusion-model uses: actions/cache@v3 env: @@ -81,7 +81,7 @@ jobs: restore-keys: ${{ env.cache-name }} - name: Download ${{ matrix.stable-diffusion-model-switch }} - if: ${{ steps.cache-sd-v1-4.outputs.cache-hit != 'true' }} + if: ${{ steps.cache-stable-diffusion-model.outputs.cache-hit != 'true' }} run: | [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 From e7aeaa310c8ff80b7e54faff4896c5207f2701fd Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 08:39:28 +0200 Subject: [PATCH 25/32] run without preload_models.py since an upcoming update makes it interactive --- .github/workflows/test-invoke-conda.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 6f294c85a6..c1505d30a5 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -90,19 +90,19 @@ jobs: -o ${{ matrix.stable-diffusion-model-dl-path }} \ -L ${{ matrix.stable-diffusion-model }} - - name: Use Cached Huggingface and Torch models - id: cache-hugginface-torch - uses: actions/cache@v3 - env: - cache-name: cache-hugginface-torch - with: - path: ~/.cache - key: ${{ env.cache-name }} - restore-keys: | - ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} + # - name: Use Cached Huggingface and Torch models + # id: cache-hugginface-torch + # uses: actions/cache@v3 + # env: + # cache-name: cache-hugginface-torch + # with: + # path: ~/.cache + # key: ${{ env.cache-name }} + # restore-keys: | + # ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} - - name: run preload_models.py - run: python scripts/preload_models.py + # - name: run preload_models.py + # run: python scripts/preload_models.py - name: Run the tests run: | From fc4d07f198a88840cb4df8eef74662d122740114 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 08:59:23 +0200 Subject: [PATCH 26/32] reenable preload models, move huggingface-cache... ... on top of conda env activation, since `~/.cache` also contains pip --- .github/workflows/test-invoke-conda.yml | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index c1505d30a5..43b294b4ab 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -45,12 +45,23 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - - name: Cache conda packages + - name: Use cached conda packages uses: actions/cache@v3 with: path: ~/conda_pkgs_dir key: conda-pkgs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles(matrix.environment-file) }} + - name: Use Cached Huggingface and Torch models + id: cache-hugginface-torch + uses: actions/cache@v3 + env: + cache-name: cache-hugginface-and-torch-models + with: + path: ~/.cache + key: ${{ env.cache-name }} + restore-keys: | + ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} + - name: Activate Conda Env uses: conda-incubator/setup-miniconda@v2 with: @@ -90,19 +101,8 @@ jobs: -o ${{ matrix.stable-diffusion-model-dl-path }} \ -L ${{ matrix.stable-diffusion-model }} - # - name: Use Cached Huggingface and Torch models - # id: cache-hugginface-torch - # uses: actions/cache@v3 - # env: - # cache-name: cache-hugginface-torch - # with: - # path: ~/.cache - # key: ${{ env.cache-name }} - # restore-keys: | - # ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} - - # - name: run preload_models.py - # run: python scripts/preload_models.py + - name: run preload_models.py + run: python scripts/preload_models.py - name: Run the tests run: | From bb5fe98e94d03f5d208bf703548fec3269f41767 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 10:03:03 +0200 Subject: [PATCH 27/32] rename matrix-job, use macOS-12, add ids to steps --- .github/workflows/test-invoke-conda.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 43b294b4ab..7e8e8808e6 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -20,7 +20,7 @@ jobs: - 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt' os: - ubuntu-latest - - macos-latest + - macOS-12 include: - os: ubuntu-latest environment-file: environment.yml @@ -34,7 +34,7 @@ jobs: - stable-diffusion-model: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt stable-diffusion-model-dl-path: models/ldm/stable-diffusion-v1/v1-5-pruned-emaonly.ckpt stable-diffusion-model-switch: stable-diffusion-1.5 - name: Test invoke.py on ${{ matrix.os }} with ${{ matrix.stable-diffusion-model }} + name: Test invoke.py on ${{ matrix.os }} with ${{ matrix.stable-diffusion-model-switch }} runs-on: ${{ matrix.os }} env: CONDA_ENV_NAME: invokeai @@ -43,26 +43,28 @@ jobs: shell: ${{ matrix.default-shell }} steps: - name: Checkout sources + id: checkout-sources uses: actions/checkout@v3 - name: Use cached conda packages + id: use-cached-conda-packages uses: actions/cache@v3 with: path: ~/conda_pkgs_dir key: conda-pkgs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles(matrix.environment-file) }} - name: Use Cached Huggingface and Torch models - id: cache-hugginface-torch + id: cache-hugginface-and-torch-models uses: actions/cache@v3 env: cache-name: cache-hugginface-and-torch-models with: path: ~/.cache key: ${{ env.cache-name }} - restore-keys: | - ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} + restore-keys: ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} - name: Activate Conda Env + id: activate-conda-env uses: conda-incubator/setup-miniconda@v2 with: activate-environment: ${{ env.CONDA_ENV_NAME }} @@ -70,14 +72,17 @@ jobs: miniconda-version: latest - name: set test prompt to main branch validation + id: set-test-prompt if: ${{ github.ref == 'refs/heads/main' }} run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV - name: set test prompt to development branch validation + id: set-test-prompt if: ${{ github.ref == 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV - name: set test prompt to Pull Request validation + id: set-test-prompt if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV @@ -92,6 +97,7 @@ jobs: restore-keys: ${{ env.cache-name }} - name: Download ${{ matrix.stable-diffusion-model-switch }} + id: download-stable-diffusion-model if: ${{ steps.cache-stable-diffusion-model.outputs.cache-hit != 'true' }} run: | [[ -d models/ldm/stable-diffusion-v1 ]] \ @@ -102,9 +108,11 @@ jobs: -L ${{ matrix.stable-diffusion-model }} - name: run preload_models.py + id: run-preload-models run: python scripts/preload_models.py - name: Run the tests + id: run-tests run: | echo "!switch ${{ matrix.stable-diffusion-model-switch }}" > testprompts.txt cat ${{ env.TEST_PROMPTS }} >> testprompts.txt @@ -112,11 +120,13 @@ jobs: --from_file testprompts.txt - name: export conda env + id: export-conda-env run: | mkdir -p outputs/img-samples - conda env export --name ${{ env.CONDA_ENV_NAME }} > outputs/img-samples/environment-${{ runner.os }}.yml + conda env export --name ${{ env.CONDA_ENV_NAME }} > outputs/img-samples/environment-${{ runner.os }}-${{ runner.arch }}.yml - name: Archive results + id: archive-results uses: actions/upload-artifact@v3 with: name: results_${{ matrix.os }}_${{ matrix.stable-diffusion-model-switch }} From b55dcf5943c7b796d5ad73c9be7993a93ec6cfbf Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 10:11:54 +0200 Subject: [PATCH 28/32] remove id from test prompts --- .github/workflows/test-invoke-conda.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 7e8e8808e6..473954c029 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -72,17 +72,14 @@ jobs: miniconda-version: latest - name: set test prompt to main branch validation - id: set-test-prompt if: ${{ github.ref == 'refs/heads/main' }} run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV - name: set test prompt to development branch validation - id: set-test-prompt if: ${{ github.ref == 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV - name: set test prompt to Pull Request validation - id: set-test-prompt if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV From 8127f0691eb2b9f1ef39530eac75772f15ed42d4 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 10:14:24 +0200 Subject: [PATCH 29/32] fix os matrix --- .github/workflows/test-invoke-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 473954c029..7fca610582 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -25,7 +25,7 @@ jobs: - os: ubuntu-latest environment-file: environment.yml default-shell: bash -l {0} - - os: macos-latest + - os: macOS-12 environment-file: environment-mac.yml default-shell: bash -l {0} - stable-diffusion-model: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt From 3d265e28ffdc20179abb37c205c71b4f7a5aa360 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 16:21:31 +0200 Subject: [PATCH 30/32] call invoke.py with model parameter --- .github/workflows/test-invoke-conda.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 7fca610582..b70e8ff2a1 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -111,10 +111,9 @@ jobs: - name: Run the tests id: run-tests run: | - echo "!switch ${{ matrix.stable-diffusion-model-switch }}" > testprompts.txt - cat ${{ env.TEST_PROMPTS }} >> testprompts.txt time python scripts/invoke.py \ - --from_file testprompts.txt + --model ${{ matrix.stable-diffusion-model-switch }} \ + --from_file ${{ env.TEST_PROMPTS }} - name: export conda env id: export-conda-env From da5de6a240a175e66526c76dd0806ca1f58516cc Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 18:50:37 +0200 Subject: [PATCH 31/32] remove some bloating caches since free 10GB Limit is already overused multiple times --- .github/workflows/build-container.yml | 3 +-- .github/workflows/test-invoke-conda.yml | 21 --------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index 036ad9679d..2aa9433d01 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -29,8 +29,7 @@ jobs: uses: actions/cache@v2 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: ${{ runner.os }}-buildx- + key: buildx-${{ hashFiles('docker-build/Dockerfile') }} - name: Build container uses: docker/build-push-action@v3 with: diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index b70e8ff2a1..487c89c249 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -53,16 +53,6 @@ jobs: path: ~/conda_pkgs_dir key: conda-pkgs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles(matrix.environment-file) }} - - name: Use Cached Huggingface and Torch models - id: cache-hugginface-and-torch-models - uses: actions/cache@v3 - env: - cache-name: cache-hugginface-and-torch-models - with: - path: ~/.cache - key: ${{ env.cache-name }} - restore-keys: ${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }} - - name: Activate Conda Env id: activate-conda-env uses: conda-incubator/setup-miniconda@v2 @@ -83,19 +73,8 @@ jobs: if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }} run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV - - name: Use Cached ${{ matrix.stable-diffusion-model-switch }} - id: cache-stable-diffusion-model - uses: actions/cache@v3 - env: - cache-name: cache-sd-${{ matrix.stable-diffusion-model }} - with: - path: ${{ matrix.stable-diffusion-model-dl-path }} - key: ${{ env.cache-name }} - restore-keys: ${{ env.cache-name }} - - name: Download ${{ matrix.stable-diffusion-model-switch }} id: download-stable-diffusion-model - if: ${{ steps.cache-stable-diffusion-model.outputs.cache-hit != 'true' }} run: | [[ -d models/ldm/stable-diffusion-v1 ]] \ || mkdir -p models/ldm/stable-diffusion-v1 From 3d4a9c2debded8bfe0209f99c9ff1e9102355150 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sat, 29 Oct 2022 22:25:41 +0200 Subject: [PATCH 32/32] remove redundant information from pipeline names --- .github/workflows/test-invoke-conda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 487c89c249..cd52e76c35 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -1,4 +1,4 @@ -name: Test Invoke with Conda +name: Test invoke.py on: push: branches: @@ -34,7 +34,7 @@ jobs: - stable-diffusion-model: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt stable-diffusion-model-dl-path: models/ldm/stable-diffusion-v1/v1-5-pruned-emaonly.ckpt stable-diffusion-model-switch: stable-diffusion-1.5 - name: Test invoke.py on ${{ matrix.os }} with ${{ matrix.stable-diffusion-model-switch }} + name: ${{ matrix.os }} with ${{ matrix.stable-diffusion-model-switch }} runs-on: ${{ matrix.os }} env: CONDA_ENV_NAME: invokeai