# Wan-AI/Wan2.5-I2V

Image-to-Video model

## Asynchronous Task Submission

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/submit`

### Input

| Parameter                           | Type    | Required | Description                                                                                                   |
| :---------------------------------- | :------ | :------ | :------------------------------------------------------------------------------------------------------------ |
| model                               | string  | Yes     | Model name, here it is `Wan-AI/Wan2.5-I2V`                                                                    |
| input.negative_prompt               | string  | No      | Negative prompt to restrict unwanted content                                                                  |
| input.first_frame_url               | string  | Yes     | URL of the first frame image of the video                                                                     |
| input.audio_url                     | string  | No      | Audio URL to guide generation. If the audio duration exceeds the specified video length, it will be truncated; if shorter, the latter part of the video will be silent. |
| input.prompt                        | string  | Yes     | Prompt to guide the video generation                                                                          |
| parameters.resolution               | string  | Yes     | Video resolution options: 480p, 720p, 1080p                                                                   |
| parameters.duration                 | int     | No      | Video generation duration in seconds, options: `5` or `10`, default is `5`                                    |
| parameters.enable_prompt_expansion  | boolean | No      | Whether to enable automated prompt tuning, default is `false`                                                 |
| parameters.seed                     | int     | No      | Random seed, range `[-1, 2147483647]`, -1 indicates random                                                    |

### Request Example
⚠️ If you are using Windows, Postman or other API tools are recommended.
```shell
curl --location --globoff 'https://api-us-ca.umodelverse.ai/v1/tasks/submit' \
--header 'Authorization: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "Wan-AI/Wan2.5-I2V",
    "input": {
      "first_frame_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
      "audio_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/%E9%94%A6%E7%91%9F.mp3",
      "prompt": "make it swim"
    },
    "parameters": {
      "resolution": "720p",
      "duration": 5
    }
  }'
```

### Output

| Parameter        | Type   | Description            |
| :--------------- | :----- | :--------------------- |
| output.task_id   | string | Unique identifier for the asynchronous task |
| request_id       | string | Unique identifier for the request       |

### Response Example

```json
{
  "output": {
    "task_id": "task_id"
  },
  "request_id": "request_id"
}
```

## Check Task Status

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/status?task_id=<task_id>`

### Request Example

```shell
curl --location 'https://api-us-ca.umodelverse.ai/v1/tasks/status?task_id=<task_id>' \
--header 'Authorization: <YOUR_API_KEY>'
```

### Output

| Parameter               | Type    | Description                                         |
| :---------------------- | :------ | :-------------------------------------------------- |
| output.task_id          | string  | Unique identifier for the asynchronous task         |
| output.task_status      | string  | Task status: `Pending`,`Running`,`Success`,`Failure`|
| output.urls             | array   | List of URLs with the video results                 |
| output.submit_time      | integer | Task submission timestamp                           |
| output.finish_time      | integer | Task completion timestamp                           |
| output.error_message    | string  | Error message returned on failure                   |
| usage.duration          | integer | Duration of task execution in seconds               |
| request_id              | string  | Unique identifier for the request                   |

### Response Example

```json
{
  "output": {
    "task_id": "task_id",
    "task_status": "Success",
    "urls": ["https://xxxxx/xxxx.mp4"],
    "submit_time": 1756959000,
    "finish_time": 1756959050
  },
  "usage": {
    "duration": 5
  },
  "request_id": ""
}
```