YM2API开发者文档
跳到正文
文档 / Wan 3.0下载 Markdown ↓

Wan 3.0 视频 API(自部署)

视频分组 #155「【视频】多模型按秒计费」 提供万相 Wan 3.0 自部署线路,模型名 wan3.0-video-自部署。和 #155 的其他视频模型共用同一把 Key、同一个接口,用 model 切换。创建任务后用同一把 Key 轮询,完成后返回本站域名的播放、下载地址。

基础地址:https://yyds.seqnode.com/v1。其他视频模型见 多模型视频,Grok 视频见 Grok 视频文档。

模型与价格

分辨率售价5 秒30 秒
480p$0.30 / 秒$1.50$9.00
720p$0.58 / 秒$2.90$17.40
1080p$1.18 / 秒$5.90$35.40

只按输出视频秒数 × 档位单价计费;参考图片、视频、音频不另收费。价格以模型广场为准,可在 模型广场 #155 查看最新价格与最近成功率。

请求参数

POST /v1/videos,Content-Type: application/json。

字段类型是否必填取值与说明
modelstring必填wan3.0-video-自部署
promptstring必填视频描述,不能为空
resolutionstring必填480p、720p、1080p(大小写均可);本站按此档位计费
duration_secondsinteger必填2–30 秒的整数;也可写 seconds 或 duration,三者不能互相矛盾;本站按此秒数计费
aspect_ratiostring可选16:9、9:16、1:1、4:3、3:4
reference_imagesstring[]可选参考图片,公网可访问的 HTTPS 直链
reference_videosstring[]可选参考视频,公网可访问的 HTTPS 直链
reference_audiosstring[]可选参考音频,公网可访问的 HTTPS 直链
seedinteger可选随机种子,相同参数配合相同种子便于复现

不支持的字段会被直接拒绝(422),包括 media_inputs 统一素材写法、images、first_frame_url、input_reference、negative_prompt。参考素材请用上表的 reference_* 字段,不支持 base64。

文生视频

curl --fail-with-body 'https://yyds.seqnode.com/v1/videos' \
  -H 'Authorization: Bearer YOUR_GROUP_155_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan3.0-video-自部署",
  "prompt": "一只橘猫在窗台上伸懒腰,阳光洒进房间,镜头缓慢推近。",
  "resolution": "720p",
  "aspect_ratio": "16:9",
  "duration_seconds": 5
}'

参考图生视频

把参考图片放进 reference_images;参考视频、音频同理,分别放进 reference_videos、reference_audios。

curl --fail-with-body 'https://yyds.seqnode.com/v1/videos' \
  -H 'Authorization: Bearer YOUR_GROUP_155_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan3.0-video-自部署",
  "prompt": "让参考图里的人物在海边慢慢转身,海风吹动头发。",
  "resolution": "1080p",
  "aspect_ratio": "9:16",
  "duration_seconds": 8,
  "reference_images": ["https://example.com/person.jpg"]
}'

查询与下载

创建成功返回任务 id。每 5–10 秒用同一把 Key 查询一次;生成和转存期间为 pending / in_progress,完成后 delivery_status 为 ready,播放地址在 video.url,下载地址在 video.download_url。地址都是本站域名,转存完成后 1 小时有效,请及时下载保存。超时后保留任务 ID 继续查询,不要重复创建。

curl --fail-with-body 'https://yyds.seqnode.com/v1/videos/TASK_ID' \
  -H 'Authorization: Bearer YOUR_GROUP_155_API_KEY'

各状态和字段含义见 Grok 视频文档第 4 节,#155 所有模型通用。

Python 完整示例

import time, requests

BASE = "https://yyds.seqnode.com/v1"
HEAD = {"Authorization": "Bearer YOUR_GROUP_155_API_KEY"}

task = requests.post(f"{BASE}/videos", headers=HEAD, json={
    "model": "wan3.0-video-自部署",
    "prompt": "一只橘猫在窗台上伸懒腰,阳光洒进房间。",
    "resolution": "720p",
    "duration_seconds": 5,
}, timeout=60)
task.raise_for_status()
tid = task.json()["id"]

for _ in range(180):                      # 最多等约 30 分钟
    r = requests.get(f"{BASE}/videos/{tid}", headers=HEAD, timeout=60).json()
    if r.get("status") == "failed":
        raise SystemExit(r)
    if r.get("delivery_status") == "ready":
        url = r["video"]["download_url"]
        open(f"{tid}.mp4", "wb").write(requests.get(url, timeout=300).content)
        print("saved", tid, url)
        break
    time.sleep(10)

常见错误

状态码报错原因与处理
400resolution is required for …没传 resolution,或档位不是 480p / 720p / 1080p
422Field seconds is below the minimum / above the maximum时长不在 2–30 秒
422Field aspect_ratio is not among the allowed enum values比例不在上表
422The request contains a field the model does not support: …传了本模型不认识的字段,例如 media_inputs、images、negative_prompt、first_frame_url
422Failed to download the input material参考素材链接无法下载:确认是公网 HTTPS 直链、不需要登录、没有防盗链
401INVALID_API_KEYKey 不对,或不属于 #155 分组

参数错误在创建时就会返回,不扣费。生成失败的任务也不扣费。

验证记录

2026-10-30:经本站公网逐项校验了上表全部字段、三个分辨率档位、五种比例和 2–30 秒时长范围;media_inputs、images、negative_prompt 等字段确认会被拒绝。

返回 API 文档首页 · 在模型广场查看 #155