Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyixuxu committed Nov 17, 2024
1 parent 10956e6 commit be5695c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/diffusers/image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def apply_overlay(

init_image_masked = PIL.Image.new("RGBa", (width, height))
init_image_masked.paste(init_image.convert("RGBA").convert("RGBa"), mask=ImageOps.invert(mask.convert("L")))

init_image_masked = init_image_masked.convert("RGBA")

if crop_coords is not None:
Expand All @@ -810,15 +810,14 @@ def apply_overlay(
image = self.resize(image, height=h, width=w, resize_mode="crop")
base_image.paste(image, (x, y))
image = base_image.convert("RGB")
image = image.convert("RGBA")

image = image.convert("RGBA")
image.alpha_composite(init_image_masked)
image = image.convert("RGB")

return image



class VaeImageProcessorLDM3D(VaeImageProcessor):
"""
Image processor for VAE LDM3D.
Expand Down

0 comments on commit be5695c

Please sign in to comment.