comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
54.71k stars 5.77k forks source link

[bug] Color of unmasked area changes when using inpainting model node. #1973

Open ParticleDog opened 11 months ago

ParticleDog commented 11 months ago

Color of unmasked area would change when using inpainting model and VAE Encode (for inpainting) node. It is very obvious when the masked area is large. See below: image

Using the inpainting example workflow can easily reproduce it: workflow

You can see the unmasked area's color is significantly changed (the tree's saturation get so high).

apsntian commented 9 months ago

I'm suffering from the very same issue. I've used VAE Encode for inpainting to inpainting, but it always downgrades the quality or changes color of masked area. In A1111, inpainting works well and no problem. why comfyui has some problems in inpainting?

ltdrdata commented 9 months ago

Color of unmasked area would change when using inpainting model and VAE Encode (for inpainting) node. It is very obvious when the masked area is large. See below:

The process of VAEEncode/Decode involves a lossy process. To prevent that, it is necessary to inpaint the masked area and composite only the inpainted mask area onto the original image. That's the principle behind the operation of Detailer.

ParticleDog commented 9 months ago

Color of unmasked area would change when using inpainting model and VAE Encode (for inpainting) node. It is very obvious when the masked area is large. See below:

The process of VAEEncode/Decode involves a lossy process. To prevent that, it is necessary to inpaint the masked area and composite only the inpainted mask area onto the original image. That's the principle behind the operation of Detailer.

That's what I did to try to workaround this. However, in ComfyUI, the saturation of the entire picture increases significantly after large-area inpainting. You'll notice a clear and abrupt color discontinuity after compositing the inpainted mask area onto the original image.