Skip to content

Commit 1d2204d

Browse files
clarkkent0618rootasomozayiyixuxu
authored
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 <[email protected]> Co-authored-by: yiyixuxu <[email protected]>
1 parent d38c50c commit 1d2204d

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)