adjust non-app modules to use new config system

This commit is contained in:
Lincoln Stein
2023-05-04 00:43:51 -04:00
parent 15ffb53e59
commit e4196bbe5b
18 changed files with 84 additions and 98 deletions

View File

@ -17,7 +17,7 @@ from .api.dependencies import ApiDependencies
from .api.routers import images, sessions, models
from .api.sockets import SocketIO
from .invocations.baseinvocation import BaseInvocation
from .services.config import InvokeAIWebConfig
from .services.config import InvokeAIWebConfig, get_invokeai_config
# Create the app
# TODO: create this all in a method so configuration/etc. can be passed in?
@ -133,7 +133,7 @@ def invoke_api():
# parse command-line settings, environment and the init file
# (this is a module global)
global web_config
web_config = InvokeAIWebConfig()
web_config = get_invokeai_config(InvokeAIWebConfig)
app.add_middleware(
CORSMiddleware,
allow_origins=web_config.allow_origins,