InvokeAI/invokeai/app/services/invocation_services.py

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

37 lines
1.3 KiB
Python
Raw Normal View History

# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654)
from invokeai.backend import InvokeAIGeneratorFactory
2023-03-03 06:02:00 +00:00
from .events import EventServiceBase
from .image_storage import ImageStorageBase
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
generator_factory: InvokeAIGeneratorFactory
events: EventServiceBase
images: ImageStorageBase
queue: InvocationQueueABC
# NOTE: we must forward-declare any types that include invocations, since invocations can use services
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,
generator_factory: InvokeAIGeneratorFactory,
events: EventServiceBase,
images: ImageStorageBase,
queue: InvocationQueueABC,
graph_execution_manager: ItemStorageABC["GraphExecutionState"],
processor: "InvocationProcessorABC",
):
self.generator_factory = generator_factory
self.events = events
self.images = images
self.queue = queue
self.graph_execution_manager = graph_execution_manager
self.processor = processor