happyhorse-1.1-r2v

Before use, press Access Basics to set the site root address SHANHAI_BASE_URL and the site token SHANHAI_API_KEY. The curl command 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-r2v
Model type Video generation (refer to 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-r2v
prompt string is describes the main body, action and lens of the screen
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
ratio string No Can be filled in 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9
images array Yes Reference picture URL list, 1 to 9 pictures; the example uses 1 picture
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.

The reference pictures are 1 to 9, referenced by [Image 1] and [Image 2]; when multiple pictures are needed, put the URLs in images in sequence.

Pictures support JPEG, JPG, PNG, and WebP, and each picture should not exceed 20 MB. Reference images should be at least 400 pixels on the short side, larger, clear images recommended; maximum 9 images. 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-r2v",
  "prompt": "[Image 1] 中的主体在桌面上缓慢移动,镜头保持稳定",
  "seconds": 3,
  "resolution": "720P",
  "ratio": "16:9",
  "images": ["https://example.com/reference.png"]
}
curl "$SHANHAI_BASE_URL/v1/videos" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "happyhorse-1.1-r2v",
  "prompt": "[Image 1] 中的主体在桌面上缓慢移动,镜头保持稳定",
  "seconds": 3,
  "resolution": "720P",
  "ratio": "16:9",
  "images": ["https://example.com/reference.png"]
}'

The JSON above is the request body, and the command that follows will submit the same request.

Multiple pictures for common reference

{
  "model": "happyhorse-1.1-r2v",
  "prompt": "[Image 1] 中的人物穿着 [Image 2] 中的外套,在街头缓慢行走。",
  "images": [
    "https://example.com/person.png",
    "https://example.com/jacket.png"
  ],
  "seconds": 5,
  "resolution": "720P",
  "ratio": "9:16",
  "watermark": false
}

calling process

  1. Submit request to POST /v1/videos.
  2. Saves the real task number id from the response.
  3. Use GET /v1/videos/{task_id} to query the status.
  4. Continue to wait when the status is queued or in_progress; stop and handle the error when the status is failed.
  5. The final result can only be obtained when the status is completed and GET /v1/videos/{task_id}/content can 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.