The observatory dome slowly rotates open as the first sunlight sweeps across the plateau, haze drifting through the valley, camera gently pushing in, no text, no logos, no watermark, no promotional marks
Happy Horse 1.0 Image to Video API
alibaba/happyhorse-1.0/image-to-videoHappy Horse 1.0 Image to Video 将单张静态图像转化为电影感动态短视频,支持 3–15 秒连贯时长、720p 与 1080p 梯级分辨率,以及可选提示词引导。它能够高保真保留开场主体容貌、材质细节与构图透视,同时赋予画面物理真实的自然动作延伸与流畅运镜。
拖拽文件、粘贴剪贴板素材,或输入 URL。
生成的视频会显示在这里
填写提示词并添加所需素材,确认设置后点击“运行”。
示例
REST API
快速开始
使用 API 认证,提交单张首帧图片及可选运动指令,通过任务 ID 获取视频。
连接到 Vidgo API
创建 API 密钥,仅保存在服务器上,并发送 Authorization: Bearer VIDGO_API_KEY。
- 端点
- POST
https://api.vidgo.ai/api/generate/submit - 认证
- Authorization: Bearer VIDGO_API_KEY
提交一次生成任务
按请求示例填写输入,image_urls 填入首帧图,model 必须是 alibaba/happyhorse-1.0/image-to-video。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/happyhorse-1.0/image-to-video",
"input": {
"prompt": "The observatory dome slowly rotates open as the first sunlight sweeps across the plateau, haze drifting through the valley, camera gently pushing in, no text, no logos, no watermark, no promotional marks",
"duration": 5,
"resolution": "1080p",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/alibaba/happyhorse-1.0/image-to-video/v1/01/input-01.png"
]
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"等待结果
用 task_id 查询,not_started/running 时继续,finished/failed 时停止。成功后读取 data.files[].file_url。
跟踪状态
GET https://api.vidgo.ai/api/generate/status/{task_id}以 2 秒为基准轮询状态,任务较长时加大间隔。仅在 not_started 或 running 时继续,finished 或 failed 时停止。也可以在请求中指定 callback_url 接收 webhook。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "running",
"created_time": "2026-09-17T10:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}完整可运行示例
展开查看包含 HTTP 与业务码检查、task_id 校验、轮询、终态处理和超时边界的完整代码。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/happyhorse-1.0/image-to-video",
"input": {
"prompt": "The observatory dome slowly rotates open as the first sunlight sweeps across the plateau, haze drifting through the valley, camera gently pushing in, no text, no logos, no watermark, no promotional marks",
"duration": 5,
"resolution": "1080p",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/alibaba/happyhorse-1.0/image-to-video/v1/01/input-01.png"
]
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done输入参数
下表列出可用输入参数、类型和默认值。请求示例还包含顶层 model 字段。
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
| image_urls | array | Yes | — | 字符串数组。包含恰好 1 个图片 URL 作为视频开场的首帧画面。 |
| prompt | string | No | — | 字符串。最多 2,500 个字符。可选提供以补充指导动作走向、镜头运动与氛围。 |
| resolution | string | No | 1080p | 字符串。输出分辨率。支持 720p 与 1080p。 |
| duration | integer | No | 5 | 整数。输出时长 3–15 秒。 |
| seed | integer | No | — | 整数。0 到 2147483647,用于稳定生成基底并复现镜头。 |
| enable_safety_checker | boolean | No | — | 布尔值。启用输入和输出的内容安全审核。 |
响应字段
任务提交返回 task_id;查询状态返回当前处理进度与成片文件列表。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务状态码,200 表示成功。 |
| data.task_id | string | 唯一任务标识,用于跟踪和轮询进度。 |
| data.status | string | 任务生命周期状态:not_started、running、finished 或 failed。 |
| data.progress | integer | 生成进度百分比 (0–100)。 |
| data.files[].file_url | string | 生成视频的公开 URL。 |
| data.files[].file_type | string | 文件类型,例如 video。 |
| data.error_message | string | null | status 为 failed 时的失败详情。 |
任务生命周期
在 not_started 或 running 时继续查询。在 finished 或 failed 时结束轮询。
not_started任务已接受,等待开始。
running生成进行中。继续轮询同一 task_id。
finished生成成功。从 data.files[].file_url 读取视频。
failed生成失败。读取 data.error_message 并停止轮询。
轮询与错误处理
- 认证遇到 401 时,检查 Authorization 中的 Bearer API key,更新凭证后重试。
- 校验遇到 400 时,根据响应检查必填输入、参数值和可用积分,再重新提交。
- 网络和超时状态查询遇到网络错误或超时,保留原 task_id 并重试查询。
- 轮询间隔以 2 秒为基准轮询状态,任务较长时逐步加大间隔。
- 终态仅在 not_started 或 running 时继续。finished 或 failed 立即停止。
- 回调选项可在请求顶层提供 callback_url 接收最终任务对象;投递失败时仍可轮询。
端点限制
| 规格 | 值 | 详情 |
|---|---|---|
| 输入模式 | 单张首帧图像 + 可选提示词 | 以 1 张图像作为开场帧,可选文字指引运动。 |
| 首帧要求 | 恰好 1 张图片 URL | 填入 image_urls 数组,格式为标准图片链接。 |
| 输出规格 | MP4 视频文件 | 异步生成返回 task_id;完成后提供视频下载地址。 |
| 分辨率 | 720p / 1080p | 默认预选 1080p。 |
| 时长 | 3–15 秒 | 默认预选 5 秒。 |
| 画面比例 | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 | 默认预选 16:9。 |
| 计费方式 | 按秒计费 | 720p 16 credits/s,1080p 32 credits/s。 |
相关模型
Happy Horse 1.0 Image to Video API 常见问题
Happy Horse 1.0 Image to Video API 是什么?
Happy Horse 1.0 Image to Video 是阿里巴巴研发的静态图像生成视频模型。它接收 1 张静态首帧图像与可选文本提示词,生成 3–15 秒、可选 720p 或 1080p 的电影感短视频,具备优秀的首帧一致性与自然运动推演能力。基于先进的时空扩散机制,它在紧密锚定开场主体容貌、服饰纹理与构图透视的同时,赋予画面符合物理规律的连续动态与运镜流动。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
Happy Horse 1.0 Image to Video 必须上传首帧图像吗?
必须。该端点要求在 image_urls 数组中传入恰好 1 张可公开访问的图片 URL 作为视频开场的首帧画面,以锚定视频的起始主体与空间构图。
Happy Horse 1.0 Image to Video 支持无提示词生成吗?
支持。prompt 为可选参数。当保持提示词为空时,模型将基于首帧画面的语义内容自主推演自然的物理动态;传入提示词时则可定向引导运镜与动作变化。
Happy Horse 1.0 Image to Video 如何保持主体与构图一致?
模型以输入的首帧图像为基准进行连续时空潜变量扩散,确保开场主体轮廓、面部特征与构图透视高度锁定,并平滑过渡到后续运动帧中。
Happy Horse 1.0 Image to Video 单次可以生成 15 秒吗?
可以。duration 参数支持在 3 至 15 秒的整秒区间内自由指定,体验区默认预选 5 秒。更长时长依然能平稳维持人物形态与环境连贯性。
Happy Horse 1.0 Image to Video 支持 1080p 输出吗?
支持。支持 720p 与 1080p 两种清晰度档位。1080p 输出能够清晰还原原图的微小材质细节、发丝与环境光感。
什么时候该选用 Happy Horse 1.0 Image to Video 而不是 Reference to Video?
当已有确定的起始静态画面并希望从该定格帧直接起动运镜时,应选择 Image to Video;若需要传入 1–9 张多角度或多角色参考图来构建全新机位与画面的,则应选用 Reference to Video。















