# Wan-AI/Wan2.6-R2V-Flash

Reference-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 `wan2.6-r2v-flash` |
| input.prompt | string | Yes | Prompt used to guide video generation |
| input.reference_urls | []string | Yes | Array of uploaded reference file URLs. Supports both videos and images. Used to extract character appearance and voice (if applicable) to generate a video consistent with the reference characteristics. <br/>Each URL may point to one image or one video. When multiple reference files are provided, characters are assigned in array order: the 1st URL corresponds to character1, the 2nd to character2, and so on. Each reference file should contain only one main subject. For example, character1 could be a little girl and character2 a clock. Limits on the number of images and videos are as follows:<br/> - Images: 0–5.<br/> - Videos: 0–3.<br/> - Total: images + videos ≤ 5.<br/><strong>Reference video requirements:</strong><ul><li>Format: MP4, MOV</li><li>Duration: 1s–30s</li><li>File size: no more than 100 MB</li></ul><strong>Reference image requirements:</strong><ul><li>Format: JPEG, JPG, PNG (transparency not supported), BMP, WEBP</li><li>Resolution: width and height must each be between 240 and 8000 pixels</li><li>File size: no more than 20 MB</li></ul> |
| parameters.size | string | Yes | Output video size. <br/>Supported resolutions and aspect ratios:<br/>720P:<br/>- 1280x720: 16:9<br/>- 720x1280: 9:16<br/>1080P:<br/>- 1920x1080: 16:9<br/>- 1080x1920: 9:16 |
| parameters.duration | int | No | Video duration in seconds. Options: `5` or `10`. Default: `5` |
| parameters.shot_type | string | No | Specifies the shot type: single continuous shot or multiple shots. Priority: `shot_type` > `prompt`. For example, if `shot_type` is set to `single`, the model will output a single-shot video even if the prompt requests multiple shots. Options: `single` (default, outputs a single-shot video), `multi` (outputs a multi-shot video). Example: `single` |
| parameters.watermark | bool | No | Whether to add a watermark. The watermark is placed in the bottom-right corner of the video with the fixed text "AI Generated". `false`: default, no watermark. `true`: add watermark. |
| parameters.audio | bool | No | Whether to include audio output. Default: `false` |

### 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": "wan2.6-r2v-flash",
    "input": {
        "prompt": "Character2 sits in a chair by the window, holding character3, playing a soothing American country folk song next to character4. Character1 says to Character2: \"Sounds great\"",
        "reference_urls": [
            "https://example.com/wan-r2v-role1.mp4",
            "https://example.com/wan-r2v-role2.mp4",
            "https://example.com/wan-r2v-object4.png",
            "https://example.com/wan-r2v-backgroud5.png"
        ]
    },
    "parameters": {
        "size": "1920x1080",
        "duration": 5,
        "audio":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                               |
| error.message        | string  | Error message                                           |
| error.type           | string  | Error type                                              |
| error.code           | string  | Error code                                              |

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