> ## Documentation Index
> Fetch the complete documentation index at: https://fal.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bria Eraser API

> API reference for Bria Eraser. Bria Eraser enables precise removal of unwanted objects from images while maintaining high-quality outputs. Trained exclusively on licensed data for safe and risk-free c

**Endpoint:** `POST https://fal.run/fal-ai/bria/eraser`
**Endpoint ID:** `fal-ai/bria/eraser`

<Card title="Try it in the Playground" icon="play" href="https://fal.ai/models/fal-ai/bria/eraser/playground">
  Run this model interactively with your own prompts.
</Card>

## Quick Start

<CodeGroup>
  ```python title="Python" theme={null}
  import fal_client

  def on_queue_update(update):
      if isinstance(update, fal_client.InProgress):
          for log in update.logs:
             print(log["message"])

  result = fal_client.subscribe(
      "fal-ai/bria/eraser",
      arguments={
          "image_url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png",
          "mask_url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png"
      },
      with_logs=True,
      on_queue_update=on_queue_update,
  )
  print(result)
  ```

  ```javascript title="JavaScript" theme={null}
  import { fal } from "@fal-ai/client";

  const result = await fal.subscribe("fal-ai/bria/eraser", {
    input: {
        image_url: "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png",
        mask_url: "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png"
      },
    logs: true,
    onQueueUpdate: (update) => {
      if (update.status === "IN_PROGRESS") {
        update.logs.map((log) => log.message).forEach(console.log);
      }
    },
  });
  console.log(result.data);
  console.log(result.requestId);
  ```

  ```bash title="cURL" theme={null}
  curl --request POST \
    --url https://fal.run/fal-ai/bria/eraser \
    --header "Authorization: Key $FAL_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "image_url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png",
    "mask_url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png"
  }'
  ```
</CodeGroup>

## Related

* [Bria RMBG 2.0](/model-api-reference/image-generation-api/bria-rmbg-2.0) — Image Generation
* [Bria Expand Image](/model-api-reference/image-generation-api/bria-expand-image) — Image Generation
* [Bria Product Shot](/model-api-reference/image-generation-api/bria-product-shot) — Image Generation
* [Bria Background Replace](/model-api-reference/image-generation-api/bria-background-replace) — Image Generation
* [Video](/model-api-reference/video-generation-api/video) — Video Generation
* [Bria GenFill](/model-api-reference/image-generation-api/bria-genfill) — Image Generation
* [Replace Background](/model-api-reference/image-generation-api/replace-background) — Image Generation
* [Bria Text-to-Image HD](/model-api-reference/image-generation-api/bria-text-to-image-hd) — Image Generation
* [Bria Text-to-Image Base](/model-api-reference/image-generation-api/bria-text-to-image-base) — Image Generation
* [Embed Product](/model-api-reference/image-generation-api/embed-product) — Image Generation
* [Bria Text-to-Image Fast](/model-api-reference/image-generation-api/bria-text-to-image-fast) — Image Generation

## Capabilities

* Image input
* Inpainting (mask support)
* Synchronous mode

## API Reference

### Input Schema

<ParamField body="image_url" type="string" required>
  Input Image to erase from
</ParamField>

<ParamField body="mask_url" type="string" required>
  The URL of the binary mask image that represents the area that will be cleaned.
</ParamField>

<ParamField body="mask_type" type="MaskTypeEnum" default="manual">
  You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. Default value: `"manual"`

  Possible values: `manual`, `automatic`
</ParamField>

<ParamField body="sync_mode" type="boolean" default="false">
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
</ParamField>

<ParamField body="preserve_alpha" type="boolean" default="false">
  If set to true, attempts to preserve the alpha channel of the input image.
</ParamField>

### Output Schema

<ParamField body="image" type="Image" required>
  The generated image
</ParamField>

## Input Example

```json theme={null}
{
  "image_url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png",
  "mask_url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png",
  "mask_type": "manual",
  "sync_mode": false,
  "preserve_alpha": false
}
```

## Output Example

```json theme={null}
{
  "image": {
    "content_type": "image/png",
    "url": "https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"
  }
}
```

## Limitations

* `mask_type` restricted to: `manual`, `automatic`
