Meta SAM 3 Playground

Prompting guide · SAM 3 and SAM 3.1

Meta SAM 3 Prompts: How to Segment Anything with Text, Examples and Clicks Type a short phrase, box an example, or click. SAM 3 finds, segments and tracks exactly the objects you mean, in images and video.

Meta SAM 3 segmenting objects from a text prompt

At a glance

SAM 3 Prompts in Six Points

Texta short noun phrase, such as “red cars”
Examples+ and − boxes: “like this, not that”
Clickspoints, boxes or masks on one object
Every matchtext and examples return all instances
Mix themtext plus a negative box in one request
Same in 3.1SAM 3.1 uses the same prompts

Basics

What Is a Prompt in Meta SAM 3?

A prompt is the hint you give SAM 3 about what to segment. From one prompt, SAM 3 can find every matching object, outline each one with a mask, and, in video, keep tracking them.

one phrase · every match
Animation: one text prompt finds every matchThe prompt “yellow school bus” is typed. In a street scene with three yellow buses, a red bus and a blue van, the three yellow buses are masked one after another and numbered 1 to 3. The red bus and the van are left alone. id 1id 2id 3 text › “yellow school bus” 3 found ✓
Illustration: “yellow school bus” masks the three yellow buses and skips the red bus and the van.

Three kinds of hint

  • A short text phrase, such as “yellow school bus”, “striped cat” or “players in red jerseys”.
  • Example boxes drawn around objects you want (positive) or don’t want (negative).
  • Visual prompts: clicks, a box or a mask on one object, as in SAM 1 and SAM 2.

Two task modes. Text and example boxes run Promptable Concept Segmentation (PCS): find all instances. Clicks run Promptable Visual Segmentation (PVS): segment one object. Both live in the same SAM 3 model.

Prompt types

The Prompt Types, and When Each One Fits

Pick the prompt by the question you are asking: “every X”, “things like this”, or “this one”.

text · examples · click
Animation of the three prompt typesA warehouse shelf with four blue bins, a teal bin and a red bin. The text prompt “blue bins” selects the four blue bins. A positive example box on one blue bin plus a negative box on the teal bin gives the same four. A single click selects only the bin that was clicked. text › “blue bins”every match · 4 bins + − examples › + this, − not thislook-alikes of + · 4 bins click › just this binone object · 1 bin
Illustration: the same shelf prompted three ways.

Text prompts: “every X”

Short noun phrases, optionally with an attribute: “red cars”, “blue recycling bins”. Open vocabulary, so you are not limited to a fixed label list. Returns every match, each with its own mask and ID.

Example boxes: “things like this”

Box one object and SAM 3 finds look-alikes. Add negative boxes to leave out confusions. Best when the concept is rare, hard to name, or a specific product or logo.

Clicks, boxes, masks: “this one”

Positive clicks on the object, negative clicks on background, a rough box, or an existing mask to refine. Best when you want precise edges on one object.

Two modes

PCS vs PVS: Which Mode Do You Need?

Most workflows start with PCS to find everything, then use PVS clicks to polish the objects that matter.

PCS ↔ PVS
Animation comparing PCS and PVSThe same park scene with three dogs. In PCS mode the text “dog” masks all three dogs with IDs 1 to 3. In PVS mode a click on one dog masks only that dog. id 1id 2id 3 PCS · text › “dog” all instances PVS · click › one dog one instance
Illustration: the same scene in each mode.
PCS (concepts)PVS (visual)
PromptText, example boxes, or bothClicks, a box or a mask
FindsEvery matching objectOne object per prompt
OutputMasks, boxes, scores, an ID eachA detailed mask
Good for“Every dog”, counting, labellingOne product shot, one person
Earlier modelsNew in SAM 3Like SAM 1 and SAM 2

Deeper dive: segmentation guide · select specific objects

Example boxes

Positive and Negative Example Boxes

Examples teach SAM 3 a concept by showing it. Negatives are the quickest fix when a text prompt grabs look-alikes.

“solar panels” + one negative
Animation of positive and negative example boxesAn aerial view of roofs with five solar panels and two skylights. Step 1: the text “solar panels” also picks up the skylights. Step 2: a negative box on one skylight is added. Step 3: only the five solar panels remain selected. 7 found · 2 wrong − not thisadding a negative box… 5 panels ✓ skylights dropped text › “solar panels”
Illustration: a negative box on a skylight drops the skylights.
  • Positive box: “find more like this”. Draw it tight around a clean, typical example.
  • Several positives help when the category varies, such as a product seen from different angles.
  • Negative box: “not like this”. Box one wrong object; similar wrong objects drop out too.
  • Boxes, not masks. SAM 3’s concept examples are boxes. Masks are used as visual prompts on a single object.

Use examples when words fail: rare parts, a specific logo, or two types that look alike.

Combining prompts

Combining Text, Examples and Clicks

You can mix prompt types. Each one has a job:

  1. 1Start with text“players” finds every player, and maybe referees too.
  2. 2Add a negative boxBox one referee and mark it negative; the referees drop out of the set.
  3. 3Add a positive box if neededBox one player in the exact kit you want, to focus on that team.
  4. 4Click to fix single masksClicks refine the edges of one object (PVS). They don’t add or remove whole groups; use example boxes for that.

In Hugging Face Transformers, a text prompt and a negative box can go in the same request, for example “handle” minus the oven handle.

Writing prompts

How to Write Text Prompts That Work

SAM 3 is trained on short noun phrases. Specific beats long.

✓ Do

  • red basketball jerseys
  • goalkeepers in green
  • wooden tables
  • blue plastic bins

✗ Avoid

  • please find all the players wearing red basketball jerseys
  • cool objects
  • the second car from the left
  • cars, bikes and people
  • Name the thing, then add one or two attributes: colour, material, role.
  • One concept per prompt. For cars, bikes and people, run three prompts.
  • Position and relationships (“behind the dog”, “leftmost”) need SAM 3 Agent, not a plain prompt.
  • No results? Try a simpler or more common word, then add an example box. See empty masks.

Refining

Refine in a Loop

SAM 3 is built for quick back-and-forth. You rarely need more than a couple of rounds.

prompt → check → refine
Animation of the prompt refinement loopA loop of four steps: prompt with text or examples, check the masks, refine with more examples or clicks, and use the result once it is right. A dot travels around the loop. 1 · Prompt2 · Check3 · Refine4 · Use text or examples→ review masks→ + / − boxes or clicks
Illustration: the refinement loop.
  1. 1PromptText or an example box (PCS).
  2. 2CheckLook for missed objects, wrong objects and rough edges; in video, check tracking too.
  3. 3RefinePositive boxes for misses, negative boxes for wrong picks, clicks for edges.
  4. 4UseExport masks or move on. See export masks.
  • Clicks: start with one or two; add corrections only where the mask is wrong.
  • Thin or small parts: zoom in and add a positive click along the edge. More in improve mask quality.

Recipes

Example Prompt Recipes

Video edit: isolate the players

  1. Text: football players
  2. Negative box on a referee if they’re included.
  3. Click one player for a hero-shot mask.

See video segmentation

Robotics: pick the right bins

  1. Text: blue plastic bins
  2. Positive box on one correct bin.
  3. Pass masks and IDs to grasp planning.

See use cases

Labelling: a tricky class

  1. Text: solar panels on aerial images.
  2. Negative box on a skylight.
  3. Export masks to train a small, fast model.

See mask formats

Under the hood

How SAM 3 Reads Your Prompt

Each kind of prompt is encoded, then combined with the image. A presence check stops SAM 3 inventing objects that aren’t there.

prompt → masks · simplified
Animated diagram of how SAM 3 reads a promptThe image goes through the vision encoder; the text phrase through the text encoder; example boxes through the exemplar encoder. A fusion step combines them. A presence check asks whether the concept is in the image at all, and the detector outputs a mask, box and score for every match. Vision encoderimage / frame Text encoder“solar panels” Exemplar encoder+ / − boxes Fusionprompt meets image Detectorfinds each match Presence checkis it here at all? mask + box + score simplified · each stage lights up in turn
Simplified diagram based on Meta’s SAM 3 paper.
  • Encoders: one for the image, one for the text phrase, one for example boxes.
  • Fusion: the prompt is matched against the image features.
  • Presence check: first decides whether the concept is in the image at all, which cuts false matches for similar phrases.
  • Training data: the SA-Co data has over 4 million unique concept phrases, including hard negatives (phrases that are not in the image).
  • Result: Meta reports about a 2× gain over earlier systems on its SA-Co concept benchmark.

A text prompt in code

from PIL import Image
from sam3.model_builder import build_sam3_image_model
from sam3.model.sam3_image_processor import Sam3Processor

model = build_sam3_image_model()
processor = Sam3Processor(model)

state = processor.set_image(Image.open("street.jpg"))
output = processor.set_text_prompt(state=state, prompt="yellow school bus")

masks, boxes, scores = output["masks"], output["boxes"], output["scores"]

From the official sam3 repository. Setup: install SAM 3 · Python tutorial

Limits

Limits and Gotchas

Prompting fixes a lot, but not everything.

Where plain prompts struggle

  • Vague words: “cool objects”, “interesting shapes”.
  • Reasoning and position: “the person standing behind the dog”, “the tallest building”.
  • Near-identical types, such as two similar logos: expect manual cleanup.
  • Specialist fields such as medical imaging, where everyday words don’t apply.
  • Video length: Meta defines the task on images and short clips (up to about 30 seconds). Split longer footage.

What to do instead

  • Be specific and add an example box.
  • Use SAM 3 Agent for complex requests: a multimodal language model turns them into simple phrases for SAM 3.
  • Fine-tune for a specialist domain. MedSAM3, a research model, adapts SAM 3 to medical concepts. See fine-tuning.
  • More: all limitations

Questions

SAM 3 Prompts FAQ

What is a prompt in Meta SAM 3?

A prompt is the hint you give SAM 3 about what to segment. It can be a short text phrase such as “yellow school bus”, one or more example boxes around objects you want (or don’t want), or classic clicks, boxes and masks on a single object.

What makes a good SAM 3 text prompt?

A short noun phrase with the attributes that matter, such as “red basketball jerseys” or “wooden tables”. Avoid full sentences and instructions like “please find…”. SAM 3 is trained on short phrases, not long descriptions.

Can SAM 3 understand long or complex prompts?

Not on its own. Requests like “the person standing behind the dog” need reasoning about position or relationships. For those, SAM 3 Agent pairs SAM 3 with a multimodal language model that breaks the request into simple phrases SAM 3 can handle.

What is the difference between PCS and PVS?

Promptable Concept Segmentation (PCS) finds every object that matches a text phrase or example boxes. Promptable Visual Segmentation (PVS) segments one specific object from clicks, a box or a mask, the way SAM 1 and SAM 2 work.

How do I stop SAM 3 from selecting the wrong objects?

Add a negative example: draw a box around one wrong object and mark it negative. SAM 3 then drops look-alikes of it. Making the text phrase more specific, such as adding a colour or role, also helps.

Do prompts work the same in SAM 3.1?

Yes. SAM 3.1 uses the same text, example and click prompts. It mainly makes video with many objects faster.

Can I use several concepts in one prompt?

Each text prompt describes one concept. To find cars, bikes and people, run three prompts. In code you can reuse the image features so extra prompts are cheap.

Keep reading

Sources