API 指南 / Trellis 视频生成(Wan TI2V)

API 指南 · Trellis 视频生成(Wan TI2V)

文生视频 / 图生视频(异步),草稿集,按秒计费。

调用方式
异步(仅支持):POST 提交返回 {id, status};轮询 GET /v1/jobs/{id}(间隔 3–5s)。

提交时用 mode 选择:t2v(文生视频)或 i2v(图生视频,需带首帧 image)。

本端点为 JSON:图片以可下载的 http(s) URL 或 data-uri(base64)传入,不是文件上传。

num_frames 必须满足 4n+1(如 49);按 usage.seconds(= frames/fps)计费。

调用示例:

cURL
ID=$(curl -s https://api.trellis.hk/v1/videos \
  -H "Authorization: Bearer sk-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"mode":"i2v","prompt":"人物微笑转身","image":"<data-uri/url>",
       "height":480,"width":832,"num_frames":49,"num_inference_steps":30,"seed":0}' \
  | jq -r .id)

curl -s https://api.trellis.hk/v1/jobs/$ID \
  -H "Authorization: Bearer sk-xxxxxxxx"   # 轮询直到 completed,取 url 下载
所有模型共用同一 API Key 与同一端点:https://api.trellis.hk/v1