外观
Seedance
Seedance 2 支持同步音频、首尾帧控制与多模态参考。
API 接口
| 操作 | 端点 | 模式 |
|---|---|---|
| 视频生成任务 | POST /v1/async/videos/generations | 仅异步 |
模型
| 模型 id | 说明 |
|---|---|
seedance-2 | 完整画质,最高 4k。seconds 为 4–15。 |
seedance-2-fast | 更快,最高 720p。seconds 为 4–15。 |
seedance-2-mini | 最低成本,最高 720p。seconds 仅 4 / 8 / 10 / 12 / 15。仅允许 n=1。 |
价格
按 n × seconds × 单价(resolution) 计费。默认 720p。
| 模型 | 480p | 720p | 1080p | 4K |
|---|---|---|---|---|
seedance-2-mini | 4/秒 | 8/秒 | — | — |
seedance-2-fast | 6/秒 | 13/秒 | — | — |
seedance-2 | 8/秒 | 16/秒 | 38/秒 | 78/秒 |
示例:seedance-2 + 720p + seconds=5 + n=1 → 16 × 5 = 80 积分。
请求字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | seedance-2 / seedance-2-fast / seedance-2-mini |
prompt | string | 是 | 1–2000 字符 |
seconds | integer | 是 | 时长(秒),范围因模型而异 |
resolution | string | 否 | 480p / 720p(默认)/ 1080p / 4k(视模型支持) |
n | integer | 否 | 默认 1,范围 1–9(mini 仅允许 1) |
image | string | string[] | 否 | 图生视频公网 http(s) URL |
providerOptions | object | 否 | 可选模型扩展参数。详见下方 providerOptions。 |
providerOptions
seedance-2 / seedance-2-fast / seedance-2-mini 共用下列字段。
| 字段 | 类型 | 说明 |
|---|---|---|
aspect_ratio | string | 画幅:21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / adaptive |
generate_audio | boolean | true 生成同步音频;false 输出无声视频 |
seed | integer | 随机种子,用于尽量复现结果 |
image_with_roles | object[] | 带角色的参考图(见下方);与顶层 image 二选一,同时传时优先本字段 |
video_with_roles | object[] | 带角色的参考视频;元素形如 { "url", "role": "reference_video" } |
audio_with_roles | object[] | 带角色的参考音频;元素形如 { "url", "role": "reference_audio" };不能单独使用,需配合图片或视频参考 |
metadata | object | 透传扩展字段(网关不解释) |
image_with_roles
每项:{ "url": "<http(s) URL>", "role": "<角色>" }。
role | 说明 | 数量 |
|---|---|---|
first_frame | 首帧 | 最多 1 |
last_frame | 尾帧 | 最多 1 |
reference_image | 参考图(风格 / 人物等) | 最多 9 |
模式互斥:首帧 / 首尾帧 与 参考图模式不要混用。简单图生可用顶层 image;需要首尾帧或显式角色时用 image_with_roles。
示例
bash
curl https://api.pixapi.ai/v1/async/videos/generations \
-H "Authorization: Bearer $PIXAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2",
"prompt": "一只柴犬穿过霓虹雨夜街道",
"n": 1,
"seconds": 5,
"resolution": "720p",
"providerOptions": {
"generate_audio": true,
"aspect_ratio": "16:9"
}
}'py
import os
import requests
response = requests.post(
"https://api.pixapi.ai/v1/async/videos/generations",
headers={
"Authorization": f"Bearer {os.environ['PIXAPI_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "seedance-2",
"prompt": "一只柴犬穿过霓虹雨夜街道",
"n": 1,
"seconds": 5,
"resolution": "720p",
"providerOptions": {
"generate_audio": True,
"aspect_ratio": "16:9"
}
},
)
response.raise_for_status()
task = response.json()
print(task["id"])js
const response = await fetch('https://api.pixapi.ai/v1/async/videos/generations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PIXAPI_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "seedance-2",
"prompt": "一只柴犬穿过霓虹雨夜街道",
"n": 1,
"seconds": 5,
"resolution": "720p",
"providerOptions": {
"generate_audio": true,
"aspect_ratio": "16:9"
}
}),
});
if (!response.ok) {
throw new Error(await response.text());
}
const task = await response.json();
console.log(task.id);go
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"model": "seedance-2",
"prompt": "一只柴犬穿过霓虹雨夜街道",
"n": 1,
"seconds": 5,
"resolution": "720p",
"providerOptions": {
"generate_audio": true,
"aspect_ratio": "16:9"
}
}`)
req, err := http.NewRequest(
"POST",
"https://api.pixapi.ai/v1/async/videos/generations",
bytes.NewBuffer(body),
)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("PIXAPI_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
result, _ := io.ReadAll(resp.Body)
fmt.Println(string(result))
}响应
返回已提交任务。轮询 GET /v1/tasks/{id} 获取结果。
