# Bria Expand (FIBO-Edit-1.5)

> Bria Expand extends an image beyond its borders to any of 9 aspect ratios or a custom canvas up to 25 megapixels. Built on FIBO-Edit-1.5, with optional prompt guidance for the new area and the original pixels kept at full resolution.


## Overview

- **Endpoint**: `https://fal.run/bria/fibo-edit-1.5/expand`
- **Model ID**: `bria/fibo-edit-1.5/expand`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: image expansion, outpainting, aspect ratio, canvas extension, e-commerce, image editing



## Pricing

Your request will cost **$0.04** 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`, _required_):
  The image to expand (file or URL).
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/orange.png"

- **`canvas_size`** (`list<integer>`, _optional_):
  The desired size of the final image after the expansion, as [width, height]. Area must be under 25 megapixels. Pairs with 'original_image_location'.
  - Array of integer
  - Examples: [1200,674]

- **`aspect_ratio`** (`Enum`, _optional_):
  The desired aspect ratio of the final image. Used over 'original_image_size' and 'original_image_location' if provided: the original is centred and the canvas grows around it.
  - Options: `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`

- **`original_image_size`** (`list<integer>`, _optional_):
  The desired size of the original inside the canvas, as [width, height]; it is resized to this before being placed. Ignored if 'aspect_ratio' is provided.
  - Array of integer
  - Examples: [610,855]

- **`original_image_location`** (`list<integer>`, _optional_):
  Top-left corner of the original within the canvas, as [x, y]. May sit outside the canvas, in which case the original is cropped. Ignored if 'aspect_ratio' is provided.
  - Array of integer
  - Examples: [301,-66]

- **`prompt`** (`string`, _optional_):
  What should appear in the expanded area. Omit it and the model is asked only to extend the image, which is usually what you want for a plain canvas change.

- **`seed`** (`integer`, _optional_):
  Reuse the seed from a previous response to recreate that result. Omit it for a random one, which is reported in the response either way.
  - Range: `0` to `2147483647`

- **`negative_prompt`** (`string`, _optional_):
  Not supported by this model, and refused rather than ignored -- see 'prompt'. Present only so a request written against the SDXL expansion endpoint fails loudly here instead of silently losing the field.

- **`sync_mode`** (`boolean`, _optional_):
  If true, returns the image directly in the response (increases latency).
  - Default: `false`

- **`retain_original_quality`** (`boolean`, _optional_):
  Keep the original's own pixels at full resolution. Generation happens near one megapixel, so a larger canvas is scaled up afterwards; leave this on and the region the mask protected is not resampled at all. Turn it off for a uniformly soft result, which can hide the seam on a textured background. Default value: `true`
  - Default: `true`

- **`preserve_alpha`** (`boolean`, _optional_):
  Keep the input's transparency. The model works in RGB, so the alpha channel is not generated -- the original's own is extended outwards by replicating its edges, which is what expanding a cutout means. Turn it off to get a flattened RGB result. Default value: `true`
  - Default: `true`

- **`return_model_output`** (`boolean`, _optional_):
  Also return the model's own frame, before the original was pasted back and the seam blended. Diagnostic only -- it does not change the returned image. Use it to tell a bad generation apart from a bad composite: a boundary already broken in that frame came from the model, not from post-processing.
  - Default: `false`



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/orange.png"
}
```

**Full Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/orange.png",
  "canvas_size": [
    1200,
    674
  ],
  "original_image_size": [
    610,
    855
  ],
  "original_image_location": [
    301,
    -66
  ],
  "retain_original_quality": true,
  "preserve_alpha": true
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`Image`, _required_):
  The expanded image.

- **`seed`** (`integer`, _required_):
  The seed used, so the result can be reproduced.

- **`structured_instruction`** (`Structured Instruction`, _required_):
  The structured prompt the model conditioned on.

- **`model_output`** (`Image`, _optional_):
  The model's own frame at the requested canvas size, with nothing pasted or blended into it. Only present when 'return_model_output' was set.



**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/fibo-edit-1.5/expand \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/model_tests/orange.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(
    "bria/fibo-edit-1.5/expand",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/model_tests/orange.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("bria/fibo-edit-1.5/expand", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/model_tests/orange.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/bria/fibo-edit-1.5/expand)
- [API Documentation](https://fal.ai/models/bria/fibo-edit-1.5/expand/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=bria/fibo-edit-1.5/expand)

### 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`
