Meta SAM 3 Playground

Guide · ComfyUI · SAM 3 / 3.1

How to Install SAM 3 in ComfyUI Two clearly separated routes: ComfyUI’s native SAM 3.1 nodes and templates, or the community ComfyUI-SAM3 node pack by PozzettiAndrea. Then a step-by-step image and video workflow you can run right away.

ComfyUI graph
Animation of a SAM 3 node graph in ComfyUIA ComfyUI graph: a Load Image node and a text prompt “person” feed a SAM 3 segmentation node, which outputs a mask to a preview node. Signals pulse along the wires, and the preview shows the guitarist cut out on a transparent background. Load Imageneon_guitarist.png Prompt“person” SAM3 Segmentmodel: sam3.1threshold: 0.5→ MASK Preview (RGBA)
Illustration: image + prompt → SAM 3 → masked preview.

Pick a route

Native Nodes or the Community Pack?

Both run SAM 3 inside ComfyUI. They are separate projects with different nodes; don’t mix their workflows.

two routes
Animated comparison of the two ComfyUI routesTwo lanes fill from left to right. The native route: update ComfyUI, download sam3.1_multiplex_fp16.safetensors, open the built-in template. The community route: install the ComfyUI-SAM3 pack by PozzettiAndrea from the Manager, restart, then load its nodes and model. A · NATIVE (Comfy-Org) · SAM 3.1 update ComfyUINightly if neededdownload modelsam3.1 fp16 · checkpoints/open templateUtility › SAM3 B · COMMUNITY · ComfyUI-SAM3 (PozzettiAndrea) Manager search“ComfyUI-SAM3”install + restartrefresh browseradd SAM3 nodespoints · boxes · text
Illustration of the two setup routes.
A · NativeB · ComfyUI-SAM3
Made byComfy-Org (built into ComfyUI)Community: PozzettiAndrea
ModelSAM 3.1 (fp16 repack)SAM 3 via the pack’s loader
PromptsText (with :N limits)Text, points, boxes, multi-region
InstallUpdate ComfyUI + 1 fileManager or git clone
TemplatesBuilt-in image + videoCommunity workflows
Best forMost users; start hereInteractive point/box selection

Before you start

Prepare ComfyUI

A recent ComfyUI, enough disk, and an NVIDIA GPU.

folder layout
Animated ComfyUI folder layoutA ComfyUI folder tree fills in: models/checkpoints holds sam3.1_multiplex_fp16.safetensors for the native nodes; custom_nodes holds the ComfyUI-SAM3 community pack; input holds images and videos; output holds saved results. ComfyUI/├── models/│ └── checkpoints/│ └── sam3.1_multiplex_fp16.safetensors ← native├── custom_nodes/│ └── ComfyUI-SAM3/ ← community pack├── input/ ← images · videos└── output/ ← saved masks
Illustration of where each file goes.
  • Recent ComfyUI: native SAM 3.1 arrived in a 2026 update; use the latest release, or Nightly if nodes are missing.
  • ComfyUI Manager installed, for the community route and missing nodes.
  • GPU: NVIDIA strongly recommended. System requirements
  • No GPU? Comfy Cloud has ComfyUI-SAM3 preinstalled on managed GPUs.

update ComfyUI

# manual (git) install: update ComfyUI
cd ComfyUI
git pull
pip install -r requirements.txt
# desktop / portable builds: use the built-in updater instead

Route A · Official

Native SAM 3.1 in ComfyUI

Maintained with ComfyUI itself. Recommended for most users.

Official · Comfy-Org
  1. 1Update ComfyUINative SAM 3.1 support needs a recent build; use Nightly if the nodes are missing.
  2. 2Download the modelsam3.1_multiplex_fp16.safetensors from Comfy-Org/sam3.1 into ComfyUI/models/checkpoints/.
  3. 3Open the templateWorkflow → Browse Templates → Utility → “SAM3: Image Segmentation”.
  4. 4Load an imagePut it in ComfyUI/input/ and pick it in the Load Image node.
  5. 5Type a promptA short noun such as person, car or cat; separate several with commas.
  6. 6RunQueue the workflow and check the RGBA mask preview.

download the model (or use the browser link on Comfy-Org/sam3.1)

# from the ComfyUI folder: puts the file in models/checkpoints/
pip install -U huggingface_hub
hf download Comfy-Org/sam3.1 checkpoints/sam3.1_multiplex_fp16.safetensors --local-dir models
ItemValue
Model filesam3.1_multiplex_fp16.safetensors (~1.6 GiB)
SourceComfy-Org/sam3.1 on Hugging Face (SAM License)
FolderComfyUI/models/checkpoints/
Image template“SAM3: Image Segmentation” (utility_image_segment_sam3.json)
Video template“SAM3: Video Segmentation” (utility_video_segment_sam3.json)
WhereWorkflow → Browse Templates → Utility

Route B · Community

Community Integration: ComfyUI-SAM3 by PozzettiAndrea

Use this pack if you want interactive point, box and multi-region selection.

Community · not by Meta or Comfy-Org
ComfyUI-SAM3 by PozzettiAndrea · github.com/PozzettiAndrea/ComfyUI-SAM3

SAM 3 image and video segmentation with text prompts, boxes and points. Version 0.1.21 at the time of writing, with 14 nodes and tens of thousands of installs. It installs its dependencies in an isolated environment using the experimental comfy-env tool, which downloads the pixi package manager.

(down)Load SAM3 ModelSAM3 Text SegmentationSAM3 Point SegmentationSAM3 Point CollectorSAM3 BBox CollectorSAM3 Multi-Region CollectorSAM3 Multiprompt Segmentation

install

# option 1: ComfyUI Manager
#   Manager → Custom Nodes Manager → search “ComfyUI-SAM3” → Install → Restart → refresh browser

# option 2: manual
cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-SAM3
# restart ComfyUI; follow the pack’s README for its one-time dependency setup

if the nodes don’t appear

# nodes missing and the log mentions “pytest mode”? (false positive)
SAM3_FORCE_INIT=1 python main.py
  • Model access: SAM 3 weights are gated; request access first. Hugging Face access
  • Model files: the “(down)Load SAM3 Model” node downloads and loads the model; follow the pack’s README for paths.
  • Updates: update through the Manager; check the repo’s releases for breaking changes.
  • Other community packs exist, e.g. comfyui_sam3 (wouterverweirder) and ComfyUI-TBG-SAM3 (Ltamann), plus ComfyUI-SAM3DObjects (PozzettiAndrea) for 3D. Use one SAM 3 pack at a time.

Tested workflow

Step-by-Step: Your First SAM 3 Mask in ComfyUI

This uses the official native template, so it doesn’t depend on custom nodes. Comfy-Org ships and documents it with its sample image.

  1. 1OpenWorkflow → Browse Templates → Utility → SAM3: Image Segmentation.
  2. 2Check the modelThe loader should list sam3.1_multiplex_fp16.safetensors; if it’s red, the file isn’t in models/checkpoints/.
  3. 3Load an imageKeep the template’s neon_guitarist.png for a first test, or choose your own from ComfyUI/input/.
  4. 4PromptType person.
  5. 5RunClick Run / Queue. The first run loads the model and is slower.
  6. 6CheckThe preview shows the person on a transparent (RGBA) background. Then try guitar, or person, guitar.

We documented this from Comfy-Org’s official template and guide; we did not run it on our own hardware. Node names can change between ComfyUI releases, so trust the template over screenshots.

Prompts

How to Prompt SAM 3 in ComfyUI

Short, concrete nouns work best. Two bits of syntax do the rest.

prompt syntax
Animation of ComfyUI SAM 3 prompt syntaxThe prompt “eye:2, window panels:4” splits at the comma into two subjects. Each keeps at most the number after the colon: two eyes and four window panels are masked. A note says prompts are limited to 32 tokens. eye:2, window panels:4 eye:2window panels:4 comma = new subject · :N = max detections · 32-token limit
Illustration of multi-subject prompts with limits.
  • Several subjects: separate with commas: person, guitar.
  • Limit detections: add :N, e.g. eye:2, window panels:4.
  • Keep it short: prompts are capped at 32 tokens.
  • Be specific: “red car”, not “the car that is red on the left”.
  • More tips: SAM 3 prompts guide

Video

Video Segmentation Workflow

Same idea, across frames: one prompt, masks and boxes for every frame.

video workflow
Animated ComfyUI video segmentation workflowA Load Video node feeds a SAM3 Video Track node with the prompt “unicorn”. Below, a strip of frames fills in one by one, each with the tracked subject masked and a bounding box. Load Videodrinking_unicorn.mp4 SAM3 Video Track“unicorn” masks + boxesper frame feed the masks into inpainting, compositing or background removal
Illustration of the native video template.
  1. 1TemplateUtility → SAM3: Video Segmentation.
  2. 2Load VideoStart with the sample drinking_unicorn.mp4, then your own clip.
  3. 3PromptDescribe what to track, e.g. unicorn.
  4. 4RunOutput: masks and bounding boxes for each frame.

Long or high-resolution clips need lots of VRAM; trim first. Slow tracking

Use the masks

What to Do With the Masks

Common recipes

  • Background removal: mask → alpha → save PNG.
  • Inpainting: mask → inpaint nodes to replace or remove an object.
  • Compositing: mask a subject and place it on a new background.
  • Video effects: per-frame masks for colour grading or blur.

Customise

  • The templates use Subgraph nodes; open them to tweak thresholds and outputs.
  • Save your edited graph as your own workflow.
  • Export masks for other tools. Mask formats
  • Background removal guide

Troubleshooting

ComfyUI SAM 3 Problems and Fixes

SymptomRouteFix
No SAM3 templates or nodesNativeUpdate ComfyUI; try Nightly; check the startup log for import errors
Model loader shows red / not foundNativePut the file in ComfyUI/models/checkpoints/, then refresh
Nodes missing, log says “pytest mode”ComfyUI-SAM3Start with SAM3_FORCE_INIT=1
Red nodes after loading a shared workflowEitherManager → Install Missing Custom Nodes, restart, refresh the browser
401 / gated error on downloadComfyUI-SAM3Request access and log in. Model access
Empty maskEitherShorter noun; check the subject is visible. Empty masks
Out of memoryEitherSmaller images, shorter clips, fewer subjects. OOM fixes
Two SAM 3 packs conflictCommunityKeep one SAM 3 pack enabled at a time

Questions

ComfyUI SAM 3 FAQ

Does ComfyUI support SAM 3 natively?

Yes. Native SAM 3.1 support was added to ComfyUI, with built-in “SAM3: Image Segmentation” and “SAM3: Video Segmentation” templates. Update ComfyUI first; if the nodes are missing, try the Nightly build.

Which model file does native ComfyUI SAM 3 use?

sam3.1_multiplex_fp16.safetensors from the Comfy-Org/sam3.1 repository, placed in ComfyUI/models/checkpoints/.

What is ComfyUI-SAM3?

A community node pack by PozzettiAndrea (github.com/PozzettiAndrea/ComfyUI-SAM3) that adds SAM 3 image and video segmentation with text prompts, boxes and points, including point, box and multi-region collector nodes. It is not made by Meta or Comfy-Org.

Should I use the native nodes or ComfyUI-SAM3?

Start with the native nodes and templates: they’re maintained with ComfyUI and use SAM 3.1. Use ComfyUI-SAM3 if you need its interactive point, box and multi-region collectors or a workflow built for it.

How do I prompt SAM 3 in ComfyUI?

Use short nouns. Separate several subjects with commas and limit detections with :N, for example “eye:2, window panels:4”. Prompts are capped at 32 tokens.

Why don’t the ComfyUI-SAM3 nodes appear?

Check the startup log for import errors. If it says it is running in pytest mode, that is a false positive: set SAM3_FORCE_INIT=1 before starting ComfyUI.

Can I use SAM 3 in ComfyUI without a GPU?

Comfy Cloud has the ComfyUI-SAM3 pack preinstalled on managed GPUs. Locally, an NVIDIA GPU is strongly recommended.

Keep reading