# FILM

> Interpolate images with FILM - Frame Interpolation for Large Motion


## Overview

- **Endpoint**: `https://fal.run/fal-ai/film`
- **Model ID**: `fal-ai/film`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: interpolation



## Pricing

Your request will cost **$0.0013** per compute second.

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:


- **`start_image_url`** (`string`, _required_):
  The URL of the first image to use as the starting point for interpolation.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/interpolate-start-frame.png"

- **`end_image_url`** (`string`, _required_):
  The URL of the second image to use as the ending point for interpolation.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/interpolate-end-frame.png"

- **`output_type`** (`OutputTypeEnum`, _optional_):
  The type of output to generate; either individual images or a video. Default value: `"images"`
  - Default: `"images"`
  - Options: `"images"`, `"video"`

- **`image_format`** (`ImageFormatEnum`, _optional_):
  The format of the output images. Only applicable if output_type is 'images'. Default value: `"jpeg"`
  - Default: `"jpeg"`
  - Options: `"png"`, `"jpeg"`

- **`video_quality`** (`VideoQualityEnum`, _optional_):
  The quality of the output video. Only applicable if output_type is 'video'. Default value: `"high"`
  - Default: `"high"`
  - Options: `"low"`, `"medium"`, `"high"`, `"maximum"`
  - Examples: "high"

- **`video_write_mode`** (`VideoWriteModeEnum`, _optional_):
  The write mode of the output video. Only applicable if output_type is 'video'. Default value: `"balanced"`
  - Default: `"balanced"`
  - Options: `"fast"`, `"balanced"`, `"small"`
  - Examples: "balanced"

- **`num_frames`** (`integer`, _optional_):
  The number of frames to generate between the input images. Default value: `1`
  - Default: `1`
  - Range: `1` to `64`

- **`include_start`** (`boolean`, _optional_):
  Whether to include the start image in the output.
  - Default: `false`

- **`include_end`** (`boolean`, _optional_):
  Whether to include the end image in the output.
  - Default: `false`

- **`fps`** (`integer`, _optional_):
  Frames per second for the output video. Only applicable if output_type is 'video'. Default value: `8`
  - Default: `8`
  - Range: `1` to `60`

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`



**Required Parameters Example**:

```json
{
  "start_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-start-frame.png",
  "end_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-end-frame.png"
}
```

**Full Example**:

```json
{
  "start_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-start-frame.png",
  "end_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-end-frame.png",
  "output_type": "images",
  "image_format": "jpeg",
  "video_quality": "high",
  "video_write_mode": "balanced",
  "num_frames": 1,
  "fps": 8
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<ImageFile>`, _optional_):
  The generated frames as individual images.
  - Default: `[]`
  - Array of ImageFile
  - Examples: [{"url":"https://storage.googleapis.com/falserverless/example_outputs/film-mid-frame.jpeg"}]

- **`video`** (`VideoFile`, _optional_):
  The generated video file, if output_type is 'video'.



**Example Response**:

```json
{
  "images": [
    {
      "url": "https://storage.googleapis.com/falserverless/example_outputs/film-mid-frame.jpeg"
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/film \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "start_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-start-frame.png",
     "end_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-end-frame.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/film",
    arguments={
        "start_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-start-frame.png",
        "end_image_url": "https://storage.googleapis.com/falserverless/example_inputs/interpolate-end-frame.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/film", {
  input: {
    start_image_url: "https://storage.googleapis.com/falserverless/example_inputs/interpolate-start-frame.png",
    end_image_url: "https://storage.googleapis.com/falserverless/example_inputs/interpolate-end-frame.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/film)
- [API Documentation](https://fal.ai/models/fal-ai/film/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/film)

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