Acly / comfyui-inpaint-nodes

Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint & outpaint areas.
GNU General Public License v3.0
490 stars 35 forks source link

fill masked area is actually smaller than the input mask #39

Closed whmc76 closed 2 months ago

whmc76 commented 2 months ago

Especially when I use the fill method, which will keep the pixels on the edge of the original image, it is difficult for me to change the color of a piece of clothing through this method. White clothes will always be filled with white pixels.

9fa5343ffda9d0ffa9949be15229e54

falloff should at least support negative input to offset the result of shrinking the mask range inward. If I want to fill the background color to change the image, this would be more reasonable. In most cases, neutral will produce a relatively obvious boundary with the background edge.

i make a mask like this image but i got this

4a44996499057a0fe279c6254179d03

and this

cd999e2fea688601f8d849284ed2c0e

i have to grow the mask to get expect result

1b405f48572db6d4cf267fbc6a01cd4
Acly commented 2 months ago

You always get the fill where the mask is perfectly white. Outside of the area there is optional blending according to the falloff parameter.

So there is no shrinking, and negative falloff doesn't make sense. What you're seeing is that your mask has some smoothing and mask areas that aren't 100% white are not filled. This is intentional, to avoid any grey areas getting less than 100% denoise strength (it results in color skew and visible borders).

Using mask grow is a solution, or make sure your mask fully covers the area (without blur!) in the first place.

whmc76 commented 2 months ago

Ok, thanks for your reply. This is reasonable. I'll take a look and optimize the pre-steps.