Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b78d718
use propper bearer authentication to dwnload model
mauwii Oct 28, 2022
4a9209c
add debug branch to trigger run
mauwii Oct 28, 2022
2ac3c9e
remove -O from curl arguments
mauwii Oct 28, 2022
9f16ff1
remove cache for debugging
mauwii Oct 28, 2022
9425389
prop. integrate stable-diffusion-model into matrix
mauwii Oct 28, 2022
1ca1ab5
fix matrix
mauwii Oct 28, 2022
0d3a931
update mac environment
mauwii Oct 28, 2022
7138faf
include stable-diffusion-model in job name
mauwii Oct 28, 2022
6c34b89
loosen pytorch and torchvision version
mauwii Oct 28, 2022
f7a47c1
reenable caching of sd model
mauwii Oct 28, 2022
78f7094
set torchmetrics >=0.7.0 and use py-opencv=4.6.0
mauwii Oct 28, 2022
da33e03
unpin pytorch / torchvision
mauwii Oct 29, 2022
aa01657
very fast on m1, synced with output of main branch
mauwii Oct 29, 2022
31ef152
pin versions corelating between arm64 and x64
mauwii Oct 29, 2022
da5fd10
pin nomkl
mauwii Oct 29, 2022
3ab3a7d
use same environment-mac.yml as in #1289
mauwii Oct 29, 2022
b7fcf6d
readd conda env cache
mauwii Oct 29, 2022
0a89d35
update conda cache to use actions/cache@v3
mauwii Oct 29, 2022
bd3ba59
fix hashFiles function
mauwii Oct 29, 2022
ea65650
add conda pkgs cache, remove conda env cache
mauwii Oct 29, 2022
63202e2
try to run matrix with different models
mauwii Oct 29, 2022
d2e8ecb
fix missing matrix-parameters
mauwii Oct 29, 2022
e5d0c9c
include sd-switch in artifact name
mauwii Oct 29, 2022
85b5fcd
fix cache hit expression in download sd-model step
mauwii Oct 29, 2022
e7aeaa3
run without preload_models.py
mauwii Oct 29, 2022
fc4d07f
reenable preload models, move huggingface-cache...
mauwii Oct 29, 2022
bb5fe98
rename matrix-job, use macOS-12, add ids to steps
mauwii Oct 29, 2022
b55dcf5
remove id from test prompts
mauwii Oct 29, 2022
8127f06
fix os matrix
mauwii Oct 29, 2022
3d265e2
call invoke.py with model parameter
mauwii Oct 29, 2022
da5de6a
remove some bloating caches
mauwii Oct 29, 2022
3d4a9c2
remove redundant information from pipeline names
mauwii Oct 29, 2022
5d4d8f5
Merge branch 'update-workflows' into development
mauwii Oct 29, 2022
338efa5
remove debug branch
mauwii Oct 29, 2022
0596ebd
**IMPORTANT FIX**
mauwii Oct 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
93 changes: 44 additions & 49 deletions .github/workflows/test-invoke-conda.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,63 @@
name: Test Invoke with Conda
name: Test invoke.py
on:
push:
branches:
- 'main'
- 'development'
pull_request_target:
pull_request:
branches:
- 'main'
- '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-12
include:
- 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}
name: Test invoke.py on ${{ matrix.os }} with conda
- 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: ${{ matrix.os }} with ${{ matrix.stable-diffusion-model-switch }}
runs-on: ${{ matrix.os }}
env:
CONDA_ENV_NAME: invokeai
defaults:
run:
shell: ${{ matrix.default-shell }}
steps:
- name: Checkout sources
id: checkout-sources
uses: actions/checkout@v3

- name: setup miniconda
- 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: Activate Conda Env
id: 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
Expand All @@ -51,62 +72,36 @@ 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 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' }}
- name: Download ${{ matrix.stable-diffusion-model-switch }}
id: download-stable-diffusion-model
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 models/ldm/stable-diffusion-v1/model.ckpt \
-L ${{ matrix.stable-diffusion-model }}

- 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
env:
cache-name: cache-hugginface-torch
with:
path: ~/.cache
key: ${{ env.cache-name }}
restore-keys: |
${{ env.cache-name }}-${{ hashFiles('scripts/preload_models.py') }}
curl \
-H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \
-o ${{ matrix.stable-diffusion-model-dl-path }} \
-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: |
time python scripts/invoke.py \
--model ${{ matrix.stable-diffusion-model-switch }} \
--from_file ${{ env.TEST_PROMPTS }}

- 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 }}
name: results_${{ matrix.os }}_${{ matrix.stable-diffusion-model-switch }}
path: outputs/img-samples