From b728b778c85852002647a74bfe36b166ba84c72d Mon Sep 17 00:00:00 2001 From: Meatfucker <74834323+Meatfucker@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:01:51 -0400 Subject: [PATCH 1/3] Update pipeline_flux_inpaint.py to fix padding_mask_crop returning only the inpainted area and not the entire image. --- src/diffusers/pipelines/flux/pipeline_flux_inpaint.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py index a67eb5d0d646..6ab1c27484c1 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py @@ -1193,6 +1193,10 @@ def __call__( image = self.vae.decode(latents, return_dict=False)[0] image = self.image_processor.postprocess(image, output_type=output_type) + # Copied from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl_inpaint + if padding_mask_crop is not None: + image = [self.image_processor.apply_overlay(mask_image, original_image, i, crops_coords) for i in image] + # Offload all models self.maybe_free_model_hooks() From 5550679a7e60e85cbd8dbee8ff9a2368ce5bbf2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 9 Jun 2025 21:07:46 +0000 Subject: [PATCH 2/3] Apply style fixes --- src/diffusers/pipelines/flux/pipeline_flux_inpaint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py index 6ab1c27484c1..34f54110770e 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py @@ -1195,7 +1195,9 @@ def __call__( # Copied from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl_inpaint if padding_mask_crop is not None: - image = [self.image_processor.apply_overlay(mask_image, original_image, i, crops_coords) for i in image] + image = [ + self.image_processor.apply_overlay(mask_image, original_image, i, crops_coords) for i in image + ] # Offload all models self.maybe_free_model_hooks() From 0323139ba35805bea17c55988e72bb35105108aa Mon Sep 17 00:00:00 2001 From: Meatfucker <74834323+Meatfucker@users.noreply.github.com> Date: Mon, 9 Jun 2025 19:52:11 -0400 Subject: [PATCH 3/3] Update src/diffusers/pipelines/flux/pipeline_flux_inpaint.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Álvaro Somoza --- src/diffusers/pipelines/flux/pipeline_flux_inpaint.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py index 34f54110770e..29c763a6b17b 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py @@ -1193,7 +1193,6 @@ def __call__( image = self.vae.decode(latents, return_dict=False)[0] image = self.image_processor.postprocess(image, output_type=output_type) - # Copied from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl_inpaint if padding_mask_crop is not None: image = [ self.image_processor.apply_overlay(mask_image, original_image, i, crops_coords) for i in image