Meta SAM 3 Playground

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.

Prompt Studio
Animation of the Prompt Studio turning clicks into code and a maskThree stages repeat. First a box and a click are placed on an orange in a photo. Then lines of Python code appear with the same coordinates. Finally the orange is filled with a mask. 1 · draw a box, click an object 2 · the script writes itself 3 · run it, preview the mask # sam3_prompt.py import torchset_text_prompt("orange")boxes = [(55, 88,135, 168)]points = [[175, 140]] $ python sam3_prompt.py2 object(s): [0.94, 0.91]overlay.pngcutout_00.pngmask_all.png waiting for prompts your file stays in the browser · the model runs on your GPU
Illustration: prompts in, script out, mask back.

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.

Your browser does not support the canvas element.
Drop an image or video here, or use “Open image or video”.

Preview a mask

No mask loaded yet.

1 · Describe it

2 · Choose the job

3 · Your prompts (0)

    sam3_prompt.py
    # 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

    1

    Prompt

    Open a file, type a short noun phrase, and click or draw on the picture. Positions are stored in full-size pixels.

    2

    Get the script

    The script updates as you work. Copy it or download sam3_prompt.py, with your prompts already filled in.

    3

    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.

    prompt types
    Animation comparing text, box and click promptsThree panels appear in turn. A text prompt highlights all three oranges. An example box around one orange also highlights all three. A single click highlights only the orange that was clicked. text: "orange"every match example boxeverything like it clickonly this one green box or click = include · pink = exclude
    Illustration: text and example boxes find every match; a click selects one object.
    In the studioWhat you getCall in the script
    TextEvery object matching the phraseset_text_prompt
    + BoxEverything that looks like the exampleadd_geometric_prompt, label True
    − BoxRemoves look-alikes you don’t wantadd_geometric_prompt, label False
    + ClickOne specific objectpredict_inst, label 1
    − ClickCuts an area out of that objectpredict_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 hardwareThe repository lists Python 3.12+, PyTorch 2.7+ and an NVIDIA GPU with CUDA 12.6+. Details: system requirements.
    2. Install the repoThe Setup tab in the studio has the commands. Full walkthrough: install SAM 3.
    3. Get model accessThe checkpoints are gated on Hugging Face. Request access, then sign in: Hugging Face access.
    4. RunPut sam3_prompt.py next to your file and run python sam3_prompt.py. The first run downloads the model.
    5. Check the outputImage 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 browserThe masks come from running the script. The sample mask is drawn by the page to show the preview.
    Scripts are not GPU-tested hereThey 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 numbersBrowsers 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 promptsSAM 3 expects short noun phrases, not full sentences or questions. If nothing is found, see empty masks.
    LicenceSAM 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.

    Keep reading