# Luma Photon Reframe

> Extend and reframe images with Luma Photon Reframe. This advanced tool intelligently expands your visuals, seamlessly blending new content to enhance creativity and adaptability, offering unmatched personalization and quality for creators at a fraction of the cost.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/luma-photon/reframe`
- **Model ID**: `fal-ai/luma-photon/reframe`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: outpainting, reframe



## Pricing

- **Price**: $0.019 per megapixels

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_):
  URL of the input image to reframe
  - Examples: "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png"

- **`aspect_ratio`** (`AspectRatioEnum`, _required_):
  The aspect ratio of the reframed image
  - Options: `"1:1"`, `"16:9"`, `"9:16"`, `"4:3"`, `"3:4"`, `"21:9"`, `"9:21"`
  - Examples: "16:9"

- **`prompt`** (`string`, _optional_):
  Optional prompt for reframing

- **`grid_position_x`** (`integer`, _optional_):
  X position of the grid for reframing

- **`grid_position_y`** (`integer`, _optional_):
  Y position of the grid for reframing

- **`x_end`** (`integer`, _optional_):
  End X coordinate for reframing

- **`x_start`** (`integer`, _optional_):
  Start X coordinate for reframing

- **`y_end`** (`integer`, _optional_):
  End Y coordinate for reframing

- **`y_start`** (`integer`, _optional_):
  Start Y coordinate for reframing



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png",
  "aspect_ratio": "16:9"
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<File>`, _required_):
  The generated image
  - Array of File



**Example Response**:

```json
{
  "images": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/luma-photon/reframe \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png",
     "aspect_ratio": "16:9"
   }'
```

### 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/luma-photon/reframe",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png",
        "aspect_ratio": "16:9"
    },
    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/luma-photon/reframe", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png",
    aspect_ratio: "16:9"
  },
  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/luma-photon/reframe)
- [API Documentation](https://fal.ai/models/fal-ai/luma-photon/reframe/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/luma-photon/reframe)

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