ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Processors for image masks

Open Saquib764 opened this issue 2 years ago • 3 comments

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.

Saquib764 avatar Aug 08 '23 16:08 Saquib764

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

h3clikejava avatar Aug 25 '23 01:08 h3clikejava

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.

Saquib764 avatar Sep 06 '23 09:09 Saquib764

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

ducha-aiki avatar Feb 12 '24 21:02 ducha-aiki