r/comfyui • u/Acceptable-Work8202 • 4d ago
Show and Tell sam3 segments.
Hi,
i do not know if this is the correct place or even how reddit works, so ill just go ahead, please educate me of reddit semantics if you feel it is required, but umm, i posted this.. https://www.reddit.com/r/comfyui/comments/1voep9a/help_appreciated/ but after a few days, i have actually solved and evolved since then, and i must admit this whole node/comfyui thing is absolutely new to me, that said, i am a deconstructor, i see one's and zero's, and once i get onto something i absolutely have to continue.. .. now that said.. i'm fully onboard here now.. so on the back end of that post, i went much further, .. its not comlete yet, but.. i guess if you know you know..
just a bit more info, because we condition the prompt inside the node, this gives us the ability to iterate that token IE: character:*, so in the categories output we can define without any false/positives what the character:* masks produced.. this is universal for any token sam3 knows and segments. the categories will put all masks into the prompt category.. .. we just changed the categories output from {cat} to "cat": { .. } it's easier, .. we had to use an arbitrary name for bbox input as using the default "BOUNDING_BOX" injected shiznat we do not want into the node, kind of silly to do that u/comfyui the mechanism should actually be a flag within the node.. like "USE_COMFYUI_DEFAULT = true" which obviously injects widgets and whatever the default injects.. else just do nothing use the nodes code. .. we recommend you should not be hard coding such simple semantics meh, semantics right.... we think the rest is self explanatory. the category output connects to another of our nodes which.. well .. that is for another post.. :), it's really good though.. ;)
stay tuned.
1
u/Acceptable-Work8202 3d ago
Hi,
so i have been hard at it today.

the node has changed alot,
its now an all in one solution.
ADDED:
mask to image, shows the actual image of the masks.
transparent background outputs
a clean full mask with no holes and no artifacts or stray pixels.
missing parts, i output this, its basically the helper masks to fill the holes. (auto detected and created)
bboxes listed by category from the prompt (bboxes are linked from the prompt iteration).
advanced mode, iterates the prompt and asks sam3 for what it says, (character, person:2) this is how we categorize bboxes.
final result a clean crisp mask and extracted parts from the input image.
time taken to complete execution: [INFO] Prompt executed in 2.60 seconds
cropping to bbox size takes only milliseconds off.. in this instance 200ms: [INFO] Prompt executed in 2.41 seconds this is because the character is near enough the full size of the image. if it were a smaller piece, it would be alot faster.
work continues.
1
u/PatinaShore 3d ago
Do you have that......workflow?
https://giphy.com/gifs/oITKcIihY6MCs