seedinteger
Random seed for reproducible results. Set to -1 for random seed.
alibaba/happy-horse/reference-to-videoAlibaba's #1-ranked Happy Horse 1.0 generates stunning 1080p videos with synchronized native audio and multilingual lip-sync, transforming text prompts or images into cinematic, true-to-life motion content for next-generation AIGC creation.
Thử model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Bạn muốn làm gì tiếp theo?
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.
{
"duration": 3,
"images": [
"https://static.sandbase.ai/examples/980bea80-d0f0-4a93-a123-a4cc00ba9a8d/input/4c5e3307-6130-44c4-8b60-6e2da3a68c0e.jpg"
],
"prompt": "[Image 1] waves at the camera in a park",
"resolution": "720p"
}Happy Horse 1.0 reference-to-video: place subjects from reference images into a new scene described by the prompt.
| Field | Type | Default | Notes |
|---|---|---|---|
images | image URL[], required | — | Reference images, Image 1, Image 2, … |
prompt | string, required | — | Up to 50,000 characters. |
duration | 3–15 | 5 | Output length in seconds. |
aspect_ratio | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 | 16:9 | Output frame shape. |
resolution | 720p / 1080p | 720p | Sets the per-second rate. |
seed | integer | random | Fix it to compare prompt changes. |
You pay for output seconds: $0.14 at 720p and $0.24 at 1080p, Alibaba's list price.
| Output | 720p | 1080p |
|---|---|---|
| 3s | $0.42 | $0.72 |
| 5s (default) | $0.70 | $1.20 |
| 10s | $1.40 | $2.40 |
| 15s | $2.10 | $3.60 |
Failed runs are not charged.
Other Happy Horse endpoints: alibaba/happy-horse/text-to-video, alibaba/happy-horse/image-to-video, alibaba/happy-horse/video-edit, alibaba/happy-horse/1.1/reference-to-video (newer).
Bắt đầu xây dựng
Gửi model này qua SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "alibaba/happy-horse/reference-to-video",
"images": [
"https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9000146771/p1067182.webp",
"https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9000146771/p1067183.webp"
],
"prompt": "In the early morning, just as the sun begins to rise, a small pumpkin sits in the pumpkin patch with dewdrops glistening on its surface. Suddenly, with a crisp crack, a fissure appears on the little pumpkin, and golden light shines through the crack. The pumpkin splits open along with the golden glow, releasing a puff of white mist, and a little rabbit appears in the center of the cracked pumpkin.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
seedintegerRandom seed for reproducible results. Set to -1 for random seed.
imagesarraybắt buộcThe URLs of the images to use for image-to-image generation or image editing.
promptstringbắt buộcThe text prompt to generate a video from, guided by the reference image.
Mặc định: "In the early morning, just as the sun begins to rise, a small pumpkin sits in the pumpkin patch with dewdrops glistening on its surface. Suddenly, with a crisp crack, a fissure appears on the little pumpkin, and golden light shines through the crack. The pumpkin splits open along with the golden glow, releasing a puff of white mist, and a little rabbit appears in the center of the cracked pumpkin."
durationintegerThe duration of the generated video in seconds.
Mặc định: 5
Giá trị có thể dùng: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
resolutionstringThe resolution of the video to generate.
Mặc định: "720p"
Giá trị có thể dùng: "720p", "1080p"
aspect_ratiostringThe aspect ratio of the generated video.
Mặc định: "16:9"
Giá trị có thể dùng: "16:9", "9:16", "1:1", "4:3", "3:4"
{
"model": "alibaba/happy-horse/reference-to-video",
"images": [
"https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9000146771/p1067182.webp",
"https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9000146771/p1067183.webp"
],
"prompt": "In the early morning, just as the sun begins to rise, a small pumpkin sits in the pumpkin patch with dewdrops glistening on its surface. Suddenly, with a crisp crack, a fissure appears on the little pumpkin, and golden light shines through the crack. The pumpkin splits open along with the golden glow, releasing a puff of white mist, and a little rabbit appears in the center of the cracked pumpkin.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
[
{
"poster": "https://static.sandbase.ai/examples/posters/a16eec17bd8a349ef6a6.jpg",
"source": "Self organization completed prediction",
"source_url": "https://www.sandbase.ai",
"url": "https://static.sandbase.ai/examples/980bea80-d0f0-4a93-a123-a4cc00ba9a8d/output/2ec0ff53-a49b-4457-b743-238d3996cfd6.mp4"
}
]