From 8f80ba952064e7229d3697170408f101c37c7663 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 6 May 2023 23:09:24 -0400 Subject: [PATCH 1/7] update dependencies to get deterministic image generation --- installer/lib/installer.py | 4 ++-- pyproject.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/installer/lib/installer.py b/installer/lib/installer.py index 42079cd90c..96d8ce55e3 100644 --- a/installer/lib/installer.py +++ b/installer/lib/installer.py @@ -247,8 +247,8 @@ class InvokeAiInstance: pip[ "install", "--require-virtualenv", - "torch", - "torchvision", + "torch~=2.0.0", + "torchvision>=0.14.1", "--force-reinstall", "--find-links" if find_links is not None else None, find_links, diff --git a/pyproject.toml b/pyproject.toml index 0ab1e0ede6..9702f00202 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip", "compel==1.0.5", "datasets", - "diffusers[torch]==0.15.1", + "diffusers[torch]~=0.16.1", "dnspython==2.2.1", "einops", "eventlet", @@ -72,7 +72,7 @@ dependencies = [ "scikit-image>=0.19", "send2trash", "test-tube>=0.7.5", - "torch>=1.13.1", + "torch~=2.0.0", "torchvision>=0.14.1", "torchmetrics", "transformers~=4.26", @@ -92,7 +92,7 @@ dependencies = [ ] "test" = ["pytest>6.0.0", "pytest-cov"] "xformers" = [ - "xformers~=0.0.16; sys_platform!='darwin'", + "xformers~=0.0.19; sys_platform!='darwin'", "triton; sys_platform=='linux'", ] From bc9491ab69b4e128223616e6aaa43e7156ff7edd Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 7 May 2023 15:21:24 -0400 Subject: [PATCH 2/7] bump compel version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9702f00202..2d685ffe02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "albumentations", "click", "clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip", - "compel==1.0.5", + "compel~=1.1.5", "datasets", "diffusers[torch]~=0.16.1", "dnspython==2.2.1", From bd0ad59c277316b186c643bf78727ef129d28252 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 7 May 2023 15:22:46 -0400 Subject: [PATCH 3/7] bump compel version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2d685ffe02..fd671fee23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "albumentations", "click", "clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip", - "compel~=1.1.5", + "compel~=1.1.5", "datasets", "diffusers[torch]~=0.16.1", "dnspython==2.2.1", From 7dfa135b2c5b1b293c53caead6ed6538968d991d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 10 May 2023 15:29:10 +1000 Subject: [PATCH 4/7] fix(nodes): fix #3306 Check if the cache has the object before deleting it. --- invokeai/app/services/image_storage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invokeai/app/services/image_storage.py b/invokeai/app/services/image_storage.py index c5e5cf8a8e..e2593dd473 100644 --- a/invokeai/app/services/image_storage.py +++ b/invokeai/app/services/image_storage.py @@ -270,4 +270,5 @@ class DiskImageStorage(ImageStorageBase): ) # TODO: this should refresh position for LRU cache if len(self.__cache) > self.__max_cache_size: cache_id = self.__cache_ids.get() - del self.__cache[cache_id] + if cache_id in self.__cache: + del self.__cache[cache_id] From f8e90ba3f099179e8003d933e211c8d8437b715f Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 10 May 2023 15:52:43 +1000 Subject: [PATCH 5/7] feat(nodes): add ui build static route --- invokeai/app/api_app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py index f935de542e..00afa8f7f0 100644 --- a/invokeai/app/api_app.py +++ b/invokeai/app/api_app.py @@ -126,6 +126,7 @@ app.openapi = custom_openapi # Override API doc favicons app.mount("/static", StaticFiles(directory="static/dream_web"), name="static") +app.mount("/", StaticFiles(directory="invokeai/frontend/web/dist", html=True), name="ui") @app.get("/docs", include_in_schema=False) def overridden_swagger(): From ee24ad7b1364063f9b8db4b91004bfa68da4235e Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 10 May 2023 16:18:06 +1000 Subject: [PATCH 6/7] fix(nodes): fix broken docs routes --- invokeai/app/api_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py index 00afa8f7f0..2dc97df273 100644 --- a/invokeai/app/api_app.py +++ b/invokeai/app/api_app.py @@ -126,8 +126,6 @@ app.openapi = custom_openapi # Override API doc favicons app.mount("/static", StaticFiles(directory="static/dream_web"), name="static") -app.mount("/", StaticFiles(directory="invokeai/frontend/web/dist", html=True), name="ui") - @app.get("/docs", include_in_schema=False) def overridden_swagger(): return get_swagger_ui_html( @@ -145,6 +143,8 @@ def overridden_redoc(): redoc_favicon_url="/static/favicon.ico", ) +# Must mount *after* the other routes else it borks em +app.mount("/", StaticFiles(directory="invokeai/frontend/web/dist", html=True), name="ui") def invoke_api(): # Start our own event loop for eventing usage From fb6ef61a4d77543c85f9841970b5668046ee1dea Mon Sep 17 00:00:00 2001 From: Mary Hipp Rogers Date: Wed, 10 May 2023 10:30:17 -0400 Subject: [PATCH 7/7] change path for locale (#3381) Co-authored-by: Mary Hipp --- invokeai/frontend/web/src/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/i18n.ts b/invokeai/frontend/web/src/i18n.ts index faa30f7289..ed71d583b3 100644 --- a/invokeai/frontend/web/src/i18n.ts +++ b/invokeai/frontend/web/src/i18n.ts @@ -3,7 +3,7 @@ import LanguageDetector from 'i18next-browser-languagedetector'; import Backend from 'i18next-http-backend'; import { initReactI18next } from 'react-i18next'; -import translationEN from '../dist/locales/en.json'; +import translationEN from '../public/locales/en.json'; if (import.meta.env.MODE === 'package') { i18n.use(initReactI18next).init({