> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modelslab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Image to Video

> This endpoint animates between a first and a last frame, or generates a video from image, video and audio references, using the MiniMax H3 model.

> [!WARNING]
>
> Make sure you add your [s3 details](https://docs.modelslab.com/enterprise-api/general/update-s3-details.mdx) for the `minimax_h3` server, so you can receive the video generated in your bucket.
> Videos generated without s3 details being added will be deleted after **24 hours**.

MiniMax H3 serves two image-to-video capabilities from this single endpoint, and nothing else in the
payload tells them apart — a single `init_image` is a valid request to either — so `model_id` is
**required** here:

| `model_id` | What it does |
| - | - |
| `h3-minimax-start-end-frame` | Animates between a first and a last frame. |
| `h3-minimax-r2v` | Generates a video from a list of image, video and audio references. |

A request without a valid `model_id` is rejected with:

```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "status": "error",
  "message": "model_id is required for image to video: send h3-minimax-start-end-frame to animate between a first and a last frame, or h3-minimax-r2v to generate from references."
}
```

## Request

Make a `POST` request to below endpoint and pass the required parameters as a request body.

```curl curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
--request POST 'https://modelslab.com/api/v1/enterprise/minimax_h3/img2video' \
```

> [tab] First & Last Frame
>
> Animates between two frames. Both are sent in `init_image` as a list of **exactly two** images — the
> first frame, then the last frame. One image is not enough, and a third would be silently dropped, so
> anything other than two is refused.
>
> ## Body
>
> ```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
> {
>   "key": "enterprise_api_key",
>   "model_id": "h3-minimax-start-end-frame",
>   "prompt": "the camera pushes in slowly as the doors open",
>   "init_image": [
>     "https://assets.modelslab.ai/generations/first-frame.png",
>     "https://assets.modelslab.ai/generations/last-frame.png"
>   ],
>   "width": 1024,
>   "height": 576,
>   "duration": 5,
>   "num_frames": 120,
>   "num_inference_steps": 30,
>   "seed": null,
>   "instant_response": false,
>   "temp": false,
>   "base64": false,
>   "webhook": null,
>   "track_id": null
> }
> ```
>
> ## Body Attributes
>
> **key** `string` *required*
>
> Your API Key used for request authorization.
>
> **model\_id** `string` *required* (default: h3-minimax-start-end-frame)
>
> Must be `h3-minimax-start-end-frame` for this mode.
>
> **prompt** `string` *required*
>
> Text prompt with a description of the motion you want between the two frames.
>
> **init\_image** `array` *required*
>
> A list of **exactly two** images — the first frame, then the last frame. Each entry is a link to a valid PNG, JPEG or other image format file, or a base64 string.
>
> **width** `number`
>
> Width of the generated frame. Must be a multiple of **32** and at most **1536**. Must be sent together with `height`.
>
> **height** `number`
>
> Height of the generated frame. Must be a multiple of **32** and at most **1536**. Must be sent together with `width`.
>
> **duration** `number`
>
> Length of the generated video in seconds. Minimum is `5`, maximum is `15`.
>
> **num\_frames** `number`
>
> The number of frames in the generated video. Minimum is `120`, maximum is `345`.
>
> **num\_inference\_steps** `number`
>
> Number of denoising steps. Minimum is `1`, maximum is `50`.
>
> **seed** `number`
>
> Seed is used to reproduce results. The same seed will give you the same video again. Pass *null* for a random number.
>
> **instant\_response** `boolean` (default: false)
>
> Queue response instantly before processing finishes instead of waiting a minimum amount of time. **default**: `false`, **options**: `true` or `false`.
>
> **temp** `boolean` (default: false)
>
> If true, stores the video in temporary storage which is cleaned every 24 hours. **default**: `false`, **options**: `true` or `false`.
>
> **base64** `boolean` (default: false)
>
> Set to `true` when the images in `init_image` are sent as base64 strings instead of URLs. **default**: `false`, **options**: `true` or `false`.
>
> **webhook** `string`
>
> Set a URL to get a POST API call once the video generation is complete.
>
> **track\_id** `string`
>
> This ID is returned in the response to the webhook API call. This will be used to identify the webhook request.

> [tab] Reference to Video
>
> Generates a video from references. Images carry identity and style, videos carry motion and camera
> work, and audio carries timbre or dialogue — any one of them is enough on its own, so at least one of
> `init_image`, `init_video` or `init_audio` is required. The prompt is optional in this mode: with an
> identity to follow, the references carry the shot.
>
> Each field takes a single reference as a string, or several as a list:
>
> | Field | Max references |
> | - | - |
> | `init_image` | 9 |
> | `init_video` | 3 |
> | `init_audio` | 3 |
> | **All fields combined** | **12** |
>
> > [!NOTE]
> >
> > A data URI (`data:image/png;base64,...`) contains a comma of its own and cannot be combined with
> > other references in the same field. Send a single data URI per field, or send the references as
> > raw base64 strings or URLs.
>
> ## Body
>
> ```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
> {
>   "key": "enterprise_api_key",
>   "model_id": "h3-minimax-r2v",
>   "prompt": "she turns to face the camera and smiles",
>   "init_image": [
>     "https://assets.modelslab.ai/generations/reference-1.png",
>     "https://assets.modelslab.ai/generations/reference-2.png"
>   ],
>   "init_video": "https://assets.modelslab.ai/generations/motion-reference.mp4",
>   "init_audio": null,
>   "width": 1024,
>   "height": 576,
>   "resolution": 720,
>   "adaptive_resolution": true,
>   "duration": 5,
>   "num_frames": 120,
>   "num_inference_steps": 30,
>   "num_samples": 1,
>   "safety_checker": false,
>   "seed": null,
>   "instant_response": false,
>   "temp": false,
>   "base64": false,
>   "webhook": null,
>   "track_id": null
> }
> ```
>
> ## Body Attributes
>
> **key** `string` *required*
>
> Your API Key used for request authorization.
>
> **model\_id** `string` *required* (default: h3-minimax-r2v)
>
> Must be `h3-minimax-r2v` for this mode.
>
> **prompt** `string`
>
> Text prompt with a description of the things you want in the video. Optional in this mode — the model falls back to a prompt of its own when the references carry the shot.
>
> **init\_image** `string | array`
>
> One image reference, or a list of up to **9**. Carries identity and style. Each entry is a link to a valid PNG, JPEG or other image format file, or a base64 string.
>
> **init\_video** `string | array`
>
> One video reference, or a list of up to **3**. Carries motion and camera work.
>
> **init\_audio** `string | array`
>
> One audio reference, or a list of up to **3**. Carries timbre or dialogue.
>
> **width** `number`
>
> Width of the generated frame. Must be a multiple of **32** and at most **1536**. Must be sent together with `height`.
>
> **height** `number`
>
> Height of the generated frame. Must be a multiple of **32** and at most **1536**. Must be sent together with `width`.
>
> **resolution** `number`
>
> Resolution of the generated output. Minimum is `320`, maximum is `1536`.
>
> **adaptive\_resolution** `boolean` (default: true)
>
> Let the model pick the output resolution from the references instead of holding it fixed. **default**: `true`, **options**: `true` or `false`.
>
> **duration** `number`
>
> Length of the generated video in seconds. Minimum is `5`, maximum is `15`.
>
> **num\_frames** `number`
>
> The number of frames in the generated video. Minimum is `120`, maximum is `345`.
>
> **num\_inference\_steps** `number`
>
> Number of denoising steps. Minimum is `1`, maximum is `50`.
>
> **num\_samples** `number` (default: 1)
>
> Number of videos to be returned in the response. The maximum value is `4`.
>
> **safety\_checker** `boolean` (default: false)
>
> A checker for NSFW outputs. If such an output is detected, it will be replaced by a blank one. **default**: `false`, **options**: `true` or `false`.
>
> **seed** `number`
>
> Seed is used to reproduce results. The same seed will give you the same video again. Pass *null* for a random number.
>
> **instant\_response** `boolean` (default: false)
>
> Queue response instantly before processing finishes instead of waiting a minimum amount of time. **default**: `false`, **options**: `true` or `false`.
>
> **temp** `boolean` (default: false)
>
> If true, stores the video in temporary storage which is cleaned every 24 hours. **default**: `false`, **options**: `true` or `false`.
>
> **base64** `boolean` (default: false)
>
> Set to `true` when the references are sent as base64 strings instead of URLs. **default**: `false`, **options**: `true` or `false`.
>
> **webhook** `string`
>
> Set a URL to get a POST API call once the video generation is complete.
>
> **track\_id** `string`
>
> This ID is returned in the response to the webhook API call. This will be used to identify the webhook request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.