# HappyHorse-1.0-I2V

Image-to-Video Model

## Submit Task (Asynchronous)

### Endpoint

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

### Input

| Parameter             | Type    | Required | Description |
| :-------------------- | :------ | :------- | :---------- |
| model                 | string  | Yes      | Model name, here it is `happyhorse-1.0-i2v` |
| input.prompt          | string  | No       | Text prompt describing the desired video content |
| input.img_url         | string  | Yes      | URL of the first frame image for the video. Also compatible with `input.first_frame_url` or `input.images[0]` |
| parameters.resolution | string  | No       | Resolution of the generated video. Available values: `720P`, `1080P`. Default is `1080P` |
| parameters.duration   | int     | No       | Video duration (seconds). Range: `3` to `15`. Default is `5` |
| parameters.watermark  | boolean | No       | Whether to add a watermark. Default is `true` |
| parameters.seed       | int     | No       | Random seed, range `[0, 2147483647]` |

### Request Example

```shell
curl --location --globoff 'https://api-us-ca.umodelverse.ai/v1/tasks/submit' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'X-DashScope-Async: enable' \
--header 'Content-Type: application/json' \
--data '{
    "model": "happyhorse-1.0-i2v",
    "input": {
      "prompt": "A cat running in a meadow",
      "img_url": "https://example.com/cat.png"
    },
    "parameters": {
      "resolution": "720P",
      "duration": 5
    }
  }'
```

### Output

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

## Query Task Status

### Endpoint

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

### 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 returned when failed                      |
| usage.duration              | integer | Billed video duration (seconds)                         |
| usage.output_video_duration | number  | Output video duration (seconds)                         |
| usage.video_count           | integer | Number of output videos                                 |
| usage.SR                    | integer | Output video resolution height, e.g. `720`, `1080`      |
| request_id                  | string  | Unique identifier of the request                        |
