Improve documentation of CropLatentsInvocation.

This commit is contained in:
Ryan Dick 2023-11-27 11:30:00 -05:00
parent e1c53a2465
commit 9b4e6da226

View File

@ -1178,31 +1178,33 @@ class BlendLatentsInvocation(BaseInvocation):
version="1.0.0", version="1.0.0",
) )
class CropLatentsInvocation(BaseInvocation): class CropLatentsInvocation(BaseInvocation):
"""Crops latents""" """Crops a latent-space tensor to a box specified in image-space. The box dimensions and coordinates must be
divisible by the latent scale factor of 8.
"""
latents: LatentsField = InputField( latents: LatentsField = InputField(
description=FieldDescriptions.latents, description=FieldDescriptions.latents,
input=Input.Connection, input=Input.Connection,
) )
width: int = InputField( width: int = InputField(
ge=64, ge=1,
multiple_of=LATENT_SCALE_FACTOR, multiple_of=LATENT_SCALE_FACTOR,
description=FieldDescriptions.width, description="The width (in px) of the crop rectangle in image space. This value will be converted to a dimension in latent space.",
) )
height: int = InputField( height: int = InputField(
ge=64, ge=1,
multiple_of=LATENT_SCALE_FACTOR, multiple_of=LATENT_SCALE_FACTOR,
description=FieldDescriptions.width, description="The height (in px) of the crop rectangle in image space. This value will be converted to a dimension in latent space.",
) )
x_offset: int = InputField( x_offset: int = InputField(
ge=0, ge=0,
multiple_of=LATENT_SCALE_FACTOR, multiple_of=LATENT_SCALE_FACTOR,
description="x-coordinate", 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_offset: int = InputField(
ge=0, ge=0,
multiple_of=LATENT_SCALE_FACTOR, multiple_of=LATENT_SCALE_FACTOR,
description="y-coordinate", 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.",
) )
def invoke(self, context: InvocationContext) -> LatentsOutput: def invoke(self, context: InvocationContext) -> LatentsOutput: