# H3 Max Relight

> Relight any video with H3 Max from a lighting sphere image, while preserving the source subjects, motion, camera and audio.


## Overview

- **Endpoint**: `https://fal.run/minimax/h3-max/relight`
- **Model ID**: `minimax/h3-max/relight`
- **Category**: video-to-video
- **Kind**: inference
**Description**: Change the lighting of an existing video. Provide a source video (up to 15 seconds) and a sphere render that shows the target lighting: its color, direction and shadow softness. The model describes the source scene, reads the light from the sphere, and regenerates the video with that lighting while keeping the subjects, setting, motion and camera. The source is converted to 24 fps and the output matches its length (at least about 2.3 seconds). Choose 480p, 768p (default), 1080p or 2K (1080p and 2K are refined from 768p) and an aspect ratio (16:9 by default, or adaptive). Safety checking is enabled by default.

**Tags**: video-to-video, video-editing, relighting



## Pricing

Billing is calculated per second of generated video, which matches the source video length. Video costs **$0.05** per second at **480p**, **$0.08** per second at **768p**, **$0.16** per second at **1080p**, and **$0.32** per second at **2K**. A **5-second** video at **768p** costs **$0.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_):
  Source video up to 15 seconds long. Converted to constant 24 fps and trimmed at the end to the closest 17n+5 frame count, with at least 56 frames (about 2.33 seconds) remaining. The output matches this prepared video's frame count and duration.

- **`reference_image_url`** (`string`, _required_):
  Sphere render showing the target lighting.

- **`resolution`** (`ResolutionEnum`, _optional_):
  Output video resolution. 480P and 768P generate natively; 1080P and 2K (1440p) use latent upscaling and refinement from 768P. Default value: `"768P"`
  - Default: `"768P"`
  - Options: `"480P"`, `"768P"`, `"1080P"`, `"2K"`

- **`aspect_ratio`** (`AspectRatioEnum`, _optional_):
  Output video aspect ratio. Default value: `"16:9"`
  - Default: `"16:9"`
  - Options: `"adaptive"`, `"21:9"`, `"16:9"`, `"4:3"`, `"1:1"`, `"3:4"`, `"9:16"`

- **`seed`** (`integer`, _optional_):
  Random seed for video generation.

- **`enable_safety_checker`** (`boolean`, _optional_):
  Enable safety checking. Default value: `true`
  - Default: `true`

- **`sync_mode`** (`boolean`, _optional_):
  Return video as a data URI.
  - Default: `false`



**Required Parameters Example**:

```json
{
  "video_url": "",
  "reference_image_url": ""
}
```

**Full Example**:

```json
{
  "video_url": "",
  "reference_image_url": "",
  "resolution": "768P",
  "aspect_ratio": "16:9",
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _required_):
  The relighted video.

- **`seed`** (`integer`, _required_):
  Base seed for reproducing the generation.

- **`timings`** (`object`, _optional_):
  Inference duration in seconds, when available.



**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/minimax/h3-max/relight \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "video_url": "",
     "reference_image_url": ""
   }'
```

### 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(
    "minimax/h3-max/relight",
    arguments={
        "video_url": "",
        "reference_image_url": ""
    },
    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("minimax/h3-max/relight", {
  input: {
    video_url: "",
    reference_image_url: ""
  },
  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/minimax/h3-max/relight)
- [API Documentation](https://fal.ai/models/minimax/h3-max/relight/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=minimax/h3-max/relight)

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