# Bria Guided Remove Background

> Background removal you steer with a prompt. Starts from the same clean cut as Bria RMBG, then adds, drops or isolates objects from plain words like "the person with the mat and the plant" or "only the chair". Original pixels, real alpha, nothing repainted.


## Overview

- **Endpoint**: `https://fal.run/bria/guided-remove-background`
- **Model ID**: `bria/guided-remove-background`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: background removal, guided segmentation, prompt-based cutout, alpha matte, e-commerce, product photography, image editing



## Pricing

Your request will cost **$0.03** per image.

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`, _optional_):
  Source image as a public URL, a base64 data URI (data:image/png;base64,...) or raw base64-encoded image bytes. Default value: `"https://labs-assets.bria.ai/api-examples/guided-remove-background/yoga_studio_input.jpg"`
  - Default: `"https://labs-assets.bria.ai/api-examples/guided-remove-background/yoga_studio_input.jpg"`
  - Examples: "https://labs-assets.bria.ai/api-examples/guided-remove-background/yoga_studio_input.jpg"

- **`prompt`** (`string`, _optional_):
  Optional. Plain words for how to change the default cutout of the photo's obvious subject: add something ('the person with the mat and the plant'), drop something ('the woman at her desk without the lamp') or narrow it ('only the chair'). Everything kept is the original pixels with a new alpha channel. Leave it empty for the plain cutout of the obvious subject.
  - Examples: "the person with the mat and the plant"

- **`autocrop`** (`boolean`, _optional_):
  Tighten the output canvas to the kept content.
  - Default: `false`

- **`sync_mode`** (`boolean`, _optional_):
  If true, the function waits for the image to be generated and uploaded
  before returning, so the image is returned directly (base64) instead of
  via the CDN. Increases latency.
  - Default: `false`



**Required Parameters Example**:

```json
{}
```

**Full Example**:

```json
{
  "image_url": "https://labs-assets.bria.ai/api-examples/guided-remove-background/yoga_studio_input.jpg",
  "prompt": "the person with the mat and the plant"
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`Image`, _required_):
  The original photo with a new alpha channel: the obvious subject, adjusted by the prompt (RGBA PNG).



**Example Response**:

```json
{
  "image": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019,
    "width": 1024,
    "height": 1024
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/bria/guided-remove-background \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{}'
```

### 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(
    "bria/guided-remove-background",
    arguments={},
    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("bria/guided-remove-background", {
  input: {},
  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/bria/guided-remove-background)
- [API Documentation](https://fal.ai/models/bria/guided-remove-background/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=bria/guided-remove-background)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
