How to Use SAM 3 Image in Windsurf
SAM 3 Image finds and masks objects in existing photos using short descriptions or visual guidance. Use it to prepare product cutouts, editing selections, and annotation drafts.
Prompts to try with SAM 3 Image in Windsurf
Copy an example into Windsurf, or ask in your own words.
Use SAM 3 Image on the product photos in this project's assets directory with the description 'table lamp.' Save the selections beside their source images and build a preview for checking the edges.
Use SAM 3 Image to find 'chair' in the project's room photos. Build a review page that shows the selected objects and a proposed count for each photo.
Use SAM 3 Image to draft 'dog' masks for the sample dataset. Save a source-and-mask comparison for each image so an annotator can correct the labels.
Use SAM 3 Image to select 'jacket' in the project's portrait sample. Feed the selection into the existing color adjustment tool and show a before-and-after preview.
Use SAM 3 Image to locate 'license plate' in the project's vehicle photos. Pass the selections to the existing pixelation function and create a review gallery before export.
How to set up SAM 3 Image in Windsurf
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Add the server
Open the Customize page from the Agents window and click MCPs. Under This computer, open the config file, or edit it directly: ~/.config/devin/mcp_config.json on macOS and Linux, %APPDATA%\devin\mcp_config.json on Windows. Add this:
{ "mcpServers": { "spiral": { "url": "https://api.spiral.ai/mcp" } } } - Sign in
Click Authenticate on the Spiral server in Customize › MCPs, or let the agent call Spiral once: your browser opens. Sign in to Spiral, pick the organization and click Authorize. No API key.
devin mcp login spiral
- Check it
Spiral is listed under This computer in Customize › MCPs. From the terminal:
devin mcp list
Use the Spiral skill
- Send Windsurf this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run SAM 3 Image
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "fal", "model": "fal-ai/sam-3/image", "input": { "image_url": "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" } }'
Then paste one of the prompts above: Windsurf finds SAM 3 Image on Spiral, shows the price and runs it.
SAM 3 Image providers and prices
Spiral runs SAM 3 Image through fal. Open a card for today's price, with every fee included.
Settings you can ask for
SAM 3 Image works from your image URL and prompt. Ask Windsurf for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Apply mask | on or off | on | Apply the mask on the image. |
| Output format | jpeg, png, or webp | png | The format of the generated image. |
| Return multiple masks | on or off | off | If True, upload and return multiple generated masks as defined by |
| Max masks | 1 to 32 | 3 | Maximum number of masks to return when |
| Include scores | on or off | off | Whether to include mask confidence scores. |
| Include boxes | on or off | off | Whether to include bounding boxes for each mask (when available). |
Every API field of Segment Anything Model 3 · Image to Image is on its tool page: open its card above.
What can you do with SAM 3 Image in Windsurf?
Turn project images into object selections for editors, annotation tools, and count reviews. Use SAM 3 masks as intermediate assets, with previews that make corrections easy.
Product cutout preparation
Select a photographed product with a description such as 'table lamp.' Pass the mask to an editor for background removal or a new composition.
Selective photo editing
Mask a jacket, chair, or other object before applying a color adjustment in an image editor. Review the selection before changing the pixels.
Object count review
Find matching objects such as apples or chairs and use the masks to check a proposed count. Keep a marked preview so a person can spot missed or duplicate selections.
Annotation drafts
Create initial object masks for an image dataset using short category descriptions. Have an annotator correct the selections before accepting the labels.
Privacy redaction preparation
Locate faces, license plates, or screens before a separate pixelation step. Inspect the whole image for missed targets before publishing.
Interior design selections
Isolate furniture in a room photo to prepare a mood board or editing selection. Use descriptions such as 'armchair' or 'floor lamp' for each pass.
Wildlife image annotation
Draft animal masks in camera-trap stills with broad descriptions such as 'bird' or 'deer.' Treat exact species identification as a separate review task.
More on SAM 3 Image and Windsurf
Overview
SAM 3 Image in other agents
Questions about SAM 3 Image in Windsurf
Can Windsurf use SAM 3 Image?
Yes. Add Spiral to Windsurf as an MCP server, and Windsurf can find and run SAM 3 Image like any built-in tool.
How much does SAM 3 Image cost in Windsurf?
$0.0065 per run at the default inputs. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Windsurf plan is separate.
Do I need a fal account to use SAM 3 Image in Windsurf?
No. Spiral runs SAM 3 Image on its own fal account. You sign in to Spiral once and never paste a key.
How long does it take to set up SAM 3 Image in Windsurf?
About two minutes: add the server, then sign in, then check it.
Does Windsurf wait while SAM 3 Image runs?
SAM 3 Image runs in the background. Windsurf starts the run, checks on it and gives you the image when it's ready.
What does SAM 3 produce?
SAM 3 produces segmentation masks that mark which pixels belong to matching objects in an existing image. Those selections can feed a separate editing, counting, or annotation step.
How should I phrase a SAM 3 prompt?
Use a short object description such as 'red apple' or 'striped cat.' Keep it to the object and one or two visible attributes.
Can SAM 3 select several matching objects?
Yes. SAM 3 is designed to find all instances matching a concept, such as the chairs in a room. Review the selections before treating them as a complete count.
Can SAM 3 follow a detailed instruction about an object's position?
Long descriptions such as 'the second to last book from the right on the top shelf' exceed its intended text prompting capabilities. Use a simpler description and visual guidance to identify the target.
Where does SAM 3 need extra review?
Specialized categories in unfamiliar imagery need particular care. Meta reports difficulty with fine-grained concepts requiring domain knowledge, so review scientific and medical selections closely.
Start using SAM 3 Image in Windsurf
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into Windsurf:
set up https://spiral.ai/SKILL.md


