VideosSeedance 2.0
Python Polling and Download
Create a Seedance 2.0 task, poll for completion, and download the result video with Python.
Seedance 2.0 is asynchronous. Poll the task endpoint until status becomes succeeded, then download content.video_url.
import os
import time
import requests
BASE_URL = "https://api.modelsell.com"
API_KEY = os.environ["MODELSELL_API_KEY"]
response = requests.post(
f"{BASE_URL}/api/v3/contents/generations/tasks",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "doubao-seedance-2-0-260128",
"content": [{"type": "text", "text": "A cinematic city sunrise"}],
"resolution": "480p",
"ratio": "16:9",
"duration": 5,
},
)
response.raise_for_status()
task_id = response.json()["id"]
while True:
time.sleep(10)
result = requests.get(
f"{BASE_URL}/api/v3/contents/generations/tasks/{task_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
result.raise_for_status()
data = result.json()
if data["status"] == "succeeded":
print(data["content"]["video_url"])
break
if data["status"] == "failed":
raise RuntimeError(data.get("error", {}).get("message", "task failed"))Generation Mode Examples
Previous Page
Video Generation
使用 Seedance 2.0 官方 `content[]` 格式创建异步视频生成任务。支持文生视频、图生视频、视频生视频、图像与音频组合、视频与音频组合,以及图像、视频、音频全模态引用。 若希望使用 ModelSell 的通用视频格式,也可以调用 `/v1/video/generations` 或 `/v1/videos`,通过 `prompt`、`image`、`images`、`metadata.video_url`、`metadata.audio_url` 等字段提交。 需要复用图片、视频或音频素材时,先调用 `/api/assets/upload` 上传素材,素材状态为 `Active` 后可在 `content[].*_url.url` 中传入 `asset://<asset_id>`。