From 8423be539b8968f82124360576a6b4c7957934ff Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 28 Nov 2022 20:22:31 -0500 Subject: [PATCH] tweak setup and environment files for linux & pypatchmatch (#1580) * tweak setup and environment files for linux & pypatchmatch - Downgrade python requirements to 3.9 because 3.10 is not supported on Ubuntu 20.04 LTS (widely-used distro) - Use our github pypatchmatch 0.1.3 in order to install Makefile where it needs to be. - Restored "-e ." as the last install step on pip installs. Hopefully this will not trigger the high-CPU hang we've previously experienced. * keep windows on basicsr 1.4.1 * keep windows on basicsr 1.4.1 * bump pypatchmatch requirement to 0.1.4 - This brings in a version of pypatchmatch that will gracefully handle internet connection not available at startup time. - Also refactors and simplifies the handling of gfpgan's basicsr requirement across various platforms. --- environments-and-requirements/environment-lin-aarch64.yml | 4 ++-- environments-and-requirements/environment-lin-amd.yml | 4 ++-- environments-and-requirements/environment-lin-cuda.yml | 4 ++-- environments-and-requirements/environment-mac.yml | 2 +- environments-and-requirements/environment-win-cuda.yml | 6 +++--- environments-and-requirements/requirements-base.txt | 4 +++- environments-and-requirements/requirements-lin-amd.txt | 3 --- environments-and-requirements/requirements-lin-arm64.txt | 3 --- environments-and-requirements/requirements-lin-cuda.txt | 1 - environments-and-requirements/requirements-mac-mps-cpu.txt | 1 - .../requirements-win-colab-cuda.txt | 1 - installer/requirements.in | 3 ++- setup.py | 2 +- 13 files changed, 16 insertions(+), 22 deletions(-) diff --git a/environments-and-requirements/environment-lin-aarch64.yml b/environments-and-requirements/environment-lin-aarch64.yml index 5500d4cb6c7..315595a37d9 100644 --- a/environments-and-requirements/environment-lin-aarch64.yml +++ b/environments-and-requirements/environment-lin-aarch64.yml @@ -41,6 +41,6 @@ dependencies: - 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/PyPatchMatch@0.1.1#egg=pypatchmatch + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan + - -e git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-lin-amd.yml b/environments-and-requirements/environment-lin-amd.yml index 69de31aa19d..93344666d20 100644 --- a/environments-and-requirements/environment-lin-amd.yml +++ b/environments-and-requirements/environment-lin-amd.yml @@ -4,7 +4,7 @@ channels: - conda-forge - defaults dependencies: - - python>=3.9 + - python=3.9.* - pip=22.2.2 - numpy=1.23.3 - pip: @@ -44,5 +44,5 @@ dependencies: - 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@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.1#egg=pypatchmatch + - -e git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-lin-cuda.yml b/environments-and-requirements/environment-lin-cuda.yml index d214ea519e3..17b2cddc95d 100644 --- a/environments-and-requirements/environment-lin-cuda.yml +++ b/environments-and-requirements/environment-lin-cuda.yml @@ -4,7 +4,7 @@ channels: - conda-forge - defaults dependencies: - - python=3.10 + - python=3.9.* - pip=22.2.2 - numpy=1.23.3 - torchvision=0.13.1 @@ -43,5 +43,5 @@ dependencies: - 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@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.1#egg=pypatchmatch + - -e git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-mac.yml b/environments-and-requirements/environment-mac.yml index 67489cbc09f..ca1dcc78868 100644 --- a/environments-and-requirements/environment-mac.yml +++ b/environments-and-requirements/environment-mac.yml @@ -59,7 +59,7 @@ dependencies: - 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@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.1#egg=pypatchmatch + - -e git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch - -e . variables: PYTORCH_ENABLE_MPS_FALLBACK: 1 diff --git a/environments-and-requirements/environment-win-cuda.yml b/environments-and-requirements/environment-win-cuda.yml index 9b43a30540e..f71ca666191 100644 --- a/environments-and-requirements/environment-win-cuda.yml +++ b/environments-and-requirements/environment-win-cuda.yml @@ -4,7 +4,7 @@ channels: - conda-forge - defaults dependencies: - - python>=3.9 + - python=3.10.* - pip=22.2.2 - numpy=1.23.3 - torchvision=0.13.1 @@ -43,6 +43,6 @@ dependencies: - 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/PyPatchMatch@0.1.1#egg=pypatchmatch + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan + - -e git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/requirements-base.txt b/environments-and-requirements/requirements-base.txt index e1b605db97b..b5e95e0ee0b 100644 --- a/environments-and-requirements/requirements-base.txt +++ b/environments-and-requirements/requirements-base.txt @@ -32,7 +32,9 @@ torch-fidelity torchmetrics transformers==4.21.* picklescan +git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan ; platform_system == 'Windows' +git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan ; platform_system != 'Windows' 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/PyPatchMatch@0.1.1#egg=pypatchmatch +git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch diff --git a/environments-and-requirements/requirements-lin-amd.txt b/environments-and-requirements/requirements-lin-amd.txt index 2cf1835dbf6..ba53c938aa4 100644 --- a/environments-and-requirements/requirements-lin-amd.txt +++ b/environments-and-requirements/requirements-lin-amd.txt @@ -1,7 +1,4 @@ -r environments-and-requirements/requirements-base.txt - -git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - # Get hardware-appropriate torch/torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.1.1 --trusted-host https://download.pytorch.org torch diff --git a/environments-and-requirements/requirements-lin-arm64.txt b/environments-and-requirements/requirements-lin-arm64.txt index 1e1b4082389..304432e4c76 100644 --- a/environments-and-requirements/requirements-lin-arm64.txt +++ b/environments-and-requirements/requirements-lin-arm64.txt @@ -1,6 +1,3 @@ --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu - -git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - -r environments-and-requirements/requirements-base.txt -e . diff --git a/environments-and-requirements/requirements-lin-cuda.txt b/environments-and-requirements/requirements-lin-cuda.txt index 56c7d971c47..1578c60334b 100644 --- a/environments-and-requirements/requirements-lin-cuda.txt +++ b/environments-and-requirements/requirements-lin-cuda.txt @@ -1,3 +1,2 @@ -r environments-and-requirements/requirements-base.txt -git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan -e . diff --git a/environments-and-requirements/requirements-mac-mps-cpu.txt b/environments-and-requirements/requirements-mac-mps-cpu.txt index 143ef5356e0..0c957c20a28 100644 --- a/environments-and-requirements/requirements-mac-mps-cpu.txt +++ b/environments-and-requirements/requirements-mac-mps-cpu.txt @@ -1,5 +1,4 @@ -r environments-and-requirements/requirements-base.txt -git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan grpcio<1.51.0 protobuf==3.19.6 torch<1.13.0 diff --git a/environments-and-requirements/requirements-win-colab-cuda.txt b/environments-and-requirements/requirements-win-colab-cuda.txt index 854fe394f1f..1cb771c37f3 100644 --- a/environments-and-requirements/requirements-win-colab-cuda.txt +++ b/environments-and-requirements/requirements-win-colab-cuda.txt @@ -1,5 +1,4 @@ -r environments-and-requirements/requirements-base.txt -git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan # Get hardware-appropriate torch/torchvision --extra-index-url https://download.pytorch.org/whl/cu116 --trusted-host https://download.pytorch.org basicsr==1.4.1 diff --git a/installer/requirements.in b/installer/requirements.in index ab6b2a1ff5c..cdeaf59a288 100644 --- a/installer/requirements.in +++ b/installer/requirements.in @@ -16,6 +16,7 @@ kornia numpy pyreadline3 realesrgan +requests==2.25.1 send2trash streamlit taming-transformers-rom1504 @@ -29,4 +30,4 @@ clip clipseg gfpgan k-diffusion - +pypatchmatch \ No newline at end of file diff --git a/setup.py b/setup.py index 185e98f41e2..220d9af4137 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def _get_requirements(path): return packages -VERSION = '2.1.4' +VERSION = '2.2.0' DESCRIPTION = ('An implementation of Stable Diffusion which provides various new features' ' and options to aid the image generation process') LONG_DESCRIPTION = ('This version of Stable Diffusion features a slick WebGUI, an'