Skip to content
Catalog

cn8/studio-segment

Send an image URL and choose a mode. In auto mode, the service detects every object in

Learn more about Image Segmentation
ImagesyncInstant previewimageanalysissegmentation

Segment an image

Auto mode finds every object; hover and click the result to explore masks.

Result

Masks show up here

Every detected object gets its own colored, clickable mask.

Overview

Send an image URL and choose a mode. In auto mode, the service detects every object in the image (or in a rectangular region you specify) and returns up to 100 segments sorted by area. In prompt mode, you point at a specific object with coordinates or a bounding box and get up to 3 mask candidates ranked by confidence. Each segment comes with a mask in COCO RLE format — compact and easy to decode on any platform — plus its bounding box, area, confidence scores, and centroid. Images larger than 4096 px on a side are resized automatically. Responses are synchronous: the result comes back in the same call.

Key capabilities

Automatic segmentation

Auto mode finds every object in the image (or a cropped region) with no prompt needed. Returns up to 100 segments sorted by area.

Prompt-based targeting

Prompt mode targets one object using point coordinates (foreground/background labels) or a bounding box. Returns up to 3 mask candidates ranked by confidence.

COCO RLE masks

Masks come back as compact COCO Run-Length Encoding, and can be passed straight to the Inpainting service for object removal.

Region cropping

In auto mode, optionally restrict analysis to a rectangular region {x, y, width, height} of the image.

When to use it

Object removal prep

Detect objects, let users pick which to remove, then feed selected mask_rle values to the Inpainting service.

Image annotation

Auto-generate segmentation masks for labeling workflows.

Content analysis

Count objects, measure areas, and classify regions in an image.

Input & output

input

Image URL, mode (auto or prompt), optional region/points/box

JSON body

output

Array of segments with mask_rle, bbox, area, predicted_iou, stability_score, centroid

JSON

Guides & tips

Auto vs. prompt mode

  • Auto mode finds every object in the image and returns up to 100 segments, sorted by area (largest first). Very small or low-confidence masks are filtered out so you get clean, usable results.
  • Prompt mode targets a single object from the points or box you provide, and returns up to 3 mask candidates ranked by confidence — pick the one that best matches what you meant.
  • Either way, masks come back as COCO RLE: compact to store and easy to decode on any platform.

Segment-then-inpaint workflow

  • Call this service in auto mode to detect all objects.
  • In your UI, let users select which objects to remove.
  • Pass the selected mask_rle values to the Inpainting service (studio-inpaint).
  • Result: selected objects are seamlessly removed from the image.

Region cropping

  • In auto mode, pass a region {x, y, width, height} to restrict segmentation to a portion of the image. Returned bounding boxes and centroids are in full-image coordinates.

Specs

Latency
~1-3 s depending on image size and mode
Async
false
Rate Limit
Per API key
Max Input
4096 x 4096 pixels (larger images are resized)

Schema

Request body

imageUrlrequiredstring

Public URL of the image to analyze

modestring · default: auto

Segmentation mode: 'auto' (find all objects, default) or 'prompt' (target specific object)

enum: auto, prompt

regionobject

Auto mode only. Restrict analysis to a rectangular region: {x, y, width, height}

pointsarray

Prompt mode. Point prompts: [{x, y, label}]. label 1 = foreground, 0 = background.

boxarray

Prompt mode. Bounding box prompt: [x1, y1, x2, y2].

Response

data.image_sizeobject

width and height of the (possibly resized) image

data.segmentsarray

Array of segment objects

data.segments[].mask_rleobject

COCO Run-Length Encoding of the segment mask

data.segments[].bboxarray

[x, y, width, height] bounding box

data.segments[].areainteger

Mask area in pixels

data.segments[].predicted_iounumber

Predicted intersection-over-union (confidence)

data.segments[].stability_scorenumber

Mask stability score

data.segments[].centroidarray

[x, y] centroid of the mask

data.segment_countinteger

Total number of segments returned

Pricing

Billed per image analyzed, regardless of segment count.

ServiceUnitPrice
Image Segmentationitem2 credits/image

Pricing is the same for auto and prompt modes.

FAQ

Related models