文生视频与图生视频:五种 API 模式详解
大多数视频模型接受的输入不止提示词。你可以从一张图片开始,固定首帧和尾帧,传入角色和产品的参考图,或者基于已有片段进行创作。本指南讲解每种模式、何时使用,以及如何调用。
五种模式一览
每种模式都使用同一个接口 POST /v1/generations。变化的只是除提示词之外你发送的输入。
| 模式 | 发送内容 | 适用场景 |
|---|---|---|
| 文生视频 | a prompt | 探索创意、B-roll 素材、没有现成图片的场景 |
| 图生视频 | 作为 image_url 的起始帧,加上提示词 | 让产品图、艺术作品和静态图动起来,并保持精确的外观 |
| 首尾帧 | image_url 以及 end_image_url,加上提示词 | 转场、揭示镜头,以及必须以指定图片结尾的镜头 |
| 参考图 | 作为 image_urls 的多张图片,加上提示词 | 让角色、产品和场景在多个镜头间保持一致 |
| 视频生视频 | 一段源片段,加上提示词 | 对已有的素材进行风格转换或再创作 |
并非每个模型都支持所有模式。下方的支持情况表涵盖了主要模型,每个模型在模型页面上的详情页也列出了它支持的任务。
文生视频
文生视频是最简单的模式:你描述镜头,其余一切都由模型决定,从人脸、场景到色彩和构图。当你在探索创意,或需要通用素材(如 B-roll、定场镜头或抽象背景)时,这种自由度很有用。
当视频必须呈现特定内容时,它就是错误的模式:你的产品、你的标志、某个特定的人,或必须符合品牌规范的版式。每次生成都会重新构想这些细节,所以同一条提示词生成的两个片段不会一致。
好的文本提示词应涵盖主体、动作、场景、镜头和光线,以及模型会生成的声音。我们的 Seedance 2.0 指南有更多提示词技巧。
图生视频
使用图生视频时,你的图片就是首帧。其中的一切(产品、人脸、构图和色彩)从一开始就是固定的,提示词只需描述接下来发生什么。这个模式适合让产品照片、插画和主视觉动起来,也适合任何外观必须精确的镜头。
常见的工作流程是先用 Nano Banana Pro 或 GPT Image 2 等图像模型生成静态图,调到满意后再让它动起来。静态图的迭代比视频更便宜、更快。
下面是 Seedance 2.0 的图生视频请求:一段 5 秒、720p、带声音的片段,费用为 $0.75。adaptive 宽高比让画面与你图片的形状一致。
export REVANA_API_KEY="sr_live_..."
# 1. Submit the job (returns 202 with the generation id)
curl https://api.revana.si/v1/generations \
-H "Authorization: Bearer $REVANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"input": {
"prompt": "The coffee in the cup starts to steam, and a hand reaches in from the right and lifts the cup off the table. Morning light, quiet cafe ambience.",
"image_url": "https://example.com/coffee.jpg",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "adaptive",
"audio": true
},
"max_cost_usd": 2
}'
# 2. Poll with the id from step 1 until status is "succeeded" or "failed"
curl https://api.revana.si/v1/generations/gen_01JBX7Q2M4 \
-H "Authorization: Bearer $REVANA_API_KEY"import os
import time
import requests
API = "https://api.revana.si/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['REVANA_API_KEY']}"}
resp = requests.post(f"{API}/generations", headers=HEADERS, json={
"model": "seedance-2.0",
"input": {
"prompt": "The coffee in the cup starts to steam, and a hand reaches in from the right and lifts the cup off the table. Morning light, quiet cafe ambience.",
"image_url": "https://example.com/coffee.jpg",
"resolution": "720p",
"duration": 5,
"aspect_ratio": "adaptive",
"audio": True,
},
"max_cost_usd": 2,
})
resp.raise_for_status()
job = resp.json()
while job["status"] in ("queued", "running"):
time.sleep(5)
job = requests.get(f"{API}/generations/{job['id']}", headers=HEADERS).json()
if job["status"] == "succeeded":
print(job["output"]["urls"], job["cost_usd"])
else:
print("Failed:", job["error"])// Node 18 or later. Save as generate.mjs and run: node generate.mjs
const API = "https://api.revana.si/v1";
const headers = {
Authorization: `Bearer ${process.env.REVANA_API_KEY}`,
"Content-Type": "application/json",
};
const res = await fetch(`${API}/generations`, {
method: "POST",
headers,
body: JSON.stringify({
model: "seedance-2.0",
input: {
prompt: "The coffee in the cup starts to steam, and a hand reaches in from the right and lifts the cup off the table. Morning light, quiet cafe ambience.",
image_url: "https://example.com/coffee.jpg",
resolution: "720p",
duration: 5,
aspect_ratio: "adaptive",
audio: true,
},
max_cost_usd: 2,
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
let job = await res.json();
while (job.status === "queued" || job.status === "running") {
await new Promise((r) => setTimeout(r, 5000));
job = await (await fetch(`${API}/generations/${job.id}`, { headers })).json();
}
if (job.status === "succeeded") console.log(job.output.urls, job.cost_usd);
else console.error("Failed:", job.error);描述运动,而不是图片:模型已经能看到图片了。“蒸汽升起,杯子被端起”比重复“木桌上的一杯白色咖啡”效果更好。
首帧和尾帧
加上 end_image_url,模型就会生成你选定的两张图片之间的运动。由于结尾是固定的,这个模式适合场景之间的转场、前后对比镜头、产品揭示,以及必须与下一段无缝衔接的片段。要做循环,可以试试两端用同一张图。
两帧应当是同一个镜头中合理的起止画面:场景、构图和光线相同。如果差别太大,模型就得在几秒内凭空创造巨大的变化,结果会更难预测。这段无声的 5 秒 1080p Kling 3.0 片段费用为 $0.60:
{
"model": "kling-3.0",
"input": {
"prompt": "Time-lapse: the empty plot fills with a small wooden cabin as the camera holds still, clouds racing overhead",
"image_url": "https://example.com/plot-empty.jpg",
"end_image_url": "https://example.com/plot-cabin.jpg",
"resolution": "1080p",
"duration": 5,
"audio": false
},
"max_cost_usd": 1
}目录中,Seedance 2.5、Seedance 2.0、Seedance 2.0 Mini、Veo 3.1、Veo 3.1 Fast、Veo 3.1 Lite、Kling 3.0、Kling 3.0 Omni、Wan 3.0 和 Grok Imagine Video 1.5 列有首尾帧。Hailuo 2.3 接受起始帧,但不接受结束帧。
参考图
参考图不是帧。模型用它们来了解某个人、产品或场景的样子,然后把它们放进提示词所描述的新镜头里。这使参考图成为保持一致性的模式:同一个角色出现在十个镜头中,或同一件产品出现在不同场景里。
把图片作为 image_urls 发送,并在提示词中按位置引用每一张,例如“第一张图里的女士拿着第二张图里的包”。数量上限取决于模型:Seedance 2.5 最多 30 张,Wan 3.0 最多 10 张,Seedance 2.0 最多 9 张,Seedance 2.0 Mini 最多 9 张,Veo 3.1 Fast 最多 3 张,Veo 3.1 Lite 最多 3 张。在 Seedance 系列模型上,一个请求里要么发送帧,要么发送参考图,不能两者同时发送。
这个 8 秒、720p、带声音的 Veo 3.1 Fast 请求费用为 $0.80:
{
"model": "veo-3.1-fast",
"input": {
"prompt": "The man from the first image walks into the bakery from the second image, picks up a loaf and smiles at the camera. Bell over the door, quiet chatter.",
"image_urls": [
"https://example.com/man.jpg",
"https://example.com/bakery.jpg"
],
"resolution": "720p",
"duration": 8,
"aspect_ratio": "16:9",
"audio": true
},
"max_cost_usd": 1.5
}视频生视频
视频生视频从你已有的片段开始。源片段决定运动和节奏,提示词描述需要改变的地方:新的风格、新的场景或不同的细节。它适合对实拍素材进行风格转换、对之前的生成结果进行再创作,或者在保留表演的同时改变外观。
在本指南涉及的模型中,Seedance 2.5、Kling 3.0 Omni 和 Wan 3.0 列有视频生视频,Kling 3.0 Motion Control 也基于源视频工作。源片段的输入方式因模型而异,所以在开发之前请先查看该模型的页面。
在部分模型上,带视频输入的任务定价不同。在 Seedance 2.5 上,计费秒数是输出加上输入片段,费率为较低的“带视频输入”费率:用 10 秒源片段生成的 10 秒 720p 片段费用为 $3.00,而同样的片段由提示词生成则为 $2.50。Kling 3.0 Omni 为带视频输入的任务单独列出了费率,720p 下每秒 $0.13。
哪些模型支持哪种模式
来自 2026年10月的 Revana 目录:
| 模型 | 文本 | 图片 | 首尾帧 | 参考图 | 视频 |
|---|---|---|---|---|---|
| Seedance 2.5 | yes | yes | yes | yes | yes |
| Seedance 2.0 | yes | yes | yes | yes | no |
| Seedance 2.0 Mini | yes | yes | yes | yes | no |
| Veo 3.1 | yes | yes | yes | no | no |
| Veo 3.1 Fast | yes | yes | yes | yes | no |
| Veo 3.1 Lite | yes | yes | yes | yes | no |
| Kling 3.0 | yes | yes | yes | no | no |
| Kling 3.0 Omni | yes | yes | yes | yes | yes |
| Wan 3.0 | yes | yes | yes | yes | yes |
| Hailuo 2.3 | yes | yes | no | no | no |
| Grok Imagine Video 1.5 | yes | yes | yes | yes | no |
模式会影响价格吗?
基本不会。视频模型按输出秒数、分辨率计费,部分模型还按是否有声音计费。一段 5 秒 720p 的 Seedance 2.0 片段,无论从提示词还是从图片开始都是 $0.75,加上结束帧或参考图也不会改变目录价格。例外是上文提到的视频输入。
每个任务的价格在你提交时从预付余额中预留,只有任务成功才会扣费。价格页面列出了所有费率。
如何选择模式
- 还没有素材:从文生视频开始,或者先用图像模型生成一张静态图再让它动起来。
- 外观必须精确:用图生视频,从你已确认的画面出发。
- 结尾很重要:用首尾帧。
- 多个镜头中出现同一个角色或产品:用参考图。
- 你已经有素材:用视频生视频。
模型不支持的字段或取值会在扣费之前以 422 被拒绝,所以选错模式不会产生任何费用。完整字段参考见文档。
准备好试试了吗?获取 API 密钥,发送你的第一个请求。
常见问题
文生视频和图生视频有什么区别?
文生视频只根据提示词生成,镜头里的一切都由模型自行构想。图生视频把你的图片作为首帧,因此画面风格是固定的,提示词只需描述动作。
图生视频比文生视频贵吗?
按目录价格来看不是。视频模型按输出秒数、分辨率计费,部分模型还按是否有声音计费。2026年10月,一段 5 秒 720p 的 Seedance 2.0 片段无论哪种方式都是 $0.75。
什么是首帧和尾帧?
把起始图片作为 image_url 发送,把结束图片作为 end_image_url 发送,模型就会生成两者之间的运动。它适合用于转场、揭示镜头和循环。
我可以发送多少张参考图?
取决于模型:Seedance 2.5 最多 30 张,Wan 3.0 最多 10 张,Seedance 2.0 最多 9 张,Seedance 2.0 Mini 最多 9 张,Veo 3.1 Fast 最多 3 张,Veo 3.1 Lite 最多 3 张。
可以把起始帧和参考图结合使用吗?
Seedance 系列模型不行:一个请求里要么发送帧,要么发送参考图,不能两者同时发送。
哪些模型支持视频生视频?
在主要模型中,Seedance 2.5、Kling 3.0 Omni 和 Wan 3.0 列有视频生视频,Kling 3.0 Motion Control 也支持。模型页面列出了每个模型支持的任务类型。