Bria Eraser API
https://api.hiapi.ai /v1/tasks Image, video, and audio models are called through theUnified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).
Model summary
| Model name | bria-eraser |
|---|---|
| Type | Image editing (mask-based object removal) |
| Endpoint | POST /v1/tasks |
| Pricing | See HiAPI Pricing |
Bria Eraser removes passers-by, clutter or blemishes painted white on a black-and-white mask and fills in the background. No prompt needed; the PNG output keeps the original resolution.
Production guidance
- For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
- GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
- Result URLs expire — copy the output to your own storage once the task succeeds.
Best suited for
Remove dust, scratches, price tags or stray props while the product stays untouched.
image_urlmask_urlErase passers-by, cars or wires and fill in a natural background.
mask_urlmask_typeClean up assets with a transparent background and keep it with preserve_alpha.
preserve_alphaRequest parameters
model string required Fixed value bria-eraser.
input object required Business parameters. No prompt is needed.
image_url string required Public URL (http/https) of the image to clean up. JPEG, PNG or WEBP. The result keeps the original resolution.
mask_url string required Black-and-white mask URL with the same aspect ratio as the image. White marks what to erase and black is kept; paint slightly beyond the object edge.
mask_type enum optional manual for brush-drawn masks; automatic for masks produced by a segmentation tool.
preserve_alpha boolean optional If the input has an alpha channel, keep its transparency in the result.
callback object optional Optional callback configuration. When set, HiAPI notifies your service when the task reaches a terminal state.
url string required Required when callback is set; HTTPS URL that receives terminal task notifications.
when enum optional Callback trigger timing. Use final.
Example requests
Golden task: a cobblestone street where only the passer-by is painted white and everything else is black; mask_type is manual and the output is a 1360 × 768 PNG.
{
"model": "bria-eraser",
"input": {
"image_url": "https://dev-static.hiapi.ai/model-onboarding/bria-eraser/2026/10/21/1792546025379-46c31ddb2b52110d-e1-street-src.png",
"mask_url": "https://dev-static.hiapi.ai/model-onboarding/bria-eraser/2026/10/21/1792546025861-e5d2a17ae1d12d41-e1-street-mask.png",
"mask_type": "manual"
}
}Switch to automatic when the mask comes from a cut-out or segmentation tool.
{
"model": "bria-eraser",
"input": {
"image_url": "https://dev-static.hiapi.ai/model-onboarding/bria-eraser/2026/10/21/1792546025379-46c31ddb2b52110d-e1-street-src.png",
"mask_url": "https://dev-static.hiapi.ai/model-onboarding/bria-eraser/2026/10/21/1792546025861-e5d2a17ae1d12d41-e1-street-mask.png",
"mask_type": "automatic"
}
}Getting the result
- The response returns a taskId immediately without waiting for generation to finish.
- In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
- When status=success, read the image URL from output and download it.
- When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.
FAQ
How do I draw the mask?
Paint what to remove white and keep the rest black. Paint slightly beyond the object edge for a cleaner result.
Does the mask have to match the image size?
It must have the same aspect ratio as the image; drawing it at the image's size is simplest.
Do I need a prompt?
No. The endpoint takes no prompt; the erased area is filled from the surrounding image.
Should mask_type be manual or automatic?
Use manual (default) for brush-drawn masks and automatic for masks generated by a cut-out or segmentation tool.
What happens to a transparent background?
Transparency is not kept by default. Turn on preserve_alpha to keep transparent areas transparent.
What format and size is the output?
One PNG at the same resolution as the input (measured: 1360 × 768 in, 1360 × 768 out). The PNG is RGBA and fully opaque unless preserve_alpha is on.
Which input formats are supported?
JPEG, PNG and WEBP, passed as a publicly reachable http/https URL.
How is it billed?
Per output image, one image per request. See the live pricing page for the current rate.