进阶 docs.leonardo.ai 2026-11-22 15:11:20 · 0 阅读
第49章 Seedance 1.0 Pro 视频生成 API 使用指南
Seedance 1.0 Pro
本指南介绍如何通过 Leonardo.AI REST API 使用 Seedance 1.0 Pro 和 Seedance 1.0 Pro Fast 模型生成视频。
Sample Request
curl --request POST \
--url https://cloud.leonardo.ai/api/rest/v2/generations \
--header 'accept: application/json' \
--header 'authorization: Bearer ' \
--header 'content-type: application/json' \
--data '
{
"model": "seedance-1.0-pro",
"public": false,
"parameters": {
"prompt": "The koala plays with the cat",
"guidances": {
"start_frame": [
{
"image": {
"id": "",
"type": "UPLOADED"
}
}
],
"end_frame": [
{
"image": {
"id": "",
"type": "UPLOADED"
}
}
]
},
"duration": 4,
"mode": "RESOLUTION_1080",
"prompt_enhance": "OFF",
"width": 1920,
"height": 1088
}
}
'
Recipe
API 请求端点、Headers 与参数
Endpoint
https://cloud.leonardo.ai/api/rest/v2/generations
Headers
--header "accept: application/json" \
--header "authorization: Bearer " \
--header "content-type: application/json"
Body 参数
| 参数 | 类型 | 说明 |
| duration | number | 生成视频的时长,可选 4、6、8、10。 |
| guidances.end_frame | array | 最多 1 项。每项包含 image.id 和 image.type(GENERATED 或 UPLOADED)。仅在提供 start_frame 时可用。 |
| guidances.start_frame | array | 最多 1 项。每项包含 image.id 和 image.type(GENERATED 或 UPLOADED)。 |
| height | number | 设置输出视频的高度(像素)。 |
| model | string | 指定生成所用的模型,可选 seedance-1.0-pro 或 seedance-1.0-pro-fast。 |
| prompt | string | 视频内容的文字描述,最多 5000 个字符。 |
| prompt_enhance | string | 开启或关闭提示词增强,有效值为 ON 和 OFF。 |
| public | boolean | 控制生成的视频是公开(true)还是私有(false)。 |
| width | number | 设置输出视频的宽度(像素)。 |
尺寸
API 支持以下宽高比组合的 width 和 height 参数:
| 分辨率 | 宽高比 | 像素值(宽 x 高) |
| 480p | 16:9(横屏) | 864x480 |
| 480p | 4:3 | 736x544 |
| 480p | 1:1(正方形) | 640x640 |
| 480p | 3:4 | 544x736 |
| 480p | 9:16(竖屏) | 480x864 |
| 480p | 21:9 | 960x416 |
| 720p | 16:9(横屏) | 1248x704 |
| 720p | 4:3 | 1120x832 |
| 720p | 1:1(正方形) | 960x960 |
| 720p | 3:4 | 832x1120 |
| 720p | 9:16(竖屏) | 704x1248 |
| 720p | 21:9 | 1504x640 |
| 1080p | | |
(参考图像功能不支持)16:9(横向)1920x1088;4:3;1664x1248;1:1(方形)1440x1440;3:4;1248x1664;9:16(纵向)1088x1920;21:9;2176x928。更新于19天前。此页面是否对你有帮助?
(参考图像功能不支持)16:9(横向)1920x1088;4:3;1664x1248;1:1(方形)1440x1440;3:4;1248x1664;9:16(纵向)1088x1920;21:9;2176x928。更新于19天前。此页面是否对你有帮助?