Skip to content

Commit 08e5177

Browse files
clarkkent0618rootasomozayiyixuxu
authored andcommitted
Modify apply_overlay for inpainting with padding_mask_crop (Inpainting area: "Only Masked") (#8793)
* Modify apply_overlay for inpainting * style --------- Co-authored-by: root <root@debian> Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com> Co-authored-by: yiyixuxu <yixu310@gmail.com>
1 parent c3698c8 commit 08e5177

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/diffusers/image_processor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,13 +795,11 @@ def apply_overlay(
795795
The final image with the overlay applied.
796796
"""
797797

798-
width, height = image.width, image.height
799-
800-
init_image = self.resize(init_image, width=width, height=height)
801-
mask = self.resize(mask, width=width, height=height)
798+
width, height = init_image.width, init_image.height
802799

803800
init_image_masked = PIL.Image.new("RGBa", (width, height))
804801
init_image_masked.paste(init_image.convert("RGBA").convert("RGBa"), mask=ImageOps.invert(mask.convert("L")))
802+
805803
init_image_masked = init_image_masked.convert("RGBA")
806804

807805
if crop_coords is not None:

0 commit comments

Comments
 (0)