Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test-invoke-pip.yml #1521

Merged
merged 55 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3f450c6
add test-invoke-pip.yml
mauwii Nov 20, 2022
96a3982
update requirements-base.txt to fix tests
mauwii Nov 20, 2022
cf61858
install requirements-base.txt separate
mauwii Nov 20, 2022
1da9f66
restore origin requirements
mauwii Nov 21, 2022
39cb688
Merge branch 'development' into add-test-invoke-pip-workflow
mauwii Nov 21, 2022
7e7c63b
re-add previously overseen req in lin-cuda
mauwii Nov 21, 2022
85f3418
Merge branch 'add-test-invoke-pip-workflow' of github.com:invoke-ai/I…
mauwii Nov 21, 2022
a0393e5
fix typo in setup.py - `scripts/preload_models.py`
mauwii Nov 21, 2022
e215b44
use GFBGAN from branch `basicsr-1.4.2`
mauwii Nov 21, 2022
4bdee4d
remove `basicsr>=1.4.2` from base reqs
mauwii Nov 21, 2022
66eb6aa
add INVOKEAI_ROOT to env
mauwii Nov 21, 2022
fb616f2
Merge branch 'development' into add-test-invoke-pip-workflow
lstein Nov 23, 2022
3afa219
disable upgrade of `pip`, `setuptools` and `wheel`
mauwii Nov 24, 2022
77b4658
try to use a venv which should not contain `wheel`
mauwii Nov 24, 2022
6260096
add relative path to pip command
mauwii Nov 24, 2022
a746de5
use `configure_invokeai.py --no-interactive --yes`
mauwii Nov 24, 2022
5e83268
set grpcio to `<1.51.0`
mauwii Nov 24, 2022
2623524
revert changes to use venv
mauwii Nov 24, 2022
bdfba5c
remove `--prefer-binary`
mauwii Nov 24, 2022
bb793a2
disable step to create models.yaml
mauwii Nov 24, 2022
df6be3f
use `pip install --no-binary=":all:"`
mauwii Nov 24, 2022
473ad6a
another try to use venv
mauwii Nov 24, 2022
96a5486
try uninstalling wheel before installing reqs
mauwii Nov 24, 2022
58e04a4
dont use requirements.txt as filename
mauwii Nov 24, 2022
d198632
Merge branch 'development' into add-test-invoke-pip-workflow
mauwii Nov 24, 2022
68c320c
update cache-dependency-path
mauwii Nov 24, 2022
25ae3e6
add facexlib to requirements-base.txt
mauwii Nov 24, 2022
83ae4be
first install requirements-base.txt
mauwii Nov 24, 2022
3db010a
first install `-e .`, then install requirements
mauwii Nov 24, 2022
a2e40f2
add facexlib to requirements.in
mauwii Nov 24, 2022
d0553ca
remove `-e .` from reqs and install after reqs
mauwii Nov 24, 2022
4aeb02b
unpin torch and torchvision in requirements.in
mauwii Nov 24, 2022
8fe9abd
fix model dl path
mauwii Nov 24, 2022
a84dc17
fix curl output path
mauwii Nov 24, 2022
8423b0c
create directory before downloading model
mauwii Nov 24, 2022
4252d6b
set INVOKEAI_ROOT_PATH
mauwii Nov 24, 2022
1916207
INVOKEAI_ROOT ${{ env.GITHUB_WORKSPACE }}/invokeai
mauwii Nov 24, 2022
6b636e5
fix matrix stable-diffusion-model-dl-path
mauwii Nov 24, 2022
832d5fa
fix INVOKEAI_ROOT
mauwii Nov 24, 2022
4711b32
fix INVOKEAI_ROOT
mauwii Nov 24, 2022
9161968
add --root and --outdir to run-tests step
mauwii Nov 24, 2022
2509be9
create models.yaml from example
mauwii Nov 24, 2022
0176c29
fix scripts variable in setup.py
mauwii Nov 24, 2022
30824e7
fix archive-results path
mauwii Nov 24, 2022
e332ca6
fix workflow to reflect latest code changes
mauwii Nov 24, 2022
12bb25e
fix copy paste error
mauwii Nov 24, 2022
6ffd4d6
fix job name
mauwii Nov 24, 2022
d6fec55
fix matrix.stable-diffusion-model
mauwii Nov 24, 2022
be8027a
restructure matrix
mauwii Nov 24, 2022
e9d6585
fix `activate conda env` step
mauwii Nov 24, 2022
601526f
update the environment yamls
mauwii Nov 24, 2022
600ac8d
Merge branch 'fix-test-invoke-conda' into add-test-invoke-pip-workflow
mauwii Nov 24, 2022
a421352
rename job in test-invoke-conda
mauwii Nov 24, 2022
e0b98a6
add tqdm to environment-lin-amd.yml
mauwii Nov 24, 2022
317ccb8
fix python commands in test-invoke-conda.yml
mauwii Nov 24, 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
122 changes: 122 additions & 0 deletions .github/workflows/test-invoke-pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
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/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: /home/runner/invokeai
steps:
- name: Checkout sources
id: checkout-sources
uses: actions/checkout@v3

- name: create models.yaml from example
run: cp configs/models.yaml.example 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 }} requirements.txt

- name: setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: install dependencies
run: ${{ env.pythonLocation }}/bin/pip install --upgrade pip setuptools wheel

- name: install requirements
run: ${{ env.pythonLocation }}/bin/pip install --prefer-binary -r requirements.txt

# - name: install base requirements
# run: ${{ env.pythonLocation }}/bin/pip install --prefer-binary -r environments-and-requirements/requirements-base.txt

- 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: |
[[ -d models/ldm/stable-diffusion-v1 ]] \
|| mkdir -p models/ldm/stable-diffusion-v1
curl \
-H "Authorization: Bearer ${{ secrets.HUGGINGFACE_TOKEN }}" \
-o ${{ matrix.stable-diffusion-model-dl-path }} \
-L ${{ matrix.stable-diffusion-model-url }}

- name: run preload_models.py
id: run-preload-models
run: |
${{ env.pythonLocation }}/bin/python scripts/preload_models.py \
--no-interactive

- 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 }}

- name: Archive results
id: archive-results
uses: actions/upload-artifact@v3
with:
name: results_${{ matrix.requirements-file }}_${{ matrix.python-version }}
path: outputs/img-samples
2 changes: 1 addition & 1 deletion environments-and-requirements/requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ picklescan
git+https://github.com/openai/CLIP.git@main#egg=clip
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/GFPGAN#egg=gfpgan
git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan
2 changes: 1 addition & 1 deletion environments-and-requirements/requirements-lin-amd.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _get_requirements(path):
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Image Processing',
],
scripts = ['scripts/invoke.py','scripts/configure_invokeai.py','scripts/sd-metadata.py'],
scripts = ['scripts/invoke.py','scripts/preload_models.py','scripts/load_models.py', 'scripts/configure_invokeai.py', 'scripts/sd-metadata.py'],
data_files=[('frontend',frontend_files)],
)