mikkel / comfyui-mask-boundingbox

Create bounding boxes selecting masks by threshold.
27 stars 4 forks source link

Support for extra column from pytorch nonzero #3

Open nykwil opened 8 months ago

nykwil commented 8 months ago

Also put a gitignore.

nykwil commented 8 months ago

Have a fix for the reason this occurred after torch update.

JoeNavark commented 8 months ago

It does run but the behavior is not completely as expected. Cropped image is not centered on mask, and sometimes does not even contain the masked area.

nykwil commented 8 months ago

It does run but the behavior is not completely as expected. Cropped image is not centered on mask, and sometimes does not even contain the masked area.

The bug is the extra column in nonzero, the change to the while loop is just better style so you don't get infinite loops when you get results you aren't expecting. Those new cases should never run when nonzero is working properly.

nykwil commented 6 months ago

Fixed a bug with the bounded mask return which also needs to have the new column if you are using the newer comfy version.

Added a padding feature.

nykwil commented 6 months ago

Fixed another bug if there's another mask format improved min sizes.