Sam3 Image

Sam3 Image

Playground

Try it on WavespeedAI!

SAM 3 is a unified foundation model for promptable image segmentation using text, points, or boxes to detect and segment objects. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

SAM3 Image Segmentation

SAM3 Image Segmentation is an advanced image segmentation model based on Meta’s Segment Anything Model 3. It identifies and segments objects in images using flexible prompt types — text descriptions, point coordinates, or bounding boxes — delivering precise masks for any target object.


Why Choose This?

  • Multiple prompt types Segment objects using text prompts, point prompts, box prompts, or any combination.

  • Text-based segmentation Simply describe what to segment (e.g., “the man”, “the car”, “background”).

  • Point and box prompts Precise control with coordinate-based prompts for exact object targeting.

  • Mask overlay option Optionally overlay the segmentation mask directly on the original image.

  • Prompt Enhancer Built-in tool to automatically improve your text prompts for better results.

  • Ultra-affordable Just $0.005 per image for professional-quality segmentation.


Parameters

ParameterRequiredDescription
imageYesSource image to segment (upload or URL)
promptNo*Text description of the object to segment
point_promptsNo*Point coordinates to identify the target object
box_promptsNo*Bounding box coordinates to identify the target object
apply_maskNoOverlay the segmentation mask on the original image
output_formatNoOutput format: jpeg, png, or webp (default: png)

*At least one prompt type (text, boxes, or points) must be provided.


How to Use

  1. Upload your image — drag and drop or paste a URL.
  2. Add prompts — provide at least one of the following:
    • Text prompt — describe the object to segment (e.g., “the man”, “the dog”).
    • Point prompts — click ”+ Add Item” to add point coordinates.
    • Box prompts — click ”+ Add Item” to add bounding box coordinates.
  3. Enable apply_mask (optional) — check to overlay the mask on the original image.
  4. Choose output format — select jpeg, png, or webp.
  5. Run — submit and download the segmented result.

Pricing

ItemCost
Per image$0.005

Simple flat-rate pricing regardless of image size or prompt complexity.


Best Use Cases

  • Background Removal — Segment subjects for clean background removal.
  • Object Isolation — Extract specific objects for compositing or editing.
  • Image Editing — Create precise masks for targeted edits.
  • Data Annotation — Generate segmentation masks for training datasets.
  • E-commerce — Isolate products for catalog images.

Pro Tips

  • Text prompts work best for common objects with clear descriptions.
  • Use point prompts for precise targeting when text is ambiguous.
  • Use box prompts to constrain the segmentation to a specific region.
  • Combine multiple prompt types for more accurate results.
  • Enable apply_mask to visualize the segmentation directly on the image.
  • PNG format preserves transparency for mask outputs.

Notes

  • At least one prompt type must be provided (text, points, or boxes).
  • Text prompts support natural language descriptions.
  • Point and box prompts use image coordinate systems.
  • PNG format is recommended for mask outputs to preserve transparency.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result


# Submit the task
curl --location --request POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/sam3-image" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
    "point_prompts": [],
    "box_prompts": [],
    "apply_mask": true,
    "output_format": "png"
}'

# Get the result
curl --location --request GET "https://api.wavespeed.ai/api/v3/predictions/${requestId}/result" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}"

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
imagestringYes-URL of the image to segment and analyze
promptstringNo-Text description to guide which objects or regions to segment
point_promptsarrayNo[]-List of point coordinates to mark specific locations for segmentation (foreground or background)
box_promptsarrayNo[]-List of bounding boxes to define rectangular regions for segmentation
apply_maskbooleanNotrue-Whether to overlay the segmentation mask on the original image
output_formatstringNopngjpeg, png, webpOutput image format for the segmented result

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayArray of URLs to the generated content (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.has_nsfw_contentsarrayArray of boolean values indicating NSFW detection for each output
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction, the ID of the prediction to get
data.modelstringModel ID used for the prediction
data.outputsstringArray of URLs to the generated content (empty when status is not completed).
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2025 WaveSpeedAI. All rights reserved.