added a few comments to document design choices

This commit is contained in:
Lincoln Stein
2024-05-29 19:45:38 -04:00
committed by Kent Keirsey
parent f13427e3f4
commit 493f81788c
4 changed files with 11 additions and 5 deletions

View File

@ -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(