How to merge multiple masks generated using multiple prompts?
I use the prompt word (human. cup) to obtain the mask of the person holding the cup, but GroundingDino outputs the masks of the person and the cup separately. How to merge these two masks together and output a mixed mask?
The mask example is as follows:
Original drawing:
Output segmentation results:
- For some reason, it worked when I used a period (.) instead of a comma (,).
- If it doesn’t work, it’s reliable to create a mask for each word and combine the masks with the MaskComposite node.
- 出于某种原因,当我使用句点 (.) 而不是逗号 (,) 时它起作用。
- 如果它不起作用,则为每个单词创建一个掩码并将掩码与 MaskComposite 节点组合在一起是可靠的。
Thank you for your answer. I already know that using the symbol (.) can separate two masks.
However, when using this symbol to separate two words, ComfyUI outputs two separate masks and cannot merge them. I hope these two masks can be merged into one image, and their relative positions will be the same as the original image. Is there a solution to this situation?
This is my workflow:
The situation I want (from someone else's example, but I don't know how to set it up):
SAM_MaskComposite.json
- For some reason, it worked when I used a period (.) instead of a comma (,).
- If it doesn’t work, it’s reliable to create a mask for each word and combine the masks with the MaskComposite node.
not working for me (.) and (, ) get the same result ,only 1 pic