From 78b29db4583abe5ab1763651345e21d14d4af485 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 22 Dec 2023 12:18:12 +1100 Subject: [PATCH] feat(backend): disable graph library The graph library occasionally causes issues when the default graph changes substantially between versions and pydantic validation fails. See #5289 for an example. We are not currently using the graph library, so we can disable it until we are ready to use it. It's possible that the workflow library will supersede it anyways. --- invokeai/app/api/dependencies.py | 7 +------ invokeai/app/services/invocation_services.py | 5 +---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/invokeai/app/api/dependencies.py b/invokeai/app/api/dependencies.py index 2b88efbb95..eed178ee8b 100644 --- a/invokeai/app/api/dependencies.py +++ b/invokeai/app/api/dependencies.py @@ -29,8 +29,7 @@ from ..services.model_records import ModelRecordServiceSQL from ..services.names.names_default import SimpleNameService from ..services.session_processor.session_processor_default import DefaultSessionProcessor from ..services.session_queue.session_queue_sqlite import SqliteSessionQueue -from ..services.shared.default_graphs import create_system_graphs -from ..services.shared.graph import GraphExecutionState, LibraryGraph +from ..services.shared.graph import GraphExecutionState from ..services.urls.urls_default import LocalUrlService from ..services.workflow_records.workflow_records_sqlite import SqliteWorkflowRecordsStorage from .events import FastAPIEventService @@ -80,7 +79,6 @@ class ApiDependencies: boards = BoardService() events = FastAPIEventService(event_handler_id) graph_execution_manager = SqliteItemStorage[GraphExecutionState](db=db, table_name="graph_executions") - graph_library = SqliteItemStorage[LibraryGraph](db=db, table_name="graphs") image_records = SqliteImageRecordStorage(db=db) images = ImageService() invocation_cache = MemoryInvocationCache(max_cache_size=config.node_cache_size) @@ -107,7 +105,6 @@ class ApiDependencies: configuration=configuration, events=events, graph_execution_manager=graph_execution_manager, - graph_library=graph_library, image_files=image_files, image_records=image_records, images=images, @@ -127,8 +124,6 @@ class ApiDependencies: workflow_records=workflow_records, ) - create_system_graphs(services.graph_library) - ApiDependencies.invoker = Invoker(services) db.clean() diff --git a/invokeai/app/services/invocation_services.py b/invokeai/app/services/invocation_services.py index 6a308ab096..d99a9aff25 100644 --- a/invokeai/app/services/invocation_services.py +++ b/invokeai/app/services/invocation_services.py @@ -27,7 +27,7 @@ if TYPE_CHECKING: from .names.names_base import NameServiceBase from .session_processor.session_processor_base import SessionProcessorBase from .session_queue.session_queue_base import SessionQueueBase - from .shared.graph import GraphExecutionState, LibraryGraph + from .shared.graph import GraphExecutionState from .urls.urls_base import UrlServiceBase from .workflow_records.workflow_records_base import WorkflowRecordsStorageBase @@ -43,7 +43,6 @@ class InvocationServices: configuration: "InvokeAIAppConfig" events: "EventServiceBase" graph_execution_manager: "ItemStorageABC[GraphExecutionState]" - graph_library: "ItemStorageABC[LibraryGraph]" images: "ImageServiceABC" image_records: "ImageRecordStorageBase" image_files: "ImageFileStorageBase" @@ -71,7 +70,6 @@ class InvocationServices: configuration: "InvokeAIAppConfig", events: "EventServiceBase", graph_execution_manager: "ItemStorageABC[GraphExecutionState]", - graph_library: "ItemStorageABC[LibraryGraph]", images: "ImageServiceABC", image_files: "ImageFileStorageBase", image_records: "ImageRecordStorageBase", @@ -97,7 +95,6 @@ class InvocationServices: self.configuration = configuration self.events = events self.graph_execution_manager = graph_execution_manager - self.graph_library = graph_library self.images = images self.image_files = image_files self.image_records = image_records