Object Eraser API

popnow/object-eraser-v1/editFrom 5 credits per image

Remove unwanted objects from a photo by naming them or painting a mask; the space they leave is filled to match the surrounding scene.

Call it with the model name popnow/object-eraser-v1/edit on POST /jobs/createTask, from 5 credits per image ($0.05). New accounts get 30 free credits to try it in the Playground first.

  • AI Eraser

Introduction

Object Eraser removes things you do not want from a photo and fills the space they leave with background that matches the rest of the scene. You point at the object in one of two ways, by describing it in a few words or by painting it white on a black mask, and you get the same photo back at its original size without the object.

Key features

Point with words or with a mask

The quickest way in is a short description: "the wooden bench on the left", "the sign above the door", "the second person from the right". It works best on distinct objects with some clear space around them; thin objects and things at the edge of the frame are often missed, and a photo that comes back unchanged is the sign. A mask marks the pixels precisely, so it is the reliable route in those cases, as it is for one of two similar cups or only part of a fence. Both can be sent in the same request.

Fills that follow the scene

The removed area is not blurred or smeared. It is rebuilt from its surroundings, so floorboards continue, walls keep their texture and light keeps falling the same way, which is what makes the result read as an untouched photograph.

The rest of the photo stays as it was

Only the selected object is replaced. The framing, the resolution and everything outside the selection come back as sent, so the edited photo can go straight back into a layout, a listing or a series.

Request parameters

ParameterRequiredDescription
image_urlYesThe picture to start from.
mask_urlNoPaint over the area that should change.
output_formatNoFile type of the result. png · jpeg · webp · Default: png
promptNoWhat to remove, in a few plain words with a position when there is more than one, e.g. "the wooden bench on the left".

Pricing

Prices are in credits, the same credits you use on the website (1 credit = $0.01). The hold is taken when the task is accepted and settled to the actual charge when it finishes; failed tasks are refunded.

OptionCredits per image≈ USD
Standard4.5$0.045

Each task is rounded up to whole credits, so one run at the lowest tier costs 5 credits per image ($0.05).

For an exact number before you run, send the same body to POST /jobs/quote.

Use cases

Clean product and property photos

It is the quickest fix for listing photos, interiors and real-estate galleries where one distracting object spoils the frame.

Tidy travel and event pictures

Take tourists, bins, scaffolding or other photographers out of the background of a portrait or a landmark, so the subject finally has the frame to itself.

Prepare plates for further edits

Clear a space first, then widen the whole scene afterwards with Image Expander.

Prompt guide & pro tips

Describe what is visible, and where

Write the object the way you would point it out to a colleague: a noun, a colour or material, and a position. "Bench" works; "the wooden bench on the left" works better when the scene holds more than one. Naming something that is not in the picture does not raise an error. The photo simply comes back unchanged, so a result identical to the input usually means the description missed.

Paint masks generously

When you use mask_url, make it the same size as the photo, white over the object and black everywhere else. Extend the white a little past the object's edge so its outline and shadow disappear too; a mask that hugs the silhouette tends to leave a faint ghost behind.

Remove big things one pass at a time

Several small objects can go in one request, but for large or overlapping removals run separate passes and check each result. Every pass returns a complete photo, so the output of one request can be fed straight into the next.

API quick start

Call the Object Eraser API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow- and use the same credits as the website.
  2. Send the request. POST /jobs/createTask with model popnow/object-eraser-v1/edit and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "popnow/object-eraser-v1/edit",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
    "output_format": "png"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

Object Eraser API questions

How much does the Object Eraser API cost?

Object Eraser costs 5 credits ($0.05) per image. Credits are the same as on the website (1 credit = $0.01), new accounts get 30 free credits, and failed tasks are refunded.

What is the model name for Object Eraser in the API?

Put popnow/object-eraser-v1/edit for AI Eraser in the model field of POST /jobs/createTask.

Do I need a mask?

Not always. A short description works for a distinct object with clear space around it; in our tests a wooden ladle was removed from words alone. Thin objects and things at the edge of the frame are often missed and the photo comes back unchanged: a tall rack at the frame edge survived two differently worded prompts, then went on the first try with a mask. Send mask_url whenever a description does not take, or to remove only one of two similar objects.

What if my description matches nothing?

You get the photo back unchanged and the request counts as completed. Name something that is really in the picture, and add a position when there is more than one of it.

How should the mask look?

The same size as the photo, white over what should disappear and black everywhere else. Paint a little beyond the object's edge so its outline and shadow go too.

Can it put something new in the gap?

No. It removes and fills the space with matching surroundings.

What are the limits of the Object Eraser API?

Prompt length (characters): 1,000. Requests outside these limits are rejected before anything is charged.

Can I try Object Eraser without writing code?

Yes. The Playground runs Object Eraser on your PopNow credits, needs no API key, and shows the matching code for every run.

More about Object Eraser