Open Clement-Lelievre opened 2 weeks ago
PyTorch 3.2.0? That sounds like invalid.
PyTorch 3.2.0? That sounds like invalid.
torch==2.4.1
cc @asomoza
I believe it's due to VAE encode/decode. It's not a bijective method. If confirmed, a blend with the decoded image at the end will solve the difference.
That can be done but it would require changing Pipelines including all ControlNets and Inpainting pipelines because they all have the same difference.
I believe it's due to VAE encode/decode. It's not a bijective method. If confirmed, a blend with the decoded image at the end will solve the difference.
I believe it's due to VAE encode/decode. It's not a bijective method. If confirmed, a blend with the decoded image at the end will solve the difference.
@christopher5106 can this be apply to controlnet inpainting? is this method same as apply_overlay?
what is different?
Right, you can use apply_overlay on the final PIL image in both inpaint and controlnet inpaint pipelines to correct the small VAE differences. But I would apply the mask directly on the image tensor before postprocess just after decode and probably not on PIL object
...
image = self.vae.decode(latents, return_dict=False)[0]
image = (1 - init_mask) * init_image + init_mask * image
image = self.image_processor.postprocess(image, output_type=output_type)
...
... image = self.vae.decode(latents, return_dict=False)[0] image = (1 - init_mask) * init_image + init_mask * image image = self.image_processor.postprocess(image, output_type=output_type) ...
What are the advantages of doing it this way? Compared to directly applying overlay? Also, can this be applied to control networks?
i'm trying to apply this into controlnet by only copy this line
image = self.vae.decode(latents, return_dict=False)[0]
to pag controlnet pipeline, but i got a grayish result
I have issues too, parts of the original image (black parts) show up on the inpainted image.
Removing this line "solves" this, but seems to damage the diffusion process
latents = (1 - init_mask) * init_latents_proper + init_mask * latents
Describe the bug
When inpainting (with diffusers==0.31.0 and torch==2.4.1) using
FluxInpaintPipeline
, I get some pixels outside the mask (and pretty far away from the mask border) that are overrided whereas the mask at their indices was black. With either flux schnell or dev.Is this expected?
I could paste the output image on the input image using the mask to get rid of this, but I'd like to check first if this is a bug or not.
Here is my input image and mask:
Here is the kind of diff I get:
Reproduction
I am using a small, square (224*224) image (see above), and a non-rectangular mask that has values only in {0, 255}.
Logs
No response
System Info
Who can help?
@asomoza @sayakpaul