# Rife

> Interpolate videos with RIFE - Real-Time Intermediate Flow Estimation


## Overview

- **Endpoint**: `https://fal.run/fal-ai/rife/exr`
- **Model ID**: `fal-ai/rife/exr`
- **Category**: video-to-video
- **Kind**: inference


## Pricing

Your request will cost **$0.00025** per megapixel.

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:


- **`frame_urls`** (`list<string>`, _required_):
  URLs of the source frames as OpenEXR files, in playback order. Pixels are read as scene-linear ACES (see color_space); values above 1.0 and negative values are preserved. Every frame must share one data window. The R, G, B and optional A channels are interpolated; other channels and layers are ignored. Only http(s) URLs are accepted, and source frames are returned exactly as sent.
  - Array of string
  - Examples: ["https://v3b.fal.media/files/b/0ab4fdee/5oaP0hdjontVU6deiWsyK_frame_0000.exr","https://v3b.fal.media/files/b/0ab4fdee/jKjlDI_OMwJgx06N6k0X6_frame_0001.exr","https://v3b.fal.media/files/b/0ab4fdee/FMh2Hzs1mof8c9Mk88Nll_frame_0002.exr"]

- **`num_frames`** (`integer`, _optional_):
  The number of frames to generate between each pair of source frames. Default value: `1`
  - Default: `1`
  - Range: `1` to `4`

- **`loop`** (`boolean`, _optional_):
  If True, frames are also generated between the last and the first source frame, for a seamless loop. The first frame is not repeated at the end.
  - Default: `false`

- **`color_space`** (`ColorSpaceEnum`, _optional_):
  Scene-linear colour space of the frames: ACES2065-1 (AP0) or ACEScg (AP1). Generated frames are written in the same space. 'auto' follows each file's `chromaticities` attribute and treats untagged files as ACES2065-1. A frame whose chromaticities name the other ACES space is rejected. Default value: `"auto"`
  - Default: `"auto"`
  - Options: `"auto"`, `"aces2065-1"`, `"acescg"`



**Required Parameters Example**:

```json
{
  "frame_urls": [
    "https://v3b.fal.media/files/b/0ab4fdee/5oaP0hdjontVU6deiWsyK_frame_0000.exr",
    "https://v3b.fal.media/files/b/0ab4fdee/jKjlDI_OMwJgx06N6k0X6_frame_0001.exr",
    "https://v3b.fal.media/files/b/0ab4fdee/FMh2Hzs1mof8c9Mk88Nll_frame_0002.exr"
  ]
}
```

**Full Example**:

```json
{
  "frame_urls": [
    "https://v3b.fal.media/files/b/0ab4fdee/5oaP0hdjontVU6deiWsyK_frame_0000.exr",
    "https://v3b.fal.media/files/b/0ab4fdee/jKjlDI_OMwJgx06N6k0X6_frame_0001.exr",
    "https://v3b.fal.media/files/b/0ab4fdee/FMh2Hzs1mof8c9Mk88Nll_frame_0002.exr"
  ],
  "num_frames": 1,
  "color_space": "auto"
}
```


### Output Schema

The API returns the following output format:

- **`frames`** (`list<File>`, _required_):
  The full frame sequence in playback order. Source frames are returned as their original URLs, untouched. Interpolated frames are half-float OpenEXR files in `color_space` that keep the first source frame's header attributes and carry AIGC metadata (`AIGC`, `digitalSourceType`, `software`, `comments`).
  - Array of File

- **`is_interpolated`** (`list<boolean>`, _required_):
  One boolean per entry in `frames`: True if fal generated the frame.
  - Array of boolean

- **`color_space`** (`ColorSpaceEnum`, _required_):
  The colour space the frames were read and written in.
  - Options: `"aces2065-1"`, `"acescg"`



**Example Response**:

```json
{
  "frames": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019
    }
  ],
  "color_space": "aces2065-1"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/rife/exr \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "frame_urls": [
       "https://v3b.fal.media/files/b/0ab4fdee/5oaP0hdjontVU6deiWsyK_frame_0000.exr",
       "https://v3b.fal.media/files/b/0ab4fdee/jKjlDI_OMwJgx06N6k0X6_frame_0001.exr",
       "https://v3b.fal.media/files/b/0ab4fdee/FMh2Hzs1mof8c9Mk88Nll_frame_0002.exr"
     ]
   }'
```

### 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/rife/exr",
    arguments={
        "frame_urls": ["https://v3b.fal.media/files/b/0ab4fdee/5oaP0hdjontVU6deiWsyK_frame_0000.exr", "https://v3b.fal.media/files/b/0ab4fdee/jKjlDI_OMwJgx06N6k0X6_frame_0001.exr", "https://v3b.fal.media/files/b/0ab4fdee/FMh2Hzs1mof8c9Mk88Nll_frame_0002.exr"]
    },
    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/rife/exr", {
  input: {
    frame_urls: ["https://v3b.fal.media/files/b/0ab4fdee/5oaP0hdjontVU6deiWsyK_frame_0000.exr", "https://v3b.fal.media/files/b/0ab4fdee/jKjlDI_OMwJgx06N6k0X6_frame_0001.exr", "https://v3b.fal.media/files/b/0ab4fdee/FMh2Hzs1mof8c9Mk88Nll_frame_0002.exr"]
  },
  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);
```


## Deploy your own model

To run your own weights, a fine-tune or a custom pipeline on the GPUs that serve this API, deploy it on fal Serverless. GPUs from H100 (80GB) to B300 (288GB), billed per second; an H100 is $4.50/h list, as low as $2.49/h. Prices, GPU specs and deploy steps: [fal Serverless](https://fal.ai/serverless.md).

## Additional Resources

### Documentation

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

### 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
- [Pricing](https://fal.ai/pricing.md): Model API and Serverless GPU prices
- [fal Serverless](https://fal.ai/serverless.md): Deploy your own models: GPU prices, specs and steps
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
