InvokeAI/invokeai/app/services/invocation_services.py

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

47 lines
1.7 KiB
Python
Raw Normal View History

# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
from invokeai.backend import ModelManager
2023-03-03 06:02:00 +00:00
from .events import EventServiceBase
from .latent_storage import LatentsStorageBase
2023-03-03 06:02:00 +00:00
from .image_storage import ImageStorageBase
2023-03-11 22:00:00 +00:00
from .restoration_services import RestorationServices
from .invocation_queue import InvocationQueueABC
from .item_storage import ItemStorageABC
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
events: EventServiceBase
latents: LatentsStorageBase
images: ImageStorageBase
queue: InvocationQueueABC
2023-03-11 22:00:00 +00:00
model_manager: ModelManager
restoration: RestorationServices
# NOTE: we must forward-declare any types that include invocations, since invocations can use services
graph_library: ItemStorageABC["LibraryGraph"]
2023-03-03 06:02:00 +00:00
graph_execution_manager: ItemStorageABC["GraphExecutionState"]
processor: "InvocationProcessorABC"
2023-03-03 06:02:00 +00:00
def __init__(
self,
model_manager: ModelManager,
events: EventServiceBase,
latents: LatentsStorageBase,
images: ImageStorageBase,
queue: InvocationQueueABC,
graph_library: ItemStorageABC["LibraryGraph"],
graph_execution_manager: ItemStorageABC["GraphExecutionState"],
processor: "InvocationProcessorABC",
2023-03-11 22:00:00 +00:00
restoration: RestorationServices,
):
self.model_manager = model_manager
self.events = events
self.latents = latents
self.images = images
self.queue = queue
self.graph_library = graph_library
self.graph_execution_manager = graph_execution_manager
self.processor = processor
2023-03-11 22:00:00 +00:00
self.restoration = restoration