restore CLI to broken state

This commit is contained in:
Lincoln Stein
2023-10-11 22:57:08 -04:00
parent e079cc9f07
commit 0a0412f75f
2 changed files with 6 additions and 6 deletions

View File

@ -63,10 +63,7 @@ def add_parsers(
for command in commands:
hints = get_type_hints(command)
cmd_name = get_args(hints[command_field])[0]
try:
command_parser = subparsers.add_parser(cmd_name, help=command.__doc__)
except argparse.ArgumentError:
continue
command_parser = subparsers.add_parser(cmd_name, help=command.__doc__)
if add_arguments is not None:
add_arguments(command_parser)
@ -145,7 +142,7 @@ class BaseCommand(ABC, BaseModel):
"""A CLI command"""
# All commands must include a type name like this:
# Literal['your_command_name'] = 'your_command_name'
# type: Literal['your_command_name'] = 'your_command_name'
@classmethod
def get_all_subclasses(cls):

View File

@ -56,6 +56,7 @@ if True: # hack to make flake8 happy with imports coming after setting up the c
from .services.latent_storage import DiskLatentsStorage, ForwardCacheLatentsStorage
from .services.model_install_service import ModelInstallService
from .services.model_loader_service import ModelLoadService
from .services.download_manager import DownloadQueueService
from .services.model_record_service import ModelRecordServiceBase
from .services.processor import DefaultInvocationProcessor
from .services.sqlite import SqliteItemStorage
@ -262,9 +263,10 @@ def invoke_cli():
db_conn = sqlite3.connect(db_location, check_same_thread=False) # TODO: figure out a better threading solution
logger.info(f'InvokeAI database location is "{db_location}"')
download_queue = DownloadQueueService(event_bus=events)
model_record_store = ModelRecordServiceBase.open(config, conn=db_conn, lock=None)
model_loader = ModelLoadService(config, model_record_store)
model_installer = ModelInstallService(config, model_record_store, events)
model_installer = ModelInstallService(config, queue=download_queue, store=model_record_store, event_bus=events)
graph_execution_manager = SqliteItemStorage[GraphExecutionState](
conn=db_conn, table_name="graph_executions", lock=lock
@ -322,6 +324,7 @@ def invoke_cli():
processor=DefaultInvocationProcessor(),
performance_statistics=InvocationStatsService(graph_execution_manager),
logger=logger,
download_queue=download_queue,
model_record_store=model_record_store,
model_loader=model_loader,
model_installer=model_installer,