跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com
Alibaba logo

HappyHorse 1.0 T2V

Text-to-Video • Alibaba

查看 MarkdownAgent 设置
  • Third-party
  • Zero data retention

阿里巴巴 HappyHorse 1.0 文生视频模型。根据文本提示词生成视频,可配置分辨率、宽高比和时长(3-15 秒)。

模型信息
条款和许可证链接 ↗
更多信息链接 ↗
零数据保留是
定价在 Cloudflare 仪表板中查看定价 ↗

用法

const response = await env.AI.run(
  'alibaba/hh1-t2v',
  { prompt: 'A little girl walking on the road' },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "alibaba/hh1-t2v",
  "input": {
    "prompt": "A little girl walking on the road"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/alibaba__hh1-t2v/simple-text-to-video.mp4"
  },
  "state": "Completed"
}

示例

竖屏 1080P — 适用于社交媒体的 9:16 竖屏 1080P 输出
const response = await env.AI.run(
  'alibaba/hh1-t2v',
  {
    prompt: 'A dog running through a field of tall grass, slow motion, golden hour',
    duration: 6,
    ratio: '9:16',
    resolution: '1080P',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "alibaba/hh1-t2v",
  "input": {
    "prompt": "A dog running through a field of tall grass, slow motion, golden hour",
    "duration": 6,
    "ratio": "9:16",
    "resolution": "1080P"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/alibaba__hh1-t2v/vertical-1080p.mp4"
  },
  "state": "Completed"
}
可复现输出 — 使用固定种子以确保结果可复现
const response = await env.AI.run(
  'alibaba/hh1-t2v',
  {
    prompt: 'Clouds drifting across a mountain range, time-lapse style',
    duration: 5,
    ratio: '16:9',
    resolution: '720P',
    seed: 42,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "alibaba/hh1-t2v",
  "input": {
    "prompt": "Clouds drifting across a mountain range, time-lapse style",
    "duration": 5,
    "ratio": "16:9",
    "resolution": "720P",
    "seed": 42
  }
}'
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/alibaba__hh1-t2v/reproducible-output.mp4"
  },
  "state": "Completed"
}

参数

prompt
stringrequiredminLength: 1maxLength: 2500
resolution
stringenum: 720P, 1080P
ratio
stringenum: 16:9, 9:16, 1:1, 4:3, 3:4
duration
integerminimum: 3maximum: 15
seed
integerminimum: 0maximum: 2147483647
watermark
boolean
video
stringformat: uri

API schema(原始)

输入
输出

这篇文档对您有帮助吗?