Editing

Description

Remove an object you describe in plain language, with no mask to draw. Name the object in prompt (for example "yellow hammer"), and the route finds it, segments it, and erases it, filling the area behind it so it looks like the object was never there.

How It Works

  1. A vision-language model reads prompt against the image, and SAM 3 segments the matching object.
  2. The object's mask is sent to the Eraser, which removes it and fills the area.

Use /erase instead when you already have a mask, or need to remove something a short description can't single out.

/erase_by_text runs this same route under its older name, reading the object from object_name instead of prompt.

Erase Modes

The composite parameter picks one of two modes, the same as on /erase. Pixel perfect (true, the default) rebuilds only the object's area and blends it into the original, so everything else stays as it was. Context aware (false) also removes what the object casts outside its outline, such as its shadow or its reflection.

When Nothing Matches

If nothing in the image matches prompt, the request still succeeds and returns the input image unchanged.

Output Characteristics

  • The modified image is returned at the original resolution.
  • With composite set to true, everything outside the object's area stays as it was.
  • Transparency is not kept: an input with an alpha channel comes back fully opaque.

Content Moderation

This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:

  • Prompt Moderation - Checks prompt and stops processing if it contains inappropriate or restricted content. On by default.
  • Input Image Moderation - Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
  • Output Image Moderation - Evaluates the generated image and blocks the response if it violates safety guidelines.

Constraints

The Bria API supports JPEG, PNG and WEBP files in RGB, RGBA, or CMYK color modes. When the file is of a different type or color mode, the status code 415 will be returned.

post/remove_object

Request

  • Base URL: https://engine.prod.bria-api.com/v2/image/edit
  • URL: https://engine.prod.bria-api.com/v2/image/edit/remove_object
  • Auth: API key in header api_token

Request body

imagestring required

The source image to be handled by the API.
Supported input types:

  • Base64-encoded string
  • URL pointing to an image file that is publicly accessible and available at the time of processing.

Accepted formats: JPEG, JPG, PNG, WEBP.

promptstring required

The object to remove, in natural language, for example "yellow hammer" or "the person on the left". Add color, position or size when the image holds several similar objects.

compositeboolean

Selects the erase mode.

  • true (default), pixel perfect: Only the object's area is rebuilt and blended into the original. Everything else stays as it was.
  • false, context aware: The model also removes what the object casts outside its outline, such as its shadow or its reflection.
syncboolean

Specifies the response mode.

  • When false (default), the request is processed asynchronously: the API immediately returns a status URL to track progress.
  • When true, the request is processed synchronously: the API holds the connection open until the process is complete and then returns the final image URL in the response.
webhook_urlstring uri

Optional URL for receiving the result via webhook when the async job completes. See webhooks.

prompt_content_moderationboolean

When enabled, applies content moderation to prompt.

Expected behavior:

  • Processing stops if the prompt fails moderation.
  • Returns a 422 error with details about which parameter failed.
visual_input_content_moderationboolean

When enabled, applies content moderation to input visual.

Expected behavior:

  • Processing stops if the image fails moderation.
  • Returns a 422 error with details about which parameter failed.
visual_output_content_moderationboolean

When enabled, applies content moderation to result visual.

Expected behavior:

  • If the modified image fails moderation, returns a 422 error.

Response

Successful operation (Synchronous Success)

request_idstring required

Changes