Free web tool · SAM 3 / 3.1 · Official repo
Segment Anything Prompt Studio Open an image or video, type what to find, click objects or draw boxes, and get a ready-to-run script for Meta’s official SAM 3 repo. Then preview the mask and download a transparent cut-out. Nothing is uploaded.
The tool
Build Your SAM 3 Prompt
A sample scene is loaded so you can try it straight away. Swap in your own image or video when you’re ready.
Preview a mask
No mask loaded yet.
1 · Describe it
2 · Choose the job
3 · Your prompts (0)
# Turn on JavaScript to use the Prompt Studio.
The Prompt Studio does not run the model in your browser. It writes the script; you run it on a computer with an NVIDIA GPU. No GPU? Try Meta’s Segment Anything Playground or a hosted API.
How it works
Three Steps from Picture to Mask
Prompt
Open a file, type a short noun phrase, and click or draw on the picture. Positions are stored in full-size pixels.
Get the script
The script updates as you work. Copy it or download sam3_prompt.py, with your prompts already filled in.
Run and preview
Run it where SAM 3 is installed. Load the saved mask_all.png back here to check it and download a cut-out.
Prompt types
Text, Boxes and Clicks Do Different Jobs
Pick the prompt by the result you want: every match, or one object.
| In the studio | What you get | Call in the script |
|---|---|---|
| Text | Every object matching the phrase | set_text_prompt |
| + Box | Everything that looks like the example | add_geometric_prompt, label True |
| − Box | Removes look-alikes you don’t want | add_geometric_prompt, label False |
| + Click | One specific object | predict_inst, label 1 |
| − Click | Cuts an area out of that object | predict_inst, label 0 |
On a mouse, right-click adds an exclude click. For wording that works, see the SAM 3 prompt guide; for picking one object among many, see select specific objects.
Run it
How to Run the Generated Script
The script uses the same calls as the examples in Meta’s repository. You need the repo installed and access to the model files.
| 1. Check your hardware | The repository lists Python 3.12+, PyTorch 2.7+ and an NVIDIA GPU with CUDA 12.6+. Details: system requirements. |
|---|---|
| 2. Install the repo | The Setup tab in the studio has the commands. Full walkthrough: install SAM 3. |
| 3. Get model access | The checkpoints are gated on Hugging Face. Request access, then sign in: Hugging Face access. |
| 4. Run | Put sam3_prompt.py next to your file and run python sam3_prompt.py. The first run downloads the model. |
| 5. Check the output | Image scripts save overlay.png, mask_XX.png, cutout_XX.png and mask_all.png. Video scripts save one ID map per frame. |
Something failed? Start with troubleshooting. Want to understand each line? Read the Python tutorial and video segmentation with Python.
Preview
Preview a Mask and Download a Cut-Out
This part runs fully in your browser, so it works with a mask from any tool.
- Load the image first, then the mask. White (or any non-transparent pixel in a cut-out) counts as the object.
- Overlay dims the background and tints the object, so you can check the edges.
- Cut-out shows the object on a checkerboard. “Download cut-out PNG” saves it at full size with a transparent background.
- If the mask is a different size from the image, the studio stretches it and tells you.
More on formats: export masks and transparent PNGs · Cleaner edges: improve mask edges · Full workflow: background removal.
Good to know
What the Studio Does Not Do
| No model in the browser | The masks come from running the script. The sample mask is drawn by the page to show the preview. |
|---|---|
| Scripts are not GPU-tested here | They follow the repository’s own examples and source, and are syntax-checked, but this site has not run every combination on a GPU. |
| Video frame numbers | Browsers report time, not frame numbers. The studio multiplies time by the frame rate you enter, so set it to your clip’s real frame rate. |
| Text prompts | SAM 3 expects short noun phrases, not full sentences or questions. If nothing is found, see empty masks. |
| Licence | SAM 3 and SAM 3.1 are released under the SAM License. Summary: terms. |
Questions
Prompt Studio FAQ
Does this tool run SAM 3 in my browser?
No. SAM 3 is a download of about 3.5 GB and needs an NVIDIA GPU, so it can’t run inside a web page. The Prompt Studio prepares your prompts and writes the exact script for Meta’s official sam3 repo; you run that script on a machine with a GPU.
Is my image or video uploaded?
No. The file is opened by your browser and drawn on the page. The tool never sends it to a server.
Is the Prompt Studio free?
Yes. There is no account, no limit and no watermark.
What is the difference between text, boxes and clicks?
Text and example boxes ask SAM 3 for every object that matches. Clicks select one specific object: green clicks include an area and pink clicks exclude it.
Which model does the script use?
Image scripts load the SAM 3 image model. Video scripts let you choose SAM 3.1, which tracks many objects faster, or SAM 3.
Can I use it with a video?
Yes. Load a video, move the slider to the frame you want, and add prompts on that frame. The script starts a video session, adds your prompts on that frame and tracks the objects through the clip.
Why are my coordinates different from the ones I measured elsewhere?
The tool stores positions in pixels of the full-size image, not the size shown on screen. Phone photos are shown the right way up, so the script also applies the photo’s rotation before using the coordinates.
How do I see the result here?
Run the script, then load the mask_all.png it saves into the mask preview. You can view the overlay and download a transparent cut-out.