Comfy-Org / Comfy-Org/ComfyUI

Inpainting color change

Open
#2,827 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

Hello,

I tried the hi-res fix example using Inpainting:
https://comfyanonymous.github.io/ComfyUI_examples/2_pass_txt2img/

The inpainting result looks good but original pixels outside mask are pixelated which also makes sense because I downscaled 1024 image to 512 made the Inpainting and used Latent Upscale coming back to 1024. The whole workflow looks very similar but I used normal non inpainting model + Inpainting VAE Encode + non inpainting model for second sampler.
This is mask and result:

![clipspace-mask-899862 5](https://github.com/comfyanonymous/ComfyUI/assets/4406586/578e70fd-8586-4b76-ab33-942dda33a9ac)

![ComfyUI_temp_siotg_00063_](https://github.com/comfyanonymous/ComfyUI/assets/4406586/96c76d5e-e0e5-44d7-8883-1b57a3fb74ec)

To solve the issue I added LatentCompositionMasked node which might be same as "apply_overlay" parameter in Diffuser project and got this result:
![ComfyUI_temp_siotg_00062_](https://github.com/comfyanonymous/ComfyUI/assets/4406586/bcc37155-334c-48ab-b28e-f016783c1c00)

This looks not so bad (beside the masked edges at the lower left but my mask is quite large - so this is just as it is).
Now comes the problem the whole image gets an drastic color change here putting it in original context:

![Screenshot 2024-02-18 170416](https://github.com/comfyanonymous/ComfyUI/assets/4406586/7ca98013-dc8a-4d39-8f60-a246507e18fa)

This is a known problem other servers have but overall it is solved more than a year ago. So I am wondering why there isn't any example showing hires fix+ Inpainting on 1.x at all for ComfyUI in whole internet. Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.