happyhorse-1.1-i2v
Before use, press Access Basics to set the site root address
SHANHAI_BASE_URLand the site tokenSHANHAI_API_KEY. Thecurlcommand below applies to Bash (Linux, macOS, or Git Bash); the example image address must be replaced with an accessible real image.
Basic information
| Item | Content |
|---|---|
| Site model name | happyhorse-1.1-i2v |
| Model type | Video generation (Tusheng video) |
| Request interface | POST /v1/videos |
| Query interface | GET /v1/videos/{task_id} |
| Get video content | GET /v1/videos/{task_id}/content |
request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Must fill in happyhorse-1.1-i2v |
prompt |
string | No | Describe the main body, action and lens of the screen. It is recommended to fill in |
seconds |
integer | No | Video duration, 3 ~ 15 An integer of seconds; it is recommended to fill in |
resolution |
string | No | Can be filled in 480P, 720P, 1080P; It is recommended to fill in explicitly. The output aspect ratio follows the first frame picture |
first_frame_url |
string | is the | first frame picture address; the service must be able to access the address |
watermark |
boolean | No | Whether to add video watermark; added by default; fill in explicitly when needed to close false |
seed |
integer | No | Random seed, 0 ~ 2147483647 |
material and default behavior
When omitted, use 5 seconds and 1080P; the default frame for text generation and reference generation is 16:9, and the first frame is generated according to the image ratio. Chinese prompt words should not exceed 2,500 characters, and pure English should not exceed 5,000 characters. The model generates sounds and does not provide an independent audio switch. Do not pass in this field.
A first frame must be provided. Specifying the last frame through this model is not supported.
Pictures support JPEG, JPG, PNG, and WebP, and each picture should not exceed 20 MB. The width and height of the first frame must be at least 300 pixels, and the aspect ratio is between 1:2.5 and 2.5:1. Only the first frame must be transmitted, and the last frame or multiple images cannot be mixed in. Images must be directly accessible; assets referenced in the same task should remain available until the build is complete.
Request Example
{
"model": "happyhorse-1.1-i2v",
"prompt": "红色陶瓷杯放在桌面上,镜头缓慢移动",
"seconds": 3,
"resolution": "720P",
"first_frame_url": "https://example.com/first-frame.png"
}
curl "$SHANHAI_BASE_URL/v1/videos" \
-H "Authorization: Bearer $SHANHAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.1-i2v",
"prompt": "红色陶瓷杯放在桌面上,镜头缓慢移动",
"seconds": 3,
"resolution": "720P",
"first_frame_url": "https://example.com/first-frame.png"
}'
The JSON above is the request body, and the command that follows will submit the same request.
calling process
- Submit request to
POST /v1/videos. - Saves the real task number
idfrom the response. - Use
GET /v1/videos/{task_id}to query the status. - Continue to wait when the status is
queuedorin_progress; stop and handle the error when the status isfailed. - The final result can only be obtained when the status is
completedandGET /v1/videos/{task_id}/contentcan return video content.
Query status:
curl "$SHANHAI_BASE_URL/v1/videos/TASK_ID" \
-H "Authorization: Bearer $SHANHAI_API_KEY"
Get the video content after the task is completed:
curl "$SHANHAI_BASE_URL/v1/videos/TASK_ID/content" \
-H "Authorization: Bearer $SHANHAI_API_KEY" \
-o result.mp4
TASK_ID must be replaced with the real id returned by the create request. Successful submission only means that the task has been received, not that the video has been generated. After the request times out, please check the existing tasks first to avoid repeated generation.
encountered a problem
If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, error time and error information to facilitate troubleshooting.