mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(app): clean up app changes for canvas v2
This commit is contained in:
parent
3af577b210
commit
92dc30dace
@ -15,7 +15,6 @@ from invokeai.app.services.session_queue.session_queue_common import (
|
|||||||
ClearResult,
|
ClearResult,
|
||||||
EnqueueBatchResult,
|
EnqueueBatchResult,
|
||||||
PruneResult,
|
PruneResult,
|
||||||
QueueItemOrigin,
|
|
||||||
SessionQueueItem,
|
SessionQueueItem,
|
||||||
SessionQueueItemDTO,
|
SessionQueueItemDTO,
|
||||||
SessionQueueStatus,
|
SessionQueueStatus,
|
||||||
@ -114,7 +113,7 @@ async def cancel_by_batch_ids(
|
|||||||
)
|
)
|
||||||
async def cancel_by_origin(
|
async def cancel_by_origin(
|
||||||
queue_id: str = Path(description="The queue id to perform this operation on"),
|
queue_id: str = Path(description="The queue id to perform this operation on"),
|
||||||
origin: QueueItemOrigin = Query(description="The origin to cancel all queue items for"),
|
origin: str = Query(description="The origin to cancel all queue items for"),
|
||||||
) -> CancelByOriginResult:
|
) -> CancelByOriginResult:
|
||||||
"""Immediately cancels all queue items with the given origin"""
|
"""Immediately cancels all queue items with the given origin"""
|
||||||
return ApiDependencies.invoker.services.session_queue.cancel_by_origin(queue_id=queue_id, origin=origin)
|
return ApiDependencies.invoker.services.session_queue.cancel_by_origin(queue_id=queue_id, origin=origin)
|
||||||
|
@ -1027,6 +1027,7 @@ class CanvasV2MaskAndCropOutput(ImageOutput):
|
|||||||
tags=["image", "mask", "id"],
|
tags=["image", "mask", "id"],
|
||||||
category="image",
|
category="image",
|
||||||
version="1.0.0",
|
version="1.0.0",
|
||||||
|
classification=Classification.Prototype,
|
||||||
)
|
)
|
||||||
class CanvasV2MaskAndCropInvocation(BaseInvocation, WithMetadata, WithBoard):
|
class CanvasV2MaskAndCropInvocation(BaseInvocation, WithMetadata, WithBoard):
|
||||||
"""Handles Canvas V2 image output masking and cropping"""
|
"""Handles Canvas V2 image output masking and cropping"""
|
||||||
|
@ -13,7 +13,6 @@ from invokeai.app.services.session_queue.session_queue_common import (
|
|||||||
IsEmptyResult,
|
IsEmptyResult,
|
||||||
IsFullResult,
|
IsFullResult,
|
||||||
PruneResult,
|
PruneResult,
|
||||||
QueueItemOrigin,
|
|
||||||
SessionQueueItem,
|
SessionQueueItem,
|
||||||
SessionQueueItemDTO,
|
SessionQueueItemDTO,
|
||||||
SessionQueueStatus,
|
SessionQueueStatus,
|
||||||
@ -98,7 +97,7 @@ class SessionQueueBase(ABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def cancel_by_origin(self, queue_id: str, origin: QueueItemOrigin) -> CancelByOriginResult:
|
def cancel_by_origin(self, queue_id: str, origin: str) -> CancelByOriginResult:
|
||||||
"""Cancels all queue items with the given batch origin"""
|
"""Cancels all queue items with the given batch origin"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
from enum import Enum
|
|
||||||
from itertools import chain, product
|
from itertools import chain, product
|
||||||
from typing import Generator, Iterable, Literal, NamedTuple, Optional, TypeAlias, Union, cast
|
from typing import Generator, Iterable, Literal, NamedTuple, Optional, TypeAlias, Union, cast
|
||||||
|
|
||||||
@ -22,7 +21,6 @@ from invokeai.app.services.workflow_records.workflow_records_common import (
|
|||||||
WorkflowWithoutID,
|
WorkflowWithoutID,
|
||||||
WorkflowWithoutIDValidator,
|
WorkflowWithoutIDValidator,
|
||||||
)
|
)
|
||||||
from invokeai.app.util.metaenum import MetaEnum
|
|
||||||
from invokeai.app.util.misc import uuid_string
|
from invokeai.app.util.misc import uuid_string
|
||||||
|
|
||||||
# region Errors
|
# region Errors
|
||||||
@ -60,13 +58,6 @@ BatchDataType = Union[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class QueueItemOrigin(str, Enum, metaclass=MetaEnum):
|
|
||||||
"""The origin of a batch. For example, a batch can be created from the canvas or workflows tab."""
|
|
||||||
|
|
||||||
CANVAS = "canvas"
|
|
||||||
WORKFLOWS = "workflows"
|
|
||||||
|
|
||||||
|
|
||||||
class NodeFieldValue(BaseModel):
|
class NodeFieldValue(BaseModel):
|
||||||
node_path: str = Field(description="The node into which this batch data item will be substituted.")
|
node_path: str = Field(description="The node into which this batch data item will be substituted.")
|
||||||
field_name: str = Field(description="The field into which this batch data item will be substituted.")
|
field_name: str = Field(description="The field into which this batch data item will be substituted.")
|
||||||
|
@ -17,7 +17,6 @@ from invokeai.app.services.session_queue.session_queue_common import (
|
|||||||
IsEmptyResult,
|
IsEmptyResult,
|
||||||
IsFullResult,
|
IsFullResult,
|
||||||
PruneResult,
|
PruneResult,
|
||||||
QueueItemOrigin,
|
|
||||||
SessionQueueItem,
|
SessionQueueItem,
|
||||||
SessionQueueItemDTO,
|
SessionQueueItemDTO,
|
||||||
SessionQueueItemNotFoundError,
|
SessionQueueItemNotFoundError,
|
||||||
@ -427,7 +426,7 @@ class SqliteSessionQueue(SessionQueueBase):
|
|||||||
self.__lock.release()
|
self.__lock.release()
|
||||||
return CancelByBatchIDsResult(canceled=count)
|
return CancelByBatchIDsResult(canceled=count)
|
||||||
|
|
||||||
def cancel_by_origin(self, queue_id: str, origin: QueueItemOrigin) -> CancelByOriginResult:
|
def cancel_by_origin(self, queue_id: str, origin: str) -> CancelByOriginResult:
|
||||||
try:
|
try:
|
||||||
current_queue_item = self.get_current(queue_id)
|
current_queue_item = self.get_current(queue_id)
|
||||||
self.__lock.acquire()
|
self.__lock.acquire()
|
||||||
|
Loading…
Reference in New Issue
Block a user