核心能力
| 功能 | 说明 |
|---|---|
| 文生视频 | 根据文本描述生成视频 |
| 图生视频(首帧) | 使用一张图片作为首帧 |
| 图生视频(首尾帧) | 使用两张图片分别作为首帧和尾帧 |
| 多模态参考 | 组合图片、视频、音频作为参考(1–9 张图片,最多 3 个视频,最多 3 段音频) |
| 编辑视频 | 使用参考图片修改现有视频中的元素 |
| 延长视频 | 延长和拼接参考视频 |
| 生成有声视频 | 自动生成同步的人声、音效和背景音乐 |
| 联网搜索增强 | 结合实时互联网内容增强生成效果(仅文生视频) |
| 返回视频尾帧 | 获取生成视频的最后一帧 |
输出规格
| 属性 | 值 |
|---|---|
| 分辨率 | 480p、720p、1080p |
| 宽高比 | 16:9、4:3、1:1、3:4、9:16、21:9、adaptive |
| 时长 | 4–15 秒 |
| 格式 | mp4 |
工作流
1. POST /v1/video/generations → task_id
2. 轮询 GET /v1/video/generations/{task_id} → status
3. status = "succeeded" 后 → 下载视频 URL(有效期 24 小时)
示例
文生视频
curl https://api.upmore.net/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0",
"content": [
{
"type": "text",
"text": "一只猫在阳光明媚的房间里弹钢琴,电影级光影"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 8
}'
import requests
import time
headers = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
# 步骤 1:创建任务
resp = requests.post(
"https://api.upmore.net/v1/video/generations",
headers=headers,
json={
"model": "doubao-seedance-2-0",
"content": [
{"type": "text", "text": "一只猫在阳光明媚的房间里弹钢琴,电影级光影"}
],
"generate_audio": True,
"ratio": "16:9",
"duration": 8
}
)
task_id = resp.json()["task_id"]
# 步骤 2:轮询结果
while True:
result = requests.get(
f"https://api.upmore.net/v1/video/generations/{task_id}",
headers=headers
).json()
status = result["data"]["status"]
if status == "SUCCESS":
print("视频 URL:", result["data"]["data"]["content"]["video_url"])
break
elif status == "FAILED":
print("失败:", result["data"].get("fail_reason"))
break
time.sleep(5)
多模态参考(图片 + 视频 + 音频)
cURL
curl https://api.upmore.net/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0",
"content": [
{
"type": "text",
"text": "延长视频,一镜到底运镜,全程无剪辑断点,新年喜庆氛围感拉满"
},
{
"type": "image_url",
"image_url": {"url": "https://example.com/character.jpg"},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {"url": "https://example.com/clip.mp4"},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {"url": "https://example.com/bgm.mp3"},
"role": "reference_audio"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 11
}'
编辑视频
cURL
curl https://api.upmore.net/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0",
"content": [
{
"type": "text",
"text": "将视频中的水替换成图片中的香水,运镜不变"
},
{
"type": "image_url",
"image_url": {"url": "https://example.com/perfume.jpg"},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {"url": "https://example.com/original.mp4"},
"role": "reference_video"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 5
}'
联网搜索增强(仅文生视频)
cURL
curl https://api.upmore.net/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0",
"content": [
{
"type": "text",
"text": "微距镜头对准树上鲜艳的花瓣,逐渐放大"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 11,
"tools": [{"type": "web_search"}]
}'
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | doubao-seedance-2-0 |
content | array | 是 | 输入内容数组(text、image_url、video_url、audio_url) |
content[].type | string | 是 | text、image_url、video_url 或 audio_url |
content[].text | string | text 类型 | 文本提示词(建议中文 ≤500 字,英文 ≤1000 词) |
content[].image_url.url | string | image 类型 | 图片 URL、Base64 或 asset://<ID> |
content[].video_url.url | string | video 类型 | 视频 URL 或 asset://<ID>(mp4/mov,≤50 MB,2–15 秒) |
content[].audio_url.url | string | audio 类型 | 音频 URL、Base64 或 asset://<ID>(wav/mp3,≤15 MB) |
content[].role | string | 条件必填 | first_frame、last_frame、reference_image、reference_video、reference_audio |
generate_audio | boolean | 否 | 生成同步音频,默认 true |
resolution | string | 否 | 480p、720p 或 1080p,默认 720p |
ratio | string | 否 | 16:9、4:3、1:1、3:4、9:16、21:9、adaptive,默认 adaptive |
duration | integer | 否 | 4–15 秒,默认 5 |
tools | array | 否 | [{"type": "web_search"}] 启用联网搜索(仅文生视频) |
watermark | boolean | 否 | 是否添加水印,默认 false |
输入模式
| 模式 | 内容项 | role 取值 |
|---|---|---|
| 文生视频 | 1× text | — |
| 图生视频(首帧) | text(可选)+ 1× image_url | first_frame 或不填 |
| 图生视频(首尾帧) | text(可选)+ 2× image_url | first_frame + last_frame |
| 多模态参考 | text(可选)+ 图片/视频/音频 | reference_image、reference_video、reference_audio |
| 编辑视频 | text + image_url + video_url | reference_image + reference_video |
| 延长视频 | text + video_url(s) | reference_video |
注意: 首帧、首尾帧、多模态参考为三种互斥场景,不可混用。
不同宽高比对应的宽高像素值
| 分辨率 | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9 |
|---|---|---|---|---|---|---|
| 480p | 864x496 | 752x560 | 640x640 | 560x752 | 496x864 | 992x432 |
| 720p | 1280x720 | 1112x834 | 960x960 | 834x1112 | 720x1280 | 1470x630 |
| 1080p | 1920x1080 | 1664x1248 | 1440x1440 | 1248x1664 | 1080x1920 | 2208x944 |
API 参考
查看可交互的 API Playground。