From 984e609c61525fae4ff2cc205ac19aa38286d542 Mon Sep 17 00:00:00 2001 From: Ryan Dick Date: Thu, 30 Nov 2023 10:44:21 -0500 Subject: [PATCH] (minor) Tweak field ordering and field names for tiling nodes. --- invokeai/app/invocations/latent.py | 8 ++++---- invokeai/app/invocations/tiles.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invokeai/app/invocations/latent.py b/invokeai/app/invocations/latent.py index 34ef3421f8..218e05a986 100644 --- a/invokeai/app/invocations/latent.py +++ b/invokeai/app/invocations/latent.py @@ -1194,12 +1194,12 @@ class CropLatentsCoreInvocation(BaseInvocation): description=FieldDescriptions.latents, input=Input.Connection, ) - x_offset: int = InputField( + x: int = InputField( ge=0, multiple_of=LATENT_SCALE_FACTOR, description="The left x coordinate (in px) of the crop rectangle in image space. This value will be converted to a dimension in latent space.", ) - y_offset: int = InputField( + y: int = InputField( ge=0, multiple_of=LATENT_SCALE_FACTOR, description="The top y coordinate (in px) of the crop rectangle in image space. This value will be converted to a dimension in latent space.", @@ -1218,8 +1218,8 @@ class CropLatentsCoreInvocation(BaseInvocation): def invoke(self, context: InvocationContext) -> LatentsOutput: latents = context.services.latents.get(self.latents.latents_name) - x1 = self.x_offset // LATENT_SCALE_FACTOR - y1 = self.y_offset // LATENT_SCALE_FACTOR + x1 = self.x // LATENT_SCALE_FACTOR + y1 = self.y // LATENT_SCALE_FACTOR x2 = x1 + (self.width // LATENT_SCALE_FACTOR) y2 = y1 + (self.height // LATENT_SCALE_FACTOR) diff --git a/invokeai/app/invocations/tiles.py b/invokeai/app/invocations/tiles.py index d1b51a43f0..3055c1baae 100644 --- a/invokeai/app/invocations/tiles.py +++ b/invokeai/app/invocations/tiles.py @@ -58,10 +58,10 @@ class CalculateImageTilesInvocation(BaseInvocation): @invocation_output("tile_to_properties_output") class TileToPropertiesOutput(BaseInvocationOutput): - coords_top: int = OutputField(description="Top coordinate of the tile relative to its parent image.") - coords_bottom: int = OutputField(description="Bottom coordinate of the tile relative to its parent image.") coords_left: int = OutputField(description="Left coordinate of the tile relative to its parent image.") coords_right: int = OutputField(description="Right coordinate of the tile relative to its parent image.") + coords_top: int = OutputField(description="Top coordinate of the tile relative to its parent image.") + coords_bottom: int = OutputField(description="Bottom coordinate of the tile relative to its parent image.") # HACK: The width and height fields are 'meta' fields that can easily be calculated from the other fields on this # object. Including redundant fields that can cheaply/easily be re-calculated goes against conventional API design @@ -85,10 +85,10 @@ class TileToPropertiesInvocation(BaseInvocation): def invoke(self, context: InvocationContext) -> TileToPropertiesOutput: return TileToPropertiesOutput( - coords_top=self.tile.coords.top, - coords_bottom=self.tile.coords.bottom, coords_left=self.tile.coords.left, coords_right=self.tile.coords.right, + coords_top=self.tile.coords.top, + coords_bottom=self.tile.coords.bottom, width=self.tile.coords.right - self.tile.coords.left, height=self.tile.coords.bottom - self.tile.coords.top, overlap_top=self.tile.overlap.top,