mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
adjust non-app modules to use new config system
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -33,7 +33,7 @@ from .services.invocation_services import InvocationServices
|
||||
from .services.invoker import Invoker
|
||||
from .services.processor import DefaultInvocationProcessor
|
||||
from .services.sqlite import SqliteItemStorage
|
||||
from .services.config import InvokeAIAppConfig
|
||||
from .services.config import get_invokeai_config
|
||||
|
||||
class CliCommand(BaseModel):
|
||||
command: Union[BaseCommand.get_commands() + BaseInvocation.get_invocations()] = Field(discriminator="type") # type: ignore
|
||||
@@ -188,7 +188,7 @@ def invoke_all(context: CliContext):
|
||||
|
||||
|
||||
def invoke_cli():
|
||||
config = InvokeAIAppConfig()
|
||||
config = get_invokeai_config()
|
||||
model_manager = get_model_manager(config,logger=logger)
|
||||
|
||||
events = EventServiceBase()
|
||||
|
||||
Reference in New Issue
Block a user