mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Merge branch 'update-workflows' into development
This commit is contained in:
commit
5d4d8f54df
3
.github/workflows/build-container.yml
vendored
3
.github/workflows/build-container.yml
vendored
@ -29,8 +29,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: buildx-${{ hashFiles('docker-build/Dockerfile') }}
|
||||||
restore-keys: ${{ runner.os }}-buildx-
|
|
||||||
- name: Build container
|
- name: Build container
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
|
92
.github/workflows/test-invoke-conda.yml
vendored
92
.github/workflows/test-invoke-conda.yml
vendored
@ -1,42 +1,64 @@
|
|||||||
name: Test Invoke with Conda
|
name: Test invoke.py
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
- 'development'
|
- 'development'
|
||||||
|
- 'use-bearer-token-to-download-model-debug'
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
- 'development'
|
- 'development'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
os_matrix:
|
matrix:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
stable-diffusion-model: ['https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt']
|
stable-diffusion-model:
|
||||||
os: [ubuntu-latest, macos-latest]
|
- '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:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
environment-file: environment.yml
|
environment-file: environment.yml
|
||||||
default-shell: bash -l {0}
|
default-shell: bash -l {0}
|
||||||
- os: macos-latest
|
- os: macOS-12
|
||||||
environment-file: environment-mac.yml
|
environment-file: environment-mac.yml
|
||||||
default-shell: bash -l {0}
|
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 }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
CONDA_ENV_NAME: invokeai
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: ${{ matrix.default-shell }}
|
shell: ${{ matrix.default-shell }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
|
id: checkout-sources
|
||||||
uses: actions/checkout@v3
|
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
|
uses: conda-incubator/setup-miniconda@v2
|
||||||
with:
|
with:
|
||||||
auto-activate-base: false
|
activate-environment: ${{ env.CONDA_ENV_NAME }}
|
||||||
auto-update-conda: false
|
environment-file: ${{ matrix.environment-file }}
|
||||||
miniconda-version: latest
|
miniconda-version: latest
|
||||||
|
|
||||||
- name: set test prompt to main branch validation
|
- name: set test prompt to main branch validation
|
||||||
@ -51,62 +73,36 @@ jobs:
|
|||||||
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }}
|
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }}
|
||||||
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: set conda environment name
|
- name: Download ${{ matrix.stable-diffusion-model-switch }}
|
||||||
run: echo "CONDA_ENV_NAME=invokeai" >> $GITHUB_ENV
|
id: download-stable-diffusion-model
|
||||||
|
|
||||||
- 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: |
|
run: |
|
||||||
[[ -d models/ldm/stable-diffusion-v1 ]] \
|
[[ -d models/ldm/stable-diffusion-v1 ]] \
|
||||||
|| mkdir -p models/ldm/stable-diffusion-v1
|
|| mkdir -p models/ldm/stable-diffusion-v1
|
||||||
[[ -r models/ldm/stable-diffusion-v1/model.ckpt ]] \
|
curl \
|
||||||
|| curl \
|
-H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \
|
||||||
-H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \
|
-o ${{ matrix.stable-diffusion-model-dl-path }} \
|
||||||
-o models/ldm/stable-diffusion-v1/model.ckpt \
|
-L ${{ matrix.stable-diffusion-model }}
|
||||||
-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') }}
|
|
||||||
|
|
||||||
- name: run preload_models.py
|
- name: run preload_models.py
|
||||||
|
id: run-preload-models
|
||||||
run: python scripts/preload_models.py
|
run: python scripts/preload_models.py
|
||||||
|
|
||||||
- name: Run the tests
|
- name: Run the tests
|
||||||
|
id: run-tests
|
||||||
run: |
|
run: |
|
||||||
time python scripts/invoke.py \
|
time python scripts/invoke.py \
|
||||||
|
--model ${{ matrix.stable-diffusion-model-switch }} \
|
||||||
--from_file ${{ env.TEST_PROMPTS }}
|
--from_file ${{ env.TEST_PROMPTS }}
|
||||||
|
|
||||||
- name: export conda env
|
- name: export conda env
|
||||||
|
id: export-conda-env
|
||||||
run: |
|
run: |
|
||||||
mkdir -p outputs/img-samples
|
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
|
- name: Archive results
|
||||||
|
id: archive-results
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: results_${{ matrix.os }}
|
name: results_${{ matrix.os }}_${{ matrix.stable-diffusion-model-switch }}
|
||||||
path: outputs/img-samples
|
path: outputs/img-samples
|
||||||
|
Loading…
x
Reference in New Issue
Block a user