What is SAM 3 / 3.1?

SAM 3 is a new model in Meta's Segment Anything Model series.

Earlier SAM models only knew the shapes of things, so to cut out a specific object, you had to point to its location with a BBOX or coordinates.

With SAM 3, you can name the target in text, like with a VLM, and it handles the segmentation entirely on its own.

SAM 3.1 is an updated version of SAM 3. It improves tracking of multiple objects in video.


Model Download

📂ComfyUI/
└── 📂models/
    └── 📂checkpoints/
        └── sam3.1_multiplex_fp16.safetensors

workflow

Still Image

sam3_1.json
  • Input the image, mask, and target information (text prompt, BBOX, coordinates) into the SAM3 Detect node.
  • This part is a little confusing: if several objects match the prompt, just writing car detects only the most likely one.
    • If you want to segment up to the N-th item, write it like car:N.
    • If you just want everything on screen that matches, you can simply write something like car:99.

Video

sam3_1_video.json
  • Use the SAM3 Video Track node.
  • Pass the output to the SAM3 Track to Mask node to use it as a mask.
  • The SAM3 Track Preview node takes an image and track_data, then colors the masked area so it is easier to see.