ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

kornia: why copy instead of import?

Open ducha-aiki opened this issue 1 year ago • 3 comments

Hi folks,

I am one of the kornia maintainers. I wonder is there any reason why you choose to copy from the kornia https://github.com/comfyanonymous/ComfyUI/blob/02409c30d9ea5314e5103d03f7c9933fa1012659/comfy_extras/nodes_canny.py#L1 instead of just importing it? If you have any issues with import, we can surely fix them. Also, by importing kornia, that would be very easy to use lots of image (pre)processing algorithms on GPU, like transforms, many blurs, morphology, etc.

-- Best, Dmytro.

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

Sorry about that. I was planning on adding some more image processing nodes and properly importing either opencv or kornia and getting rid of that copy paste but never got around to doing it.

comfyanonymous avatar Feb 12 '24 15:02 comfyanonymous

No problem, we all know how overwhelming is open source development. If you have some list of image processing nodes in mind, we can do PR adding them, as well as making Canny import. How does it sound?

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

@comfyanonymous I took a liberty of creating PR myself. It migrates Canny, and also adds morphology nodes, which, as far as I know, are not implemented in other library for RGB images (OpenCV only supports b&w). Let me know, if you like it and/or need other image processing nodes. https://github.com/comfyanonymous/ComfyUI/pull/2781

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