spacepxl / ComfyUI-Florence-2

Florence-2 image captioning and tasks
https://huggingface.co/microsoft/Florence-2-large
MIT License
37 stars 3 forks source link

added Florence2PostprocessMasks, which merges all masks and returns only mask #5

Closed shole closed 1 week ago

shole commented 1 week ago

Especially with openvocab there can be an unknown number of results and identification is not necessary. This node simply merges all masks, with no other output.

In my use I haven't been able to produce more than one polygonal mask so that has not been taken into account. If multiple polygonal masks are possible this will need to be fixed.

spacepxl commented 1 week ago

Thanks for the contributions. I'm pretty sure it never returns more than one polygon mask, although I wish that were possible.

spacepxl commented 1 week ago

Hope you don't mind, I renamed the new node to Florence2PostprocessAll to make the functionality more clear, and added the extra outputs for combined labels and bbox. Will be a one time breaking change, but if you replace the old node with the new one, the mask functionality will be exactly the same.

81c7d5f

shole commented 1 week ago

Sure! 👍 I wasn't sure of list syntax for each so I made no effort.