-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/development' into dev/diffusers
# Conflicts: # .github/workflows/test-invoke-conda.yml
- Loading branch information
Showing
12 changed files
with
179 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: Test invoke.py pip | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'development' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
- 'development' | ||
|
||
jobs: | ||
matrix: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
stable-diffusion-model: | ||
- stable-diffusion-1.5 | ||
requirements-file: | ||
- requirements-lin-cuda.txt | ||
- requirements-lin-amd.txt | ||
- requirements-mac-mps-cpu.txt | ||
python-version: | ||
- '3.9' | ||
- '3.10' | ||
include: | ||
- requirements-file: requirements-lin-cuda.txt | ||
os: ubuntu-latest | ||
default-shell: bash -l {0} | ||
- requirements-file: requirements-lin-amd.txt | ||
os: ubuntu-latest | ||
default-shell: bash -l {0} | ||
- requirements-file: requirements-mac-mps-cpu.txt | ||
os: macOS-12 | ||
default-shell: bash -l {0} | ||
- stable-diffusion-model: stable-diffusion-1.5 | ||
stable-diffusion-model-url: 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 | ||
stable-diffusion-model-dl-name: v1-5-pruned-emaonly.ckpt | ||
name: ${{ matrix.requirements-file }} on ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: ${{ matrix.default-shell }} | ||
env: | ||
INVOKEAI_ROOT: '${{ github.workspace }}/invokeai' | ||
steps: | ||
- name: Checkout sources | ||
id: checkout-sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: create models.yaml from example | ||
run: | | ||
mkdir -p ${{ env.INVOKEAI_ROOT }}/configs | ||
cp configs/models.yaml.example ${{ env.INVOKEAI_ROOT }}/configs/models.yaml | ||
- name: set test prompt to main branch validation | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV | ||
|
||
- name: set test prompt to development branch validation | ||
if: ${{ github.ref == 'refs/heads/development' }} | ||
run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV | ||
|
||
- name: set test prompt to Pull Request validation | ||
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }} | ||
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV | ||
|
||
- name: create requirements.txt | ||
run: cp 'environments-and-requirements/${{ matrix.requirements-file }}' '${{ matrix.requirements-file }}' | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: ${{ matrix.requirements-file }} | ||
|
||
# - name: install dependencies | ||
# run: ${{ env.pythonLocation }}/bin/pip install --upgrade pip setuptools wheel | ||
|
||
- name: install requirements | ||
run: | | ||
${{ env.pythonLocation }}/bin/pip install --upgrade -r '${{ matrix.requirements-file }}' | ||
${{ env.pythonLocation }}/bin/pip install -e . | ||
- name: Use Cached Stable Diffusion Model | ||
id: cache-sd-model | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-${{ matrix.stable-diffusion-model }} | ||
with: | ||
path: ${{ matrix.stable-diffusion-model-dl-path }} | ||
key: ${{ env.cache-name }} | ||
|
||
- name: Download ${{ matrix.stable-diffusion-model }} | ||
id: download-stable-diffusion-model | ||
if: ${{ steps.cache-sd-model.outputs.cache-hit != 'true' }} | ||
run: | | ||
mkdir -p "${{ env.INVOKEAI_ROOT }}/${{ matrix.stable-diffusion-model-dl-path }}" | ||
curl \ | ||
-H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \ | ||
-o "${{ env.INVOKEAI_ROOT }}/${{ matrix.stable-diffusion-model-dl-path }}/${{ matrix.stable-diffusion-model-dl-name }}" \ | ||
-L ${{ matrix.stable-diffusion-model-url }} | ||
- name: run configure_invokeai.py | ||
id: run-preload-models | ||
run: | | ||
${{ env.pythonLocation }}/bin/python scripts/configure_invokeai.py --no-interactive --yes | ||
- name: Run the tests | ||
id: run-tests | ||
run: | | ||
time ${{ env.pythonLocation }}/bin/python scripts/invoke.py \ | ||
--model ${{ matrix.stable-diffusion-model }} \ | ||
--from_file ${{ env.TEST_PROMPTS }} \ | ||
--root="${{ env.INVOKEAI_ROOT }}" \ | ||
--outdir="${{ env.INVOKEAI_ROOT }}/outputs" | ||
- name: Archive results | ||
id: archive-results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: results_${{ matrix.requirements-file }}_${{ matrix.python-version }} | ||
path: ${{ env.INVOKEAI_ROOT }}/outputs/img-samples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,10 +56,9 @@ dependencies: | |
- taming-transformers-rom1504 | ||
- test-tube==0.7.5 | ||
- git+https://github.com/openai/CLIP.git@main#egg=clip | ||
- git+https://github.com/invoke-ai/k-diffusion.git@mps#egg=k_diffusion | ||
- git+https://github.com/invoke-ai/Real-ESRGAN.git#egg=realesrgan | ||
- git+https://github.com/invoke-ai/GFPGAN.git#egg=gfpgan | ||
- git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion | ||
- git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg | ||
- git+https://github.com/invoke-ai/[email protected]#egg=gfpgan | ||
- -e . | ||
variables: | ||
PYTORCH_ENABLE_MPS_FALLBACK: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
-r environments-and-requirements/requirements-base.txt | ||
|
||
# Get hardware-appropriate torch/torchvision | ||
# Get hardware-appropriate torch/torchvision | ||
--extra-index-url https://download.pytorch.org/whl/rocm5.1.1 --trusted-host https://download.pytorch.org | ||
torch | ||
torchvision | ||
-e . | ||
# -e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
-r environments-and-requirements/requirements-base.txt | ||
-e . | ||
# -e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
-r environments-and-requirements/requirements-base.txt | ||
|
||
grpcio==1.50.0 | ||
grpcio<1.51.0 | ||
protobuf==3.19.6 | ||
torch<1.13.0 | ||
torchvision<0.14.0 | ||
-e . | ||
# -e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters