2023-04-29 14:48:50 +00:00
|
|
|
# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) and the InvokeAI Team
|
2023-05-25 00:21:46 +00:00
|
|
|
from __future__ import annotations
|
2023-05-21 10:27:34 +00:00
|
|
|
from typing import TYPE_CHECKING
|
2023-05-17 09:13:53 +00:00
|
|
|
|
2023-05-21 10:27:34 +00:00
|
|
|
if TYPE_CHECKING:
|
2023-05-25 00:21:46 +00:00
|
|
|
from logging import Logger
|
2023-06-14 14:07:20 +00:00
|
|
|
from invokeai.app.services.board_images import BoardImagesServiceABC
|
|
|
|
from invokeai.app.services.boards import BoardServiceABC
|
|
|
|
from invokeai.app.services.images import ImageServiceABC
|
2023-06-29 06:01:17 +00:00
|
|
|
from invokeai.app.services.model_manager_service import ModelManagerServiceBase
|
2023-05-25 00:21:46 +00:00
|
|
|
from invokeai.app.services.events import EventServiceBase
|
|
|
|
from invokeai.app.services.latent_storage import LatentsStorageBase
|
|
|
|
from invokeai.app.services.invocation_queue import InvocationQueueABC
|
|
|
|
from invokeai.app.services.item_storage import ItemStorageABC
|
|
|
|
from invokeai.app.services.config import InvokeAISettings
|
2023-05-21 10:27:34 +00:00
|
|
|
from invokeai.app.services.graph import GraphExecutionState, LibraryGraph
|
|
|
|
from invokeai.app.services.invoker import InvocationProcessorABC
|
|
|
|
|
|
|
|
|
2023-03-03 06:02:00 +00:00
|
|
|
class InvocationServices:
|
2022-12-01 05:33:20 +00:00
|
|
|
"""Services that can be used by invocations"""
|
2023-03-03 06:02:00 +00:00
|
|
|
|
2023-05-25 00:21:46 +00:00
|
|
|
# TODO: Just forward-declared everything due to circular dependencies. Fix structure.
|
2023-06-29 06:01:17 +00:00
|
|
|
board_images: "BoardImagesServiceABC"
|
|
|
|
boards: "BoardServiceABC"
|
|
|
|
configuration: "InvokeAISettings"
|
2023-05-25 00:21:46 +00:00
|
|
|
events: "EventServiceBase"
|
2023-06-29 06:01:17 +00:00
|
|
|
graph_execution_manager: "ItemStorageABC"["GraphExecutionState"]
|
|
|
|
graph_library: "ItemStorageABC"["LibraryGraph"]
|
|
|
|
images: "ImageServiceABC"
|
2023-05-25 00:21:46 +00:00
|
|
|
latents: "LatentsStorageBase"
|
2023-06-29 06:01:17 +00:00
|
|
|
logger: "Logger"
|
|
|
|
model_manager: "ModelManagerServiceBase"
|
|
|
|
processor: "InvocationProcessorABC"
|
2023-05-25 00:21:46 +00:00
|
|
|
queue: "InvocationQueueABC"
|
2022-12-01 05:33:20 +00:00
|
|
|
|
2023-03-03 06:02:00 +00:00
|
|
|
def __init__(
|
2023-05-17 09:13:53 +00:00
|
|
|
self,
|
2023-06-14 14:07:20 +00:00
|
|
|
board_images: "BoardImagesServiceABC",
|
2023-06-29 06:01:17 +00:00
|
|
|
boards: "BoardServiceABC",
|
|
|
|
configuration: "InvokeAISettings",
|
|
|
|
events: "EventServiceBase",
|
2023-05-25 00:21:46 +00:00
|
|
|
graph_execution_manager: "ItemStorageABC"["GraphExecutionState"],
|
2023-06-29 06:01:17 +00:00
|
|
|
graph_library: "ItemStorageABC"["LibraryGraph"],
|
|
|
|
images: "ImageServiceABC",
|
|
|
|
latents: "LatentsStorageBase",
|
|
|
|
logger: "Logger",
|
|
|
|
model_manager: "ModelManagerServiceBase",
|
2023-05-17 09:13:53 +00:00
|
|
|
processor: "InvocationProcessorABC",
|
2023-06-29 06:01:17 +00:00
|
|
|
queue: "InvocationQueueABC",
|
2022-12-01 05:33:20 +00:00
|
|
|
):
|
2023-06-14 14:07:20 +00:00
|
|
|
self.board_images = board_images
|
2023-06-29 06:01:17 +00:00
|
|
|
self.boards = boards
|
|
|
|
self.boards = boards
|
|
|
|
self.configuration = configuration
|
|
|
|
self.events = events
|
2023-02-25 04:11:28 +00:00
|
|
|
self.graph_execution_manager = graph_execution_manager
|
2023-06-29 06:01:17 +00:00
|
|
|
self.graph_library = graph_library
|
|
|
|
self.images = images
|
|
|
|
self.latents = latents
|
|
|
|
self.logger = logger
|
|
|
|
self.model_manager = model_manager
|
2023-02-25 04:11:28 +00:00
|
|
|
self.processor = processor
|
2023-06-29 06:01:17 +00:00
|
|
|
self.queue = queue
|