# Minimax H3 Max Recast

> Replace the people in a video with the people in your photos. Every movement, camera move, cut and the original sound stay the same.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/minimax-h3-max-recast`
- **Model ID**: `fal-ai/minimax-h3-max-recast`
- **Category**: video-to-video
- **Kind**: inference
**Tags**: minimax, motiontransfer



## Pricing

Your request will cost $0.08 per second of output for 768p and $0.16 for 1080p, charged for each shot of the source video. Each shot includes 4,096 reference tokens, shared across the source shot, the reference photos and their face close-ups; additional usage costs $0.02 per 1,000 tokens, prorated. Because every shot sends the source video as a reference, the reference charge is always part of the price. Example: a 10-second 768p video with one person costs about $2.40.

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:


- **`video_url`** (`string`, _required_):
  The source video, up to 30 seconds, with no single shot longer than 14.7 seconds.
  - Examples: "https://v3b.fal.media/files/b/0aac0919/5NYtHn5-5dxFlbH_U9oQW_video.mp4"

- **`reference_image_urls`** (`list<string>`, _required_):
  One photo per new person. By default they replace the main people in the video from left to right.
  - Array of string
  - Examples: ["https://v3b.fal.media/files/b/0aac091a/nPj0ZJtW0hTXzCFEf6vfb_T7cCVp6y.png"]

- **`prompt`** (`string`, _optional_):
  Optional: who becomes whom, or what else to keep or change.

- **`resolution`** (`ResolutionEnum`, _optional_):
   Default value: `"1080P"`
  - Default: `"1080P"`
  - Options: `"768P"`, `"1080P"`

- **`seed`** (`integer`, _optional_):
  Random seed. Leave empty for a random one.

- **`enable_safety_checker`** (`boolean`, _optional_):
  Authorized callers may set false to request relaxed screening. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "video_url": "https://v3b.fal.media/files/b/0aac0919/5NYtHn5-5dxFlbH_U9oQW_video.mp4",
  "reference_image_urls": [
    "https://v3b.fal.media/files/b/0aac091a/nPj0ZJtW0hTXzCFEf6vfb_T7cCVp6y.png"
  ]
}
```

**Full Example**:

```json
{
  "video_url": "https://v3b.fal.media/files/b/0aac0919/5NYtHn5-5dxFlbH_U9oQW_video.mp4",
  "reference_image_urls": [
    "https://v3b.fal.media/files/b/0aac091a/nPj0ZJtW0hTXzCFEf6vfb_T7cCVp6y.png"
  ],
  "resolution": "1080P",
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _required_):
  The recast video, with the source sound.

- **`seed`** (`integer`, _required_):
  The seed used.



**Example Response**:

```json
{
  "video": {
    "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/minimax-h3-max-recast \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "video_url": "https://v3b.fal.media/files/b/0aac0919/5NYtHn5-5dxFlbH_U9oQW_video.mp4",
     "reference_image_urls": [
       "https://v3b.fal.media/files/b/0aac091a/nPj0ZJtW0hTXzCFEf6vfb_T7cCVp6y.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/minimax-h3-max-recast",
    arguments={
        "video_url": "https://v3b.fal.media/files/b/0aac0919/5NYtHn5-5dxFlbH_U9oQW_video.mp4",
        "reference_image_urls": ["https://v3b.fal.media/files/b/0aac091a/nPj0ZJtW0hTXzCFEf6vfb_T7cCVp6y.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/minimax-h3-max-recast", {
  input: {
    video_url: "https://v3b.fal.media/files/b/0aac0919/5NYtHn5-5dxFlbH_U9oQW_video.mp4",
    reference_image_urls: ["https://v3b.fal.media/files/b/0aac091a/nPj0ZJtW0hTXzCFEf6vfb_T7cCVp6y.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/minimax-h3-max-recast)
- [API Documentation](https://fal.ai/models/fal-ai/minimax-h3-max-recast/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/minimax-h3-max-recast)

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