InvokeAI/invokeai/app/services/invocation_services.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
2.6 KiB
Python
Raw Normal View History

2023-04-29 14:48:50 +00:00
# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) and the InvokeAI Team
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from logging import Logger
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
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
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:
"""Services that can be used by invocations"""
2023-03-03 06:02:00 +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"
events: "EventServiceBase"
2023-06-29 06:01:17 +00:00
graph_execution_manager: "ItemStorageABC"["GraphExecutionState"]
graph_library: "ItemStorageABC"["LibraryGraph"]
images: "ImageServiceABC"
latents: "LatentsStorageBase"
2023-06-29 06:01:17 +00:00
logger: "Logger"
model_manager: "ModelManagerServiceBase"
processor: "InvocationProcessorABC"
queue: "InvocationQueueABC"
2023-03-03 06:02:00 +00:00
def __init__(
self,
board_images: "BoardImagesServiceABC",
2023-06-29 06:01:17 +00:00
boards: "BoardServiceABC",
configuration: "InvokeAISettings",
events: "EventServiceBase",
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",
processor: "InvocationProcessorABC",
2023-06-29 06:01:17 +00:00
queue: "InvocationQueueABC",
):
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
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
self.processor = processor
2023-06-29 06:01:17 +00:00
self.queue = queue