指南 · 图生视频

Seedance 2.5 图生视频:API 指南

Seedance 2.5 能把一张静态图片变成 4 到 30 秒、带声音的视频。给它首帧,视频就从这张图片开始;给它首帧和尾帧,它就从一张过渡到另一张。下面是每种方式的请求,附可运行的代码。

从图片开始的两种方式

Seedance 2.5 图生视频模式
模式字段你将获得
首帧image_url视频从你的图片开始,并按提示词继续往下动。
首尾帧image_url + end_image_url视频从一张图片开始,落在另一张图片上。同一张图片用两次就是循环。
参考图image_urls (最多 30 张)图片引导画面的样子(一张脸、一个产品、一个地点),但不固定首帧。见参考生视频。

让一张图片动起来(首帧)

把 aspect_ratio 设为 adaptive,视频就会保持你图片的形状,9:16 的照片得到 9:16 的视频。描述什么在动,而不是图片里已有的东西:模型看得到图片。

cURL
# One Idempotency-Key per job, made once: resend with the same $KEY after a timeout, a 429 or a 5xx
KEY=$(uuidgen)
curl https://api.revana.si/v1/generations \
  -H "Authorization: Bearer $REVANA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $KEY" \
  -d '{
  "model": "seedance-2.5",
  "input": {
    "prompt": "The model turns her head toward the camera and smiles as the wind lifts her hair, slow push-in, city traffic in the background",
    "image_url": "https://example.com/portrait.jpg",
    "duration": 6,
    "resolution": "720p",
    "aspect_ratio": "adaptive",
    "audio": true
  },
  "max_cost_usd": 3
}'

从一张图片到另一张(首尾帧)

加上 end_image_url。适合做变化效果(前后对比、白天到夜晚、空房间到装修好的房间)和无缝循环。

cURL
# One Idempotency-Key per job, made once: resend with the same $KEY after a timeout, a 429 or a 5xx
KEY=$(uuidgen)
curl https://api.revana.si/v1/generations \
  -H "Authorization: Bearer $REVANA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $KEY" \
  -d '{
  "model": "seedance-2.5",
  "input": {
    "prompt": "Time-lapse: the empty plot becomes a finished house, workers moving fast, clouds racing",
    "image_url": "https://example.com/plot.jpg",
    "end_image_url": "https://example.com/house.jpg",
    "duration": 8,
    "resolution": "720p",
    "aspect_ratio": "adaptive"
  },
  "max_cost_usd": 3
}'

用 Python 上传电脑上的文件

参考素材必须是 https 链接。对于本地文件,POST /v1/uploads 会给你一个用来 PUT 字节的链接,以及一个作为 image_url 传入的 url(14 天内有效)。图片最大 30 MB。

Python
import os, time, uuid, requests

API = "https://api.revana.si/v1"
H = {"Authorization": f"Bearer {os.environ['REVANA_API_KEY']}"}

# 1. Upload the picture from your computer (skip this if it already has a public https link).
up = requests.post(f"{API}/uploads", headers=H, json={"content_type": "image/jpeg", "bytes": os.path.getsize("product.jpg"), "filename": "product.jpg"}).json()
with open("product.jpg", "rb") as fh:
    requests.put(up["upload_url"], data=fh, headers=up["upload_headers"]).raise_for_status()

# 2. Quote, then animate it. The clip starts on exactly this picture.
body = {"model": "seedance-2.5", "input": {
    "prompt": "The bottle slowly turns on the marble counter as morning light sweeps across the label, water droplets glisten",
    "image_url": up["url"], "duration": 5, "resolution": "720p", "aspect_ratio": "adaptive", "audio": True}}
quote = requests.post(f"{API}/generations/quote", headers=H, json=body).json()
print("price", quote["quoted_usd"])
key = str(uuid.uuid4())  # made once: resend with the same key after a timeout, a 429 or a 5xx
job = requests.post(f"{API}/generations", headers={**H, "Idempotency-Key": key},
                    json={**body, "max_cost_usd": quote["reserved_usd"]}).json()

# 3. Wait, then download.
while job["status"] in ("queued", "running"):
    time.sleep(5)
    job = requests.get(f"{API}/generations/{job['id']}", headers=H).json()
if job["status"] == "succeeded":
    open("product.mp4", "wb").write(requests.get(f"{API}/generations/{job['id']}/content", headers=H).content)

图生视频的价格

与文生视频的每秒价格相同:480p $0.09 · 720p $0.21 · 1080p $0.52,含声音。使用首帧可能比标价稍高,所以报价接口(免费)会给出每个请求的确切价格;把它的 reserved_usd 作为 max_cost_usd 传入。失败的生成不收费。价格计算器。

适合图生视频的提示词

  • 说明什么在变化。“她转身走出画面”比描述照片里已有的女人效果更好。
  • 一个镜头运动。缓慢推进、环绕、向左摇或固定机位。短视频里同时用两种运动容易互相打架。
  • 保持光线。提到图片里的光线(“温暖的窗光”),视频就不会漂移成另一种风格。
  • 加上声音。Seedance 2.5 会和画面一起生成声音:“碎石上的脚步声,远处的火车”。
  • 用干净、清晰的图片,形状尽量接近输出。图片中的文字和标志在运动时可能变形;请在剪辑软件里加。

更多示例见 Seedance 2.5 提示词指南。

同一密钥下的其他图生视频模型

图生视频模型对比
模型时长分辨率首尾帧720p 每秒价格(含声音)
Seedance 2.54–30 s480p, 720p, 1080p是$0.21
Seedance 2.04–15 s480p, 720p, 1080p, 4K是$0.15
Kling 4.03–30 s720p, 1080p是$0.18
Kling 3.03–15 s720p, 1080p, 4K是$0.13
Veo 3.14, 6, 8 s720p, 1080p, 4K是$0.40
Wan 3.02–30 s480p, 720p, 1080p是$0.07
MiniMax H34–15 s768p, 2K是$0.03 (768p)

常见问题

Seedance 2.5 支持图生视频吗?

支持。传 image_url 作为首帧,或同时传 image_url 和 end_image_url 作为首尾帧,用的是与文生视频相同的 POST /v1/generations 请求。视频时长 4 到 30 秒,带声音。

Seedance 2.5 图生视频要多少钱?

在 Revana 上含声音每秒 480p $0.09 · 720p $0.21 · 1080p $0.52。使用首帧可能会稍贵一点;免费的报价接口会给出确切价格。

支持哪些图片格式和尺寸?

任何指向 JPEG、PNG 或 WebP 图片的公开 https 链接,或用 POST /v1/uploads 上传的文件(图片最大 30 MB)。

视频会保持我图片的宽高比吗?

会,只要把 aspect_ratio 设为 adaptive:视频会采用首帧的形状。

能做无缝循环吗?

能:把同一张图片同时作为 image_url 和 end_image_url 传入,并描述一个回到起点的动作。

生成你的第一条 Seedance 2.5 视频

一个 API 密钥即可使用 Seedance 2.5 及所有其他视频和图像模型。预付额度 $10 起,赠送免费注册额度,无需订阅,仅对已交付的视频收费。