# Wan-AI/Wan2.6-I2V

Image-to-video model

## Submit Async Task

### 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.6-I2V` |
| input.prompt | string | Yes | Prompt used to guide video generation |
| input.negative_prompt | string | No | Negative prompt used to restrict undesired content |
| input.img_url | string | No | URL of the first frame image |
| input.audio_url | string | No | Audio URL for guidance. If the audio duration exceeds the video duration, it will be truncated; if shorter, the latter part of the video will be silent |
| parameters | object | No | Video processing parameters such as resolution, duration, prompt enhancement, watermark, etc. |
| parameters.resolution | string | No | Target video resolution level (affects total pixels). The model automatically scales to a similar total pixel count while maintaining the aspect ratio of `img_url`. **Important**: `resolution` directly affects cost. For the same model: 1080P > 720P. Please confirm pricing before calling. For `Wan-AI/Wan2.6-I2V`: options are `720P`, `1080P`. Default is `1080P`. Example: `1080P` |
| parameters.duration | int | No | Video duration in seconds. Options: `5`, `10`, `15` |
| parameters.seed | int | No | Random seed, range `[0, 4294967295]` |
| parameters.prompt_extend | boolean | No | Whether to enable prompt enhancement. If enabled, a large model rewrites the prompt to improve results. More effective for short prompts but increases latency. Default: `true`. Example: `true` |
| parameters.shot_type | string | No | Specifies the shot type: single continuous shot or multiple shots. Effective only when `prompt_extend=true`. Priority: `shot_type` > `prompt`. For example, if `shot_type` is `single`, the model will output a single-shot video even if the prompt requests multiple shots. Options: `single` (default), `multi`. Example: `single` |

### Request Example

⚠️ If you are using Windows, it is recommended to use Postman or another API client tool.
```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.6-I2V",
    "input": {
      "img_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
      "prompt": "make it swim"
    },
    "parameters": {
      "resolution": "1080P",
      "duration": 5,
      "prompt_extend": true,
      "shot_type": "single"
    }
  }'
```

### Output

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

### Response Example

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

## Query 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 of the async task                     |
| output.task_status   | string  | Task status: `Pending`, `Running`, `Success`, `Failure` |
| output.urls          | array   | List of video result URLs                               |
| output.submit_time   | integer | Task submission timestamp                               |
| output.finish_time   | integer | Task completion timestamp                               |
| output.error_message | string  | Error message when failed                               |
| usage.duration       | integer | Task execution duration (seconds)                       |
| request_id           | string  | Unique request identifier                               |

### Response Example (Success)

```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": ""
}
```

### Response Example (Failure)

```json
{
  "output": {
    "task_id": "task_id",
    "task_status": "Failure",
    "submit_time": 1756959000,
    "finish_time": 1756959019,
    "error_message": "error_message"
  },
  "usage": {
    "duration": 5
  },
  "request_id": ""
}
```
