comfyanonymous / ComfyUI

The most powerful and modular stable diffusion GUI, api and backend with a graph/nodes interface.
GNU General Public License v3.0
41.41k stars 4.4k forks source link

Processors for image masks #1160

Open Saquib764 opened 11 months ago

Saquib764 commented 11 months ago

During my work flow, I frequently dilate/erode the masks to get the desired result. Currently, this has to be done outside ComfyUI, in python. It would be convenient to support this natively to speed up experimentation.

h3clikejava commented 10 months ago

I have the same requirement as you, Have you solved it through automation?

Saquib764 commented 10 months ago

Yes, I built a custom block using Kornia library, which works with pytorch tensor data type.

https://kornia.readthedocs.io/en/latest/morphology.html

But it would be nice to have this as native feature.

ducha-aiki commented 4 months ago

https://github.com/comfyanonymous/ComfyUI/pull/2781 This PR doesn't work (yet) for masks, but you can convert masks to images, process, and then convert back