@@ -659,13 +659,11 @@ def apply_overlay(
659659 overlay the inpaint output to the original image
660660 """
661661
662- width , height = image .width , image .height
663-
664- init_image = self .resize (init_image , width = width , height = height )
665- mask = self .resize (mask , width = width , height = height )
662+ width , height = init_image .width , init_image .height
666663
667664 init_image_masked = PIL .Image .new ("RGBa" , (width , height ))
668665 init_image_masked .paste (init_image .convert ("RGBA" ).convert ("RGBa" ), mask = ImageOps .invert (mask .convert ("L" )))
666+
669667 init_image_masked = init_image_masked .convert ("RGBA" )
670668
671669 if crop_coords is not None :
@@ -676,14 +674,15 @@ def apply_overlay(
676674 image = self .resize (image , height = h , width = w , resize_mode = "crop" )
677675 base_image .paste (image , (x , y ))
678676 image = base_image .convert ("RGB" )
679-
680- image = image .convert ("RGBA" )
677+
678+ image = image .convert ("RGBA" )
681679 image .alpha_composite (init_image_masked )
682680 image = image .convert ("RGB" )
683681
684682 return image
685683
686684
685+
687686class VaeImageProcessorLDM3D (VaeImageProcessor ):
688687 """
689688 Image processor for VAE LDM3D.
0 commit comments