Seedance 2.0 视频生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/vol/seedance-2.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference_images": [
"<string>"
],
"duration": 5,
"first_frame": "https://example.com/first_frame.jpg",
"generate_audio": true,
"last_frame": "https://example.com/last_frame.jpg",
"model": "fast",
"prompt": "女孩抱着狐狸,女孩睁开眼,温柔地看向镜头",
"ratio": "adaptive",
"resolution": "720p",
"watermark": false
}
'import requests
url = "https://api.sinancode.com/v1/generate/vol/seedance-2.0"
payload = {
"reference_images": ["<string>"],
"duration": 5,
"first_frame": "https://example.com/first_frame.jpg",
"generate_audio": True,
"last_frame": "https://example.com/last_frame.jpg",
"model": "fast",
"prompt": "女孩抱着狐狸,女孩睁开眼,温柔地看向镜头",
"ratio": "adaptive",
"resolution": "720p",
"watermark": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_images: ['<string>'],
duration: 5,
first_frame: 'https://example.com/first_frame.jpg',
generate_audio: true,
last_frame: 'https://example.com/last_frame.jpg',
model: 'fast',
prompt: '女孩抱着狐狸,女孩睁开眼,温柔地看向镜头',
ratio: 'adaptive',
resolution: '720p',
watermark: false
})
};
fetch('https://api.sinancode.com/v1/generate/vol/seedance-2.0', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sinancode.com/v1/generate/vol/seedance-2.0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reference_images' => [
'<string>'
],
'duration' => 5,
'first_frame' => 'https://example.com/first_frame.jpg',
'generate_audio' => true,
'last_frame' => 'https://example.com/last_frame.jpg',
'model' => 'fast',
'prompt' => '女孩抱着狐狸,女孩睁开眼,温柔地看向镜头',
'ratio' => 'adaptive',
'resolution' => '720p',
'watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sinancode.com/v1/generate/vol/seedance-2.0"
payload := strings.NewReader("{\n \"reference_images\": [\n \"<string>\"\n ],\n \"duration\": 5,\n \"first_frame\": \"https://example.com/first_frame.jpg\",\n \"generate_audio\": true,\n \"last_frame\": \"https://example.com/last_frame.jpg\",\n \"model\": \"fast\",\n \"prompt\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头\",\n \"ratio\": \"adaptive\",\n \"resolution\": \"720p\",\n \"watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sinancode.com/v1/generate/vol/seedance-2.0")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference_images\": [\n \"<string>\"\n ],\n \"duration\": 5,\n \"first_frame\": \"https://example.com/first_frame.jpg\",\n \"generate_audio\": true,\n \"last_frame\": \"https://example.com/last_frame.jpg\",\n \"model\": \"fast\",\n \"prompt\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头\",\n \"ratio\": \"adaptive\",\n \"resolution\": \"720p\",\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/vol/seedance-2.0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_images\": [\n \"<string>\"\n ],\n \"duration\": 5,\n \"first_frame\": \"https://example.com/first_frame.jpg\",\n \"generate_audio\": true,\n \"last_frame\": \"https://example.com/last_frame.jpg\",\n \"model\": \"fast\",\n \"prompt\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头\",\n \"ratio\": \"adaptive\",\n \"resolution\": \"720p\",\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}视频生成 - Seedance
Seedance 2.0 视频生成
字节跳动 Seedance 2.0 视频生成模型,支持文生视频、图生视频(首帧/首尾帧)、多模态参考生视频,支持有声视频(异步)
POST
/
generate
/
vol
/
seedance-2.0
Seedance 2.0 视频生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/vol/seedance-2.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference_images": [
"<string>"
],
"duration": 5,
"first_frame": "https://example.com/first_frame.jpg",
"generate_audio": true,
"last_frame": "https://example.com/last_frame.jpg",
"model": "fast",
"prompt": "女孩抱着狐狸,女孩睁开眼,温柔地看向镜头",
"ratio": "adaptive",
"resolution": "720p",
"watermark": false
}
'import requests
url = "https://api.sinancode.com/v1/generate/vol/seedance-2.0"
payload = {
"reference_images": ["<string>"],
"duration": 5,
"first_frame": "https://example.com/first_frame.jpg",
"generate_audio": True,
"last_frame": "https://example.com/last_frame.jpg",
"model": "fast",
"prompt": "女孩抱着狐狸,女孩睁开眼,温柔地看向镜头",
"ratio": "adaptive",
"resolution": "720p",
"watermark": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_images: ['<string>'],
duration: 5,
first_frame: 'https://example.com/first_frame.jpg',
generate_audio: true,
last_frame: 'https://example.com/last_frame.jpg',
model: 'fast',
prompt: '女孩抱着狐狸,女孩睁开眼,温柔地看向镜头',
ratio: 'adaptive',
resolution: '720p',
watermark: false
})
};
fetch('https://api.sinancode.com/v1/generate/vol/seedance-2.0', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sinancode.com/v1/generate/vol/seedance-2.0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reference_images' => [
'<string>'
],
'duration' => 5,
'first_frame' => 'https://example.com/first_frame.jpg',
'generate_audio' => true,
'last_frame' => 'https://example.com/last_frame.jpg',
'model' => 'fast',
'prompt' => '女孩抱着狐狸,女孩睁开眼,温柔地看向镜头',
'ratio' => 'adaptive',
'resolution' => '720p',
'watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sinancode.com/v1/generate/vol/seedance-2.0"
payload := strings.NewReader("{\n \"reference_images\": [\n \"<string>\"\n ],\n \"duration\": 5,\n \"first_frame\": \"https://example.com/first_frame.jpg\",\n \"generate_audio\": true,\n \"last_frame\": \"https://example.com/last_frame.jpg\",\n \"model\": \"fast\",\n \"prompt\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头\",\n \"ratio\": \"adaptive\",\n \"resolution\": \"720p\",\n \"watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sinancode.com/v1/generate/vol/seedance-2.0")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference_images\": [\n \"<string>\"\n ],\n \"duration\": 5,\n \"first_frame\": \"https://example.com/first_frame.jpg\",\n \"generate_audio\": true,\n \"last_frame\": \"https://example.com/last_frame.jpg\",\n \"model\": \"fast\",\n \"prompt\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头\",\n \"ratio\": \"adaptive\",\n \"resolution\": \"720p\",\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/vol/seedance-2.0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_images\": [\n \"<string>\"\n ],\n \"duration\": 5,\n \"first_frame\": \"https://example.com/first_frame.jpg\",\n \"generate_audio\": true,\n \"last_frame\": \"https://example.com/last_frame.jpg\",\n \"model\": \"fast\",\n \"prompt\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头\",\n \"ratio\": \"adaptive\",\n \"resolution\": \"720p\",\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}使用火山引擎 Seedance 2.0 模型生成视频。
模型特点:
- 多种生成模式 - 支持文生视频、图生视频(首帧/首尾帧)、多模态参考生视频
- 有声视频 - 内置音频生成支持
- Fast 与 Standard 模式 - 可选 2.0 Fast(更快更便宜)和 2.0 标准版
- 灵活时长 - 4-15 秒,或设置为 -1 让模型自动选择
授权
请使用您的 API Token 进行认证
请求体
application/json
任务参数
参考图片 URL 列表(可选,1-9 张,用于多模态参考生视频) 注意:参考图与首帧/首尾帧为互斥模式,不可混用
Maximum array length:
9视频时长(可选,默认 5 秒) 范围: 4-15 秒,或设置为 -1 让模型自动选择
必填范围:
-1 <= x <= 15示例:
5
首帧图片 URL(可选,用于图生视频-首帧模式)
示例:
"https://example.com/first_frame.jpg"
是否生成音频(可选,默认 true)
示例:
true
尾帧图片 URL(可选,需配合 first_frame 使用)
示例:
"https://example.com/last_frame.jpg"
模型版本(可选,默认 fast) 可选值: fast(2.0 Fast,更快更便宜), standard(2.0 标准版)
可用选项:
fast, standard 示例:
"fast"
提示词(可选,多模态参考时可不传)
Maximum string length:
2000示例:
"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头"
宽高比(可选,默认 adaptive)
可用选项:
16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive 示例:
"adaptive"
分辨率(可选,默认 720p) Seedance 2.0 不支持 1080p
可用选项:
480p, 720p 示例:
"720p"
是否添加水印(可选,默认 false)
示例:
false
响应
OK
Task ID
示例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I