ltdrdata / ComfyUI-Impact-Pack

Custom nodes pack for ComfyUI This custom node helps to conveniently enhance images through Detector, Detailer, Upscaler, Pipe, and more.
GNU General Public License v3.0
1.9k stars 187 forks source link

About the behavior of "From SEG_ELT bbox" #824

Closed bluesura closed 2 hours ago

bluesura commented 8 hours ago

This is a discussion about trying to obtain the bbox position using the following process: mask → MASK to SEGS → Decompose (SEGS) → From SEG_ELT → From SEG_ELT bbox

For example, when obtaining a mask of the ground, there is no issue if the mask is continuous. However, when the mask consists of multiple disconnected parts (e.g., islands), multiple bboxes are generated, leading to multiple processes. While the processes execute without issues, this becomes very troublesome. If you are performing image processing using this setup, multiple images will be generated. Passing these images to the sampler means feeding multiple images, which increases memory consumption significantly.

I also tried combining different nodes to somehow consolidate the multiple images into a single one, but since the processing is not batch-based and occurs separately, it’s challenging to address this. I even tried the combined property in MASK to SEGS, but it resulted in an error when trying to obtain the position with "From SEG_ELT bbox."

Is there any solution to this issue?

ltdrdata commented 7 hours ago

What exactly are you trying to achieve with multiple bboxes?

bluesura commented 6 hours ago

What I am trying to achieve with "From SEG_ELT bbox" is as follows:

・Detect the area to be masked using SAM. ・Place a mask either randomly or at a specific location in the detected area. ・Generate objects in that location using inpainting.

The bbox is used to estimate where the masks detected by SAM are located. While it might be possible to determine the location using other methods, in this case, the environment is restricted to cog-comfyui, and after exploring various options, I arrived at "From SEG_ELT bbox."

bluesura commented 6 hours ago

image

ltdrdata commented 6 hours ago

It seems that using the loop function might offer a possible solution, but additional development would likely be required. I will try implementing some nodes for it in the Inspire Pack later.

bluesura commented 6 hours ago

Thank you for considering this on such short notice. I really appreciate it. I’ll be waiting for your response.

ltdrdata commented 2 hours ago

Update Inspire Pack.

workflow (1)