# Object Removal

> Removes box-selected objects and their visual effects, seamlessly reconstructing the scene with contextually appropriate content.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/object-removal/bbox`
- **Model ID**: `fal-ai/object-removal/bbox`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: utility, editing



## Pricing

Your request will cost **$0.006** with **Low Quality**, **$0.012** with **Medium Quality**, **$0.018** with **High Quality**, and **$0.024** with **Best Quality**

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`image_url`** (`string`, _required_):
  The URL of the image to remove objects from.
  - Examples: "https://v3.fal.media/files/zebra/o0DORfJawy-T9P_-NsvLY.png"

- **`box_prompts`** (`list<BBoxPromptBase>`, _optional_):
  List of bounding box coordinates to erase (only one box prompt is supported)
  - Default: `[]`
  - Array of BBoxPromptBase
  - Examples: [{"x_max":0.6574,"x_min":0.3595,"y_min":0.0115,"y_max":0.8175}]

- **`model`** (`ModelEnum`, _optional_):
   Default value: `"best_quality"`
  - Default: `"best_quality"`
  - Options: `"low_quality"`, `"medium_quality"`, `"high_quality"`, `"best_quality"`

- **`mask_expansion`** (`integer`, _optional_):
  Amount of pixels to expand the mask by. Range: 0-50 Default value: `15`
  - Default: `15`
  - Range: `0` to `50`



**Required Parameters Example**:

```json
{
  "image_url": "https://v3.fal.media/files/zebra/o0DORfJawy-T9P_-NsvLY.png"
}
```

**Full Example**:

```json
{
  "image_url": "https://v3.fal.media/files/zebra/o0DORfJawy-T9P_-NsvLY.png",
  "box_prompts": [
    {
      "x_max": 0.6574,
      "x_min": 0.3595,
      "y_min": 0.0115,
      "y_max": 0.8175
    }
  ],
  "model": "best_quality",
  "mask_expansion": 15
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<Image>`, _required_):
  The generated images with objects removed.
  - Array of Image
  - Examples: [{"content_type":"image/png","height":768,"width":1024,"url":"https://v3.fal.media/files/lion/arYSoJeqWjhbcA8o4budv_85a2309b2c954c85a75120e664adbe17.png","file_name":"85a2309b2c954c85a75120e664adbe17.png","file_size":730703}]



**Example Response**:

```json
{
  "images": [
    {
      "content_type": "image/png",
      "height": 768,
      "width": 1024,
      "url": "https://v3.fal.media/files/lion/arYSoJeqWjhbcA8o4budv_85a2309b2c954c85a75120e664adbe17.png",
      "file_name": "85a2309b2c954c85a75120e664adbe17.png",
      "file_size": 730703
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/object-removal/bbox \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://v3.fal.media/files/zebra/o0DORfJawy-T9P_-NsvLY.png"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
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/object-removal/bbox",
    arguments={
        "image_url": "https://v3.fal.media/files/zebra/o0DORfJawy-T9P_-NsvLY.png"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/object-removal/bbox", {
  input: {
    image_url: "https://v3.fal.media/files/zebra/o0DORfJawy-T9P_-NsvLY.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);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/object-removal/bbox)
- [API Documentation](https://fal.ai/models/fal-ai/object-removal/bbox/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/object-removal/bbox)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
