mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(nodes): temp disable canvas output crop
This commit is contained in:
parent
de96f97e5f
commit
30d318d021
@ -1048,14 +1048,30 @@ class CanvasV2MaskAndCropInvocation(BaseInvocation, WithMetadata, WithBoard):
|
|||||||
image = context.images.get_pil(self.image.image_name)
|
image = context.images.get_pil(self.image.image_name)
|
||||||
mask = self._prepare_mask(context.images.get_pil(self.mask.image_name))
|
mask = self._prepare_mask(context.images.get_pil(self.mask.image_name))
|
||||||
image.putalpha(mask)
|
image.putalpha(mask)
|
||||||
bbox = image.getbbox()
|
# bbox = image.getbbox()
|
||||||
image = image.crop(bbox)
|
# image = image.crop(bbox)
|
||||||
image_dto = context.images.save(image=image)
|
image_dto = context.images.save(image=image)
|
||||||
|
|
||||||
return CanvasV2MaskAndCropOutput(
|
return CanvasV2MaskAndCropOutput(
|
||||||
image=ImageField(image_name=image_dto.image_name),
|
image=ImageField(image_name=image_dto.image_name),
|
||||||
offset_x=bbox[0],
|
offset_x=0,
|
||||||
offset_y=bbox[1],
|
offset_y=0,
|
||||||
width=image.width,
|
width=image.width,
|
||||||
height=image.height,
|
height=image.height,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# def invoke(self, context: InvocationContext) -> CanvasV2MaskAndCropOutput:
|
||||||
|
# image = context.images.get_pil(self.image.image_name)
|
||||||
|
# mask = self._prepare_mask(context.images.get_pil(self.mask.image_name))
|
||||||
|
# image.putalpha(mask)
|
||||||
|
# bbox = image.getbbox()
|
||||||
|
# image = image.crop(bbox)
|
||||||
|
# image_dto = context.images.save(image=image)
|
||||||
|
|
||||||
|
# return CanvasV2MaskAndCropOutput(
|
||||||
|
# image=ImageField(image_name=image_dto.image_name),
|
||||||
|
# offset_x=bbox[0],
|
||||||
|
# offset_y=bbox[1],
|
||||||
|
# width=image.width,
|
||||||
|
# height=image.height,
|
||||||
|
# )
|
||||||
|
Loading…
Reference in New Issue
Block a user