From 93c9852142e7ce6a133d053b1b6055f07ea51419 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 29 May 2024 19:46:46 -0400 Subject: [PATCH] fix ruff --- invokeai/app/invocations/mask.py | 6 +++--- invokeai/app/services/events/events_common.py | 3 +-- .../shared/sqlite_migrator/sqlite_migrator_common.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/invokeai/app/invocations/mask.py b/invokeai/app/invocations/mask.py index 6b9524e7a8..6f54660847 100644 --- a/invokeai/app/invocations/mask.py +++ b/invokeai/app/invocations/mask.py @@ -25,9 +25,9 @@ class RectangleMaskInvocation(BaseInvocation, WithMetadata): def invoke(self, context: InvocationContext) -> MaskOutput: mask = torch.zeros((1, self.height, self.width), dtype=torch.bool) - mask[ - :, self.y_top : self.y_top + self.rectangle_height, self.x_left : self.x_left + self.rectangle_width - ] = True + mask[:, self.y_top : self.y_top + self.rectangle_height, self.x_left : self.x_left + self.rectangle_width] = ( + True + ) mask_tensor_name = context.tensors.save(mask) return MaskOutput( diff --git a/invokeai/app/services/events/events_common.py b/invokeai/app/services/events/events_common.py index f30b054f36..0adcaa2ab1 100644 --- a/invokeai/app/services/events/events_common.py +++ b/invokeai/app/services/events/events_common.py @@ -62,8 +62,7 @@ Provide a generic type to `TEvent` to specify the payload type. class FastAPIEventFunc(Protocol, Generic[TEvent]): - def __call__(self, event: FastAPIEvent[TEvent]) -> Optional[Coroutine[Any, Any, None]]: - ... + def __call__(self, event: FastAPIEvent[TEvent]) -> Optional[Coroutine[Any, Any, None]]: ... def register_events(events: set[type[TEvent]] | type[TEvent], func: FastAPIEventFunc[TEvent]) -> None: diff --git a/invokeai/app/services/shared/sqlite_migrator/sqlite_migrator_common.py b/invokeai/app/services/shared/sqlite_migrator/sqlite_migrator_common.py index 47ed5da505..9b2444dae4 100644 --- a/invokeai/app/services/shared/sqlite_migrator/sqlite_migrator_common.py +++ b/invokeai/app/services/shared/sqlite_migrator/sqlite_migrator_common.py @@ -17,8 +17,7 @@ class MigrateCallback(Protocol): See :class:`Migration` for an example. """ - def __call__(self, cursor: sqlite3.Cursor) -> None: - ... + def __call__(self, cursor: sqlite3.Cursor) -> None: ... class MigrationError(RuntimeError):