视频
wan3.0-video API
通过 Modelflare 异步视频入口使用精确的 wan3.0-video 模型 ID。
使用精确模型 ID wan3.0-video。请求中的模型名必须与本页完全一致。
请求参数:duration=5resolution=1080Pratio=16:9
提示词:Macro slow-motion shot of steamed milk poured into a ceramic cup of espresso, forming a rosetta latte art pattern. Warm morning light from a window, wooden counter, soft steam rising, shallow depth of field, commercial food photography, no text.
{ "model": "wan3.0-video", "prompt": "Macro slow-motion shot of steamed milk poured into a ceramic cup of espresso, forming a rosetta latte art pattern. Warm morning light from a window, wooden counter, soft steam rising, shallow depth of field, commercial food photography, no text.", "seconds": "5", "duration": 5, "resolution": "1080P", "ratio": "16:9", "aspect_ratio": "16:9"}使用 Modelflare API Key,通过 https://modelflare.dev/v1 发送请求。网关入口为 POST /v1/videos。
Authorization: Bearer YOUR_MODELFLARE_API_KEYcurl https://modelflare.dev/v1/videos \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan3.0-video", "input": {"prompt": "一只白猫在雨夜霓虹街道上奔跑,电影感跟拍"}, "parameters": {"resolution": "1080P", "duration": 5, "audio": true} }'任务查询与下载
Section titled “任务查询与下载”提交成功后保存任务 ID。使用 GET /v1/videos/{task_id} 轮询,完成后使用 GET /v1/videos/{task_id}/content 下载;结果地址可能过期,应及时转存。
curl https://modelflare.dev/v1/videos/TASK_ID \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"Wan 通常使用 input 与 parameters;帧引导和 reference media 不能混用。
Wan3.0 使用 input.prompt 或 input.media,并在 parameters 中设置输出。媒体可表达首帧、尾帧、参考图、参考视频、参考音频、文件或网页。
| 字段 | 必填 | 说明 |
|---|---|---|
model |
是 | wan3.0-video |
input.prompt |
条件 | 与 input.media 至少提供一个 |
input.media[] |
条件 | first_frame、last_frame、reference_*、file 或 link |
parameters.resolution |
否 | 480P / 720P / 1080P(默认 1080P) |
parameters.ratio |
否 | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / adaptive |
parameters.duration |
否 | 2–30 秒,或 -1 自动选择 |
parameters.audio |
否 | 是否生成同步音频 |
parameters.prompt_extend |
否 | 该独立模型按模型契约设为 false |
parameters.seed |
否 | 可选随机种子 |
parameters.watermark |
否 | 是否添加水印 |
输入与输出限制
Section titled “输入与输出限制”Wan3.0 支持文字、首/尾帧、最多 10 张参考图、5 个参考视频、5 段参考音频以及一个文件或网页输入;输出分辨率为 480P、720P 或 1080P,时长为 2–30 秒或 -1 自动选择。首/尾帧、参考媒体、文件和网页工作流互斥,具体组合由 input.media[].type 决定。
官方工作流示例
Section titled “官方工作流示例”Wan3.0 的文字、帧引导、参考媒体、文件和网页输入使用同一个 input/parameters 信封;每种媒体工作流互斥。
首尾帧
curl https://modelflare.dev/v1/videos \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan3.0-video", "input": {"prompt": "镜头从第一帧平滑推进到最后一帧", "media": [ {"type": "first_frame", "url": "https://example.com/first.png"}, {"type": "last_frame", "url": "https://example.com/last.png"} ]}, "parameters": {"resolution": "1080P", "duration": 8, "ratio": "adaptive", "audio": true} }'参考媒体
curl https://modelflare.dev/v1/videos \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan3.0-video", "input": {"prompt": "保持角色、动作和音色一致", "media": [ {"type": "reference_image", "url": "https://example.com/character.png"}, {"type": "reference_video", "url": "https://example.com/motion.mp4"}, {"type": "reference_audio", "url": "https://example.com/voice.mp3"} ]}, "parameters": {"resolution": "720P", "duration": -1, "ratio": "adaptive"} }'错误与失败任务
Section titled “错误与失败任务”参数不符合模型契约时,创建接口会返回带 request ID 的 4xx。异步任务也可能在创建成功后进入 failed;轮询响应中的 error_code 和 error_message 才是该任务的最终原因。不要把同一请求改成另一种 JSON 结构重试。
本页只覆盖 Modelflare 的模型生成/编辑调用。搜索或地图增强、声音管理、元素库管理等资源型接口不属于本页的公开调用范围,也不需要作为模型请求字段传入。
本模型按视频秒计费。请查看模型价格页查看当前销售价、参考原价和完整规格。
| 模型 ID | 差异 |
|---|---|
wan3.0-video |
本页说明的模型。 |
媒体契约 · v1
官方来源: Alibaba Cloud Model Studio
契约参数
| Intent 字段 | 控件 | 选项 |
|---|---|---|
ratio | select | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / adaptive |
resolution | select | 480p / 720p / 1080p |
duration | select | -1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15 / 16 / 17 / 18 / 19 / 20 / 21 / 22 / 23 / 24 / 25 / 26 / 27 / 28 / 29 / 30 |
audio | switch | — |
支持能力
allowed_values·ratio· 16:9, 9:16, 1:1, 4:3, 3:4, adaptiveallowed_values·resolution· 480p, 720p, 1080pallowed_values·duration· -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30max_assets·reference_asset_ids· 21
结构化请求示例
text
Intent
{
"audio": false,
"duration": -1,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"ratio": "16:9",
"resolution": "480p"
}上游请求
{
"audio": false,
"duration": -1,
"model": "wan3.0-video",
"prompt": "A red paper kite over a quiet harbour at dusk.",
"ratio": "16:9",
"resolution": "480p",
"seconds": "-1"
}reference
Intent
{
"audio": false,
"duration": -1,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"ratio": "16:9",
"resolution": "480p"
}上游请求
{
"input": {
"media": [
{
"type": "reference_image",
"url": "https://example.com/reference.png"
}
],
"prompt": "A red paper kite over a quiet harbour at dusk."
},
"model": "wan3.0-video",
"parameters": {
"duration": -1,
"resolution": "480P"
}
}