Skip to content
Catalog

cn8/studio-inpaint

Send an image URL and one or more masks marking the areas you want gone. The service

Learn more about Image Inpainting
Imageasync (job)Instant previewimageprocessinginpainting

Remove objects

Result

Before / after shows up here

Upload → detect objects → click them → erase.

Overview

Send an image URL and one or more masks marking the areas you want gone. The service fills each masked area so the result looks like the object was never there — first rebuilding the underlying layout, then refining the texture for a photorealistic finish. Masks can be bounding boxes, COCO RLE (straight from the Segmentation service), or polygons, and you can pass several at once to remove multiple objects in one go. Edges are blended seamlessly so the fill is invisible. Images larger than 4096 px on a side are resized automatically. This is an async job: submit it, poll until it's ready, then download the result.

Key capabilities

Photorealistic fill

The service rebuilds the layout under the mask and then refines the texture, so removed objects are replaced with believable, photorealistic detail — automatically, on every request.

Multiple mask formats

Accepts bbox ([x, y, w, h]), COCO RLE (straight from the Segmentation service), or polygon ([[x,y], ...]) masks. Pass several at once to remove multiple objects together.

Seamless blending

Masks are expanded slightly (dilate_px, default 15) to fully cover edges, and the fill is feathered into the original (feather_px, default 45) so the transition is invisible.

Optional prompt

Add a custom prompt and negative prompt to steer the fill. The defaults produce a seamless continuation of the background.

When to use it

Object removal

Segment objects first (via the Segmentation service), let users pick which to remove, then feed the selected RLE masks here.

Photo retouching

Remove blemishes, watermarks, or unwanted text from images.

Scene cleanup

Clean up wires, construction, or distracting elements from real estate or landscape photos.

Input & output

input

Image URL and array of mask definitions (bbox, rle, or polygon)

JSON body

output

Inpainted image URL and processing metadata (async job result)

JSON with S3 URL

Guides & tips

How it works

  • You mark the areas to remove with one or more masks. All of them are combined and expanded slightly (dilate_px) so the edges are fully covered.
  • The service rebuilds the layout underneath the masked area, then refines the texture — guided by your prompt and negative prompt — for a photorealistic result.
  • Finally, the fill is feathered into the original image (feather_px) so the transition is invisible.

Mask formats

  • bbox: [x, y, width, height] — a simple rectangle.
  • rle: {size: [H, W], counts: [...]} — COCO Run-Length Encoding; use the mask_rle value straight from the Segmentation service.
  • polygon: [[x1,y1], [x2,y2], ...] — any closed polygon.
  • You can mix different mask types in the same request.

Segment-then-inpaint workflow

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

Specs

Latency
~8-12 s (both stages combined)
Async
true
Rate Limit
Per API key
Max Input
4096 x 4096 pixels (larger images are resized), max 20 masks per request

Schema

Request body

imageUrlrequiredstring

Public URL of the image to inpaint

masksrequiredarray

Array of mask objects. Each mask has 'type' and 'data'.

typerequiredstring

Mask format

enum: bbox, rle, polygon

datarequiredany

bbox: [x,y,w,h]. rle: {size,counts}. polygon: [[x,y],...]

dilate_pxinteger

How many pixels to expand each mask (default: 15), so edges are fully covered.

promptstring

Custom prompt to steer the fill. Default: a seamless continuation of the background.

negative_promptstring

Custom negative prompt for things to avoid in the fill. Default: objects, artifacts, blur.

feather_pxinteger

How softly the fill blends into the original (default: 45). Larger values feather the edge more.

Response

data.urlstring

Public URL of the inpainted image.

data.masks_appliedinteger

How many masks were applied.

Pricing

Billed per image processed, regardless of mask count.

ServiceUnitPrice
Image Inpaintingitem10 credits/image

Mask count, dilation, or feather values do not affect pricing.

FAQ

Related models