From 99c0662e3ff77325cc690a10dbe981be262940d3 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:51:15 +1100 Subject: [PATCH] fix(nodes): load config before doing anything else This was preventing custom nodes from loading if a custom nodes dir was specified Closes #5862 --- invokeai/app/api_app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py index 5fdf55d1ef..703774b77b 100644 --- a/invokeai/app/api_app.py +++ b/invokeai/app/api_app.py @@ -2,12 +2,9 @@ # which are imported/used before parse_args() is called will get the default config values instead of the # values from the command line or config file. import sys -from contextlib import asynccontextmanager -from invokeai.app.api.no_cache_staticfiles import NoCacheStaticFiles from invokeai.version.invokeai_version import __version__ -from .invocations.fields import InputFieldJSONSchemaExtra, OutputFieldJSONSchemaExtra from .services.config import InvokeAIAppConfig app_config = InvokeAIAppConfig.get_config() @@ -20,6 +17,7 @@ if True: # hack to make flake8 happy with imports coming after setting up the c import asyncio import mimetypes import socket + from contextlib import asynccontextmanager from inspect import signature from pathlib import Path from typing import Any @@ -40,6 +38,7 @@ if True: # hack to make flake8 happy with imports coming after setting up the c # noinspection PyUnresolvedReferences import invokeai.backend.util.hotfixes # noqa: F401 (monkeypatching on import) import invokeai.frontend.web as web_dir + from invokeai.app.api.no_cache_staticfiles import NoCacheStaticFiles from ..backend.util.logging import InvokeAILogger from .api.dependencies import ApiDependencies @@ -59,6 +58,7 @@ if True: # hack to make flake8 happy with imports coming after setting up the c BaseInvocation, UIConfigBase, ) + from .invocations.fields import InputFieldJSONSchemaExtra, OutputFieldJSONSchemaExtra if is_mps_available(): import invokeai.backend.util.mps_fixes # noqa: F401 (monkeypatching on import)