-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid Re-running Segmentation if Mask is Already Available #49
Comments
I don't really understand sorry... you are saying it runs segmentation again when you are trying to use the resulting masks with something else? I can't replicate that behavior, for me it works like everything else in Comfy: it runs it again only if the inputs change. |
I don't know, maybe it interferes with some other custom nodes. 2024-11-23.17-50-24_small.mp4RemoveBackground and the ImagePreview of the 16 frames are read from the cache, but Sam2VideoSegmentation keeps running the segmentation over and over again. I have just updated ComfyUI and all nodes, so everything should be up to date. |
I have no idea... definitely not how it works for me... pretty much with same nodes too, using the example video workflow. |
Alright, that's strange. I'll try to investigate this further—thank you so much for your response! I’ll disable some custom nodes to check if they might be causing the issue. If I figure out what’s going on, I’ll get back to you. Thanks again for your help! |
Ah, okay, that makes the difference: Sam2Segmentation caches! Sam2VideoSegmentation, on the other hand, runs every time. I didn’t realize that I could also use Sam2Segmentation for the workflow. Thanks for clarifying! Should I leave the issue open? For me, it’s resolved. I don’t fully understand it, but I think I can continue working this way. ;) |
Ahhh sorry didn't notice and completely forgot about that node, I never finished it so it probably has such quirks... the idea was to allow multiple points within different frames on the video, just never finished it. |
Ok, since my workflow processes videos, Sam2Video... well, it was the obvious choice. 😄 |
Hi @kijai,
First of all, thank you so much for your tireless effort in bringing such amazing models to ComfyUI.
It's always a delight to see the incredible things you’ve been working on.
The workflow works really well for me, but I’ve noticed one thing:
For example, when using
Sam2VideoSegmentation
to generate a good mask, the segmentation process is re-executed for every queue run, even if a mask already exists and the coordinates as well as the input image haven’t changed.Is there a way to skip the segmentation process if a mask is already present at the output?
The mask I generated is already good, so the node wouldn’t need to run again each time—or am I missing something here?
I hope my explanation makes sense.
Thank you again for your amazing work!
Edited:
A sorry, I forgot to mention:
I have three segmentations running for different parts of the video.
but my workflow looks like this (example node setup):
The text was updated successfully, but these errors were encountered: