需先到 Apiframe 申请 API Key,仓库不含模型权重;JavaScript 示例依赖 @apiframe-ai/sdk@next 预发布版本;Seedance 2.5 上首尾帧与参考媒体互斥,2.0 才可组合
seedance-2.0-api
apiframe-ai活跃维护字节 Seedance 2.0 视频生成 API 的调用示例,覆盖文生视频和图生视频两种模式,方便开发者快速接入。
Seedance 2.0 API — text-to-video and image-to-video examples
export APIFRAME_API_KEY=afk_your_api_key_here
pip install requestsREADME 未说明;模型为闭源,推理在 Apiframe 云端完成,本地只需能发 HTTP 请求的环境
通过 Apiframe 调用字节 Seedance 2.0 的文生视频与图生视频示例仓库
字节 Seedance 2.0 视频生成 API 的调用示例,覆盖文生视频和图生视频两种模式,方便开发者快速接入。
核心能力
- 用 POST /v2/videos/generate 提交生成任务
- 轮询 /jobs/{jobId} 或传 webhookUrl 获取结果
- 支持首尾帧图片、参考图/视频/音频多模态输入
- 可调时长 4–15 秒、480p 至 4K 分辨率与画幅
- 原生同步音频生成,支持固定镜头与种子复现
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Seedance 2.0 API
Examples for calling the Seedance 2.0 API (ByteDance text-to-video and image-to-video) through Apiframe.
Model page: Seedance 2.0 API
This repo does not host model weights. Seedance is a closed model. Inference runs on POST /v2/videos/generate with model: "seedance-2".
Related model ids on the same endpoint: seedance-2.5, seedance-2-fast, seedance-2-mini.
What is Seedance 2.0?
Seedance 2.0 is ByteDance's video generation model. It supports text-to-video, image-to-video, and multimodal reference-to-video (images, video, audio), with native synchronized audio. Clips are 4–15 seconds at 480p, 720p, 1080p, or 4K.
Quick start
export APIFRAME_API_KEY=afk_your_api_key_here
Python
pip install requests
import os
import time
import requests
API = "https://api.apiframe.ai/v2"
headers = {
"X-API-Key": os.environ["APIFRAME_API_KEY"],
"Content-Type": "application/json",
}
job = requests.post(
f"{API}/videos/generate",
headers=headers,
json={
"model": "seedance-2",
"prompt": "A cinematic slow-motion shot of a golden eagle soaring through a mountain valley at sunrise.",
"seedanceParams": {
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9",
"generate_audio": True,
},
},
).json()
while True:
result = requests.get(f"{API}/jobs/{job['jobId']}", headers=headers).json()
if result["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(result.get("result"))
JavaScript
npm i @apiframe-ai/sdk@next
import { Apiframe } from "@apiframe-ai/sdk";
const client = new Apiframe({ apiKey: process.env.APIFRAME_API_KEY });
const { jobId } = await client.videos.generate({
model: "seedance-2",
prompt:
"A cinematic slow-motion shot of a golden eagle soaring through a mountain valley at sunrise.",
seedanceParams: {
duration: 8,
resolution: "720p",
aspect_ratio: "16:9",
generate_audio: true,
},
});
const job = await client.jobs.waitFor(jobId);
console.log(job.result);
Pass webhookUrl on the generate call if you do not want to poll.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | required | Text description of the video |
seedanceParams.duration | integer | 8 | Seconds, 4–15 |
seedanceParams.resolution | string | "720p" | 480p, 720p, 1080p, 4k |
seedanceParams.aspect_ratio | string | "16:9" | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16, adaptive |
seedanceParams.start_image | string | — | First-frame URL (image-to-video) |
seedanceParams.end_image | string | — | Last-frame URL |
seedanceParams.reference_image_urls | string[] | — | Up to 9 reference images |
seedanceParams.reference_video_urls | string[] | — | Up to 3 reference videos |
seedanceParams.reference_audio_urls | string[] | — | Up to 3 reference audio files |
seedanceParams.generate_audio | boolean | true | Native synchronized audio |
seedanceParams.seed | integer | — | Reproducible generations |
seedanceParams.camera_fixed | boolean | false | Lock the camera |
seedanceParams.web_search | boolean | false | Ground the prompt with web search |
Image to video
requests.post(
"https://api.apiframe.ai/v2/videos/generate",
headers=headers,
json={
"model": "seedance-2",
"prompt": "She slowly turns to face the camera, wind catching her hair.",
"seedanceParams": {
"start_image": "https://example.com/portrait.jpg",
"duration": 8,
"resolution": "720p",
},
},
)
Reference to video
requests.post(
"https://api.apiframe.ai/v2/videos/generate",
headers=headers,
json={
"model": "seedance-2",
"prompt": "The person from the reference image walks down a neon-lit street at night.",
"seedanceParams": {
"reference_image_urls": ["https://example.com/character.jpg"],
"duration": 10,
"resolution": "720p",
},
},
)
Start/end frames and reference media are mutually exclusive on Seedance 2.5. On Seedance 2.0 they can be combined; keep inputs consistent.
Output
{
"videoUrl": "https://cdn2.apiframe.ai/videos/….mp4"
}
Examples
| Example | Python | JavaScript |
|---|---|---|
| Text to video | text_to_video.py | text_to_video.js |
| Image to video | image_to_video.py | image_to_video.js |
| Reference to video | reference_to_video.py | reference_to_video.js |
cp .env.example .env
# set APIFRAME_API_KEY
python examples/text_to_video.py
License
Example code in this repository is provided as-is. Seedance outputs are subject to ByteDance's terms. Seedance is a trademark of ByteDance Ltd.