qianwen-video-generation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Agent setup: If your agent doesn't auto-load skills (e.g. Claude Code), see agent-compatibility.md once per session.
Agent设置:如果你的Agent不会自动加载技能(例如Claude Code), 请在每个会话中查看agent-compatibility.md

Qwen Video Generation

Qwen视频生成

Generate videos using Wan models. All tasks are asynchronous — submit, then poll until completion. This skill is part of QianWen-AI/qianwen-ai.
⚠️ Critical Parameter Differences by Mode:
  • kf2v (First+Last Frame): Duration is fixed at 5 seconds — other values will fail. Output is silent only.
  • Resolution parameter varies: t2v/r2v/vace use
    size
    (e.g.
    "1280*720"
    ); i2v/kf2v use
    resolution
    (e.g.
    "720P"
    ).
基于Wan模型生成视频。所有任务均为异步操作——提交任务后,轮询直至完成。 此技能属于QianWen-AI/qianwen-ai生态。
⚠️ 不同模式的关键参数差异
  • kf2v(首尾帧生成):时长固定为5秒——其他值会导致任务失败。输出仅为无声视频。
  • 分辨率参数不同:t2v/r2v/vace使用
    size
    (例如
    "1280*720"
    );i2v/kf2v使用
    resolution
    (例如
    "720P"
    )。

Skill directory

技能目录

Use this skill's internal files to execute and learn. Load reference files on demand when the default path fails or you need details.
LocationPurpose
scripts/video.py
Default execution — mode auto-detect, submit, poll, download
references/execution-guide.md
Fallback: curl for all 5 modes, code generation
references/request-fields.md
Field tables and audio handling by mode
references/workflows.md
Duration extensions, multi-shot, VACE pipelines
references/polling-guide.md
Polling patterns and timing
references/merge-media.md
Concat, trim, audio overlay — ffmpeg/moviepy recipes
references/prompt-guide.md
Per-mode prompt formulas, sound description, multi-shot structure
references/examples.md
Full script examples per mode
references/sources.md
Official documentation URLs
references/agent-compatibility.md
Agent self-check: register skills in project config for agents that don't auto-load
使用此技能的内部文件执行任务和学习。当默认路径失效或需要详细信息时,按需加载参考文件。
位置用途
scripts/video.py
默认执行入口——自动检测模式、提交任务、轮询状态、下载结果
references/execution-guide.md
备选方案:所有5种模式的curl命令、代码生成指南
references/request-fields.md
各模式的字段表及音频处理说明
references/workflows.md
时长扩展、多镜头生成、VACE工作流
references/polling-guide.md
轮询模式和时间建议
references/merge-media.md
拼接、裁剪、音频叠加——ffmpeg/moviepy实现方案
references/prompt-guide.md
各模式的提示词公式、声音描述、多镜头结构
references/examples.md
所有模式的完整脚本示例
references/sources.md
官方文档URL
references/agent-compatibility.md
Agent自检:对于不会自动加载技能的Agent,需在项目配置中注册技能

Security

安全规范

NEVER output any API key or credential in plaintext. Always use variable references (
$DASHSCOPE_API_KEY
in shell,
os.environ["DASHSCOPE_API_KEY"]
in Python). Any check or detection of credentials must be non-plaintext: report only status (e.g. "set" / "not set", "valid" / "invalid"), never the value. Never display contents of
.env
or config files that may contain secrets.
When the API key is not configured, NEVER ask the user to provide it directly. Instead, help create a
.env
file with a placeholder (
DASHSCOPE_API_KEY=sk-your-key-here
) and instruct the user to replace it with their actual key from the QianWen Console. Only write the actual key value if the user explicitly requests it.
绝对不要以明文形式输出任何API密钥或凭证。始终使用变量引用(Shell中使用
$DASHSCOPE_API_KEY
,Python中使用
os.environ["DASHSCOPE_API_KEY"]
)。任何凭证检查或检测必须采用非明文方式:仅报告状态(例如“已设置”/“未设置”、“有效”/“无效”),绝不显示密钥值。绝不要显示
.env
或可能包含机密信息的配置文件内容。
当API密钥未配置时,绝不要直接要求用户提供密钥。相反,帮助用户创建带有占位符的
.env
文件(
DASHSCOPE_API_KEY=sk-your-key-here
),并指导用户从QianWen控制台获取实际密钥后替换占位符。仅当用户明确要求时,才写入实际密钥值。

Key Compatibility

密钥兼容性

Scripts require a standard QianWen API key (
sk-...
). Token Plan 团队版 keys (
sk-sp-...
) target a different endpoint (
token-plan.cn-beijing.maas.aliyuncs.com
) and do not include video models. Standard
sk-
key required for video. Video generation incurs per-second charges on standard keys. The script detects
sk-sp-
keys at startup and prints a warning. If qianwen-ops-auth is installed, see its
references/tokenplan.md
for full details.
脚本需要标准QianWen API密钥(格式为
sk-...
)。Token Plan团队版密钥(格式为
sk-sp-...
)指向不同的端点(
token-plan.cn-beijing.maas.aliyuncs.com
),且不包含视频模型。视频生成必须使用标准
sk-
格式密钥。标准密钥生成视频会按秒计费。脚本启动时会检测
sk-sp-
格式密钥并打印警告。如果已安装qianwen-ops-auth技能,请查看其
references/tokenplan.md
获取详细信息。

Mode Selection Guide

模式选择指南

User WantModeKey Field
Generate video from text description onlyt2v
prompt
only
Animate a single imagei2v
img_url
or
reference_image
wan2.7 unified i2v: first frame, first+last frame, video continuation, audio synci2v
media[]
,
first_frame_url
,
first_clip_url
,
driving_audio_url
Transition between two images (⚠️ 5s fixed, silent only)kf2v
first_frame_url
+
last_frame_url
Role-play: make characters act a new scriptr2v
reference_urls
(up to 5)
Video editing: multi-image ref, repainting, local edit, extend, outpaintvace
function
(default
wan2.1-vace-plus
)
Video editing (no
function
field, uses media array)
videoeditmodel =
wan2.7-videoedit
or
happyhorse-1.0-video-edit
用户需求模式关键字段
仅通过文本描述生成视频t2v仅需
prompt
将单张图片动起来i2v
img_url
reference_image
wan2.7统一i2v:首帧、首尾帧、视频续播、音频同步i2v
media[]
,
first_frame_url
,
first_clip_url
,
driving_audio_url
在两张图片之间生成过渡视频(⚠️ 固定5秒,仅无声kf2v
first_frame_url
+
last_frame_url
角色扮演:让角色按照新脚本表演r2v
reference_urls
(最多5个)
视频编辑:多图参考、重绘、局部编辑、扩展、外绘vace
function
(默认值
wan2.1-vace-plus
视频编辑(无
function
字段,使用media数组)
videoeditmodel =
wan2.7-videoedit
happyhorse-1.0-video-edit

Model Selection

模型选择

  1. User specified a model → use directly.
  2. Consult the qianwen-model-selector skill when model choice depends on capability, scenario, or pricing.
  3. No signal, clear task → defaults: t2v →
    wan2.6-t2v
    , i2v →
    wan2.6-i2v-flash
    , kf2v →
    wan2.2-kf2v-flash
    , r2v →
    wan2.6-r2v-flash
    , vace →
    wan2.1-vace-plus
    , videoedit →
    wan2.7-videoedit
    . For wan2.7 features, explicitly set
    --model wan2.7-t2v
    /
    --model wan2.7-i2v
    /
    --model wan2.7-videoedit
    . For HappyHorse series (alternative T2V/I2V/R2V/video-edit), set
    --model happyhorse-1.0-{t2v,i2v,r2v,video-edit}
    .
  1. 用户指定模型 → 直接使用该模型。
  2. 当模型选择取决于能力、场景或定价时 → 调用qianwen-model-selector技能。
  3. 无指定信号但任务明确 → 默认模型:t2v →
    wan2.6-t2v
    ,i2v →
    wan2.6-i2v-flash
    ,kf2v →
    wan2.2-kf2v-flash
    ,r2v →
    wan2.6-r2v-flash
    ,vace →
    wan2.1-vace-plus
    ,videoedit →
    wan2.7-videoedit
    。如需使用wan2.7特性,需显式设置
    --model wan2.7-t2v
    /
    --model wan2.7-i2v
    /
    --model wan2.7-videoedit
    。如需使用HappyHorse系列(替代T2V/I2V/R2V/video-edit),设置
    --model happyhorse-1.0-{t2v,i2v,r2v,video-edit}

Models

模型列表

t2v (Text-to-Video)

t2v(文本转视频)

ModelFeatures
wan2.7-t2v
Ratio control, auto-dubbing, 5000 char prompt, 720P/1080P. Use
resolution
+
ratio
params.
wan2.6-t2v
default
Audio, multi-shot, 2–15s, 720P/1080P. Use
size
param.
wan2.5-t2v-preview
Audio, 5s/10s, 480P/720P/1080P
wan2.2-t2v-plus
Silent, 5s, 480P/1080P
模型特性
wan2.7-t2v
比例控制、自动配音、支持5000字符提示词、720P/1080P分辨率。使用
resolution
+
ratio
参数。
wan2.6-t2v
默认
带音频、多镜头、时长2–15秒、720P/1080P分辨率。使用
size
参数。
wan2.5-t2v-preview
带音频、时长5秒/10秒、480P/720P/1080P分辨率
wan2.2-t2v-plus
无声、时长5秒、480P/1080P分辨率

i2v (Image-to-Video)

i2v(图片转视频)

ModelFeatures
wan2.7-i2v
Unified protocol: first frame, first+last frame, video continuation, audio sync. Uses
media[]
array.
wan2.6-i2v-flash
default
Audio/silent, multi-shot, 2–15s, 720P/1080P. Uses
img_url
.
wan2.6-i2v
Audio, multi-shot, 2–15s, 720P/1080P
wan2.5-i2v-preview
Audio, 5s/10s, 480P/720P/1080P
模型特性
wan2.7-i2v
统一协议:首帧、首尾帧、视频续播、音频同步。使用
media[]
数组。
wan2.6-i2v-flash
默认
可带音频/无声、多镜头、时长2–15秒、720P/1080P分辨率。使用
img_url
wan2.6-i2v
带音频、多镜头、时长2–15秒、720P/1080P分辨率
wan2.5-i2v-preview
带音频、时长5秒/10秒、480P/720P/1080P分辨率

kf2v / r2v / vace

kf2v / r2v / vace

ModelFeatures
wan2.2-kf2v-flash
(kf2v default)
Silent, 5s, 480P/720P/1080P
wan2.6-r2v
Audio, single/multi character, 2–10s, 720P/1080P
wan2.6-r2v-flash
(r2v default)
Audio/silent, multi-character, 2–10s, 720P/1080P
wan2.1-vace-plus
(vace)
Multi-image ref, repainting, local edit, ≤5s, 720P
模型特性
wan2.2-kf2v-flash
(kf2v默认)
无声、时长5秒、480P/720P/1080P分辨率
wan2.6-r2v
带音频、单/多角色、时长2–10秒、720P/1080P分辨率
wan2.6-r2v-flash
(r2v默认)
可带音频/无声、多角色、时长2–10秒、720P/1080P分辨率
wan2.1-vace-plus
(vace)
多图参考、重绘、局部编辑、时长≤5秒、720P分辨率

videoedit (Video Editing)

videoedit(视频编辑)

Prompt-driven video editing with optional reference images. No
function
field; uses
input.media = [1 video] + [refs]
. Default model:
wan2.7-videoedit
.
ModelRefs capNotes
wan2.7-videoedit
(default)
≤4Local/global prompt-driven edit; supports
negative_prompt
. 720P 0.1/s · 1080P 0.15/s
happyhorse-1.0-video-edit
≤5Element replacement via reference images; preserves original dynamics. 720P 0.14/s · 1080P 0.24/s
基于提示词的视频编辑,支持可选参考图片。无
function
字段;使用
input.media = [1个视频] + [参考素材]
。默认模型:
wan2.7-videoedit
模型参考素材上限说明
wan2.7-videoedit
(默认)
≤4局部/全局提示词驱动编辑;支持
negative_prompt
。720P 0.1元/秒 · 1080P 0.15元/秒
happyhorse-1.0-video-edit
≤5通过参考图片替换元素;保留原视频动态效果。720P 0.14元/秒 · 1080P 0.24元/秒

HappyHorse Series

HappyHorse系列

ModelModePayload differences vs wan2.6
happyhorse-1.0-t2v
t2vUses
resolution
+
ratio
(NOT
size
).
happyhorse-1.0-i2v
i2vUses
media=[{type:'first_frame',url}]
(exactly one). NO
negative_prompt
/
prompt_extend
/
ratio
/
last_frame
/
first_clip
/
driving_audio
. Wan2.6-style
img_url
auto-converted.
happyhorse-1.0-r2v
r2vUses
media=[{type:reference_image,url}]
+
resolution
+
ratio
. Up to 9 refs.
happyhorse-1.0-video-edit
videoeditUses
input.media = [1 video] + [refs]
. No
function
field. Up to 5 refs.
Pricing: 720P 0.14/s · 1080P 0.24/s. Endpoint:
/services/aigc/video-generation/video-synthesis
.
⚠️ Important: The model list above is a point-in-time snapshot and may be outdated. Model availability changes frequently. Always check the official model list for the authoritative, up-to-date catalog before making model decisions.
Model details: For more information about a specific model, direct the user to its detail page:
https://www.qianwenai.com/models/<model-name>
(replace
<model-name>
with the exact model ID, e.g.
wan2.7-t2v
https://www.qianwenai.com/models/wan2.7-t2v). NEVER modify or guess the model name in the URL.
Dynamic model queries: If the qianwen-model-selector skill or QianWen CLI (
qianwen models info <model>
) is available, use it for real-time model data. CLI requires authentication — see the qianwen-usage skill for login flow.
模型模式与wan2.6的请求体差异
happyhorse-1.0-t2v
t2v使用
resolution
+
ratio
(而非
size
)。
happyhorse-1.0-i2v
i2v使用
media=[{type:'first_frame',url}]
(仅一个)。不支持
negative_prompt
/
prompt_extend
/
ratio
/
last_frame
/
first_clip
/
driving_audio
。wan2.6风格的
img_url
会自动转换。
happyhorse-1.0-r2v
r2v使用
media=[{type:reference_image,url}]
+
resolution
+
ratio
。最多支持9个参考素材。
happyhorse-1.0-video-edit
videoedit使用
input.media = [1个视频] + [参考素材]
。无
function
字段。最多支持5个参考素材。
定价:720P 0.14元/秒 · 1080P 0.24元/秒。端点:
/services/aigc/video-generation/video-synthesis
⚠️ 重要提示:以上模型列表为当前时间点的快照,可能已过时。模型可用性会频繁变化。在选择模型前,请务必查看官方模型列表获取权威、最新的目录信息。
模型详情:如需了解特定模型的更多信息,请引导用户访问其详情页面:
https://www.qianwenai.com/models/<model-name>
(将
<model-name>
替换为准确的模型ID,例如
wan2.7-t2v
https://www.qianwenai.com/models/wan2.7-t2v)。绝不要修改或猜测URL中的模型名称。
动态模型查询:如果qianwen-model-selector技能或QianWen CLI(
qianwen models info <model>
)可用,请使用它们获取实时模型数据。CLI需要身份验证——请查看qianwen-usage技能了解登录流程。

Execution

执行步骤

⚠️ Multiple artifacts: When generating multiple files in a single session, you MUST append a numeric suffix to each filename (e.g.
out_1.mp4
,
out_2.mp4
) to prevent overwrites.
⚠️ 多文件生成:当在单个会话中生成多个文件时,必须为每个文件名添加数字后缀(例如
out_1.mp4
out_2.mp4
),以防止文件被覆盖。

Prerequisites

前置条件

  • API Key: Check that
    DASHSCOPE_API_KEY
    (or
    QIANWEN_API_KEY
    ) is set using a non-plaintext check only (e.g. in shell:
    [ -n "$DASHSCOPE_API_KEY" ]
    ; report only "set" or "not set", never the key value). If not set: run the * qianwen-ops-auth* skill if available; otherwise guide the user to obtain a key from QianWen Console and set it via
    .env
    file (
    echo 'DASHSCOPE_API_KEY=sk-your-key-here' >> .env
    in project root or current directory) or environment variable. The script searches for
    .env
    in the current working directory and the project root. Skills may be installed independently — do not assume qianwen-ops-auth is present.
  • Python 3.9+ (stdlib only, no pip install needed)
  • For media merging (concat, trim, audio overlay): see merge-media.md for ffmpeg/moviepy recipes suited to the user's environment
  • API密钥:仅通过非明文方式检查
    DASHSCOPE_API_KEY
    (或
    QIANWEN_API_KEY
    )是否已设置(例如在Shell中:
    [ -n "$DASHSCOPE_API_KEY" ]
    ;仅报告“已设置”或“未设置”,绝不显示密钥值)。如果未设置:若qianwen-ops-auth技能可用则调用该技能;否则引导用户从QianWen控制台获取密钥,并通过
    .env
    文件(在项目根目录或当前目录执行
    echo 'DASHSCOPE_API_KEY=sk-your-key-here' >> .env
    )或环境变量设置密钥。脚本会在当前工作目录和项目根目录中查找
    .env
    文件。技能可能独立安装——请勿假设qianwen-ops-auth已存在。
  • Python 3.9+(仅使用标准库,无需pip安装依赖
  • 如需媒体合并(拼接、裁剪、音频叠加):请查看merge-media.md获取适用于用户环境的ffmpeg/moviepy实现方案

Environment Check

环境检查

Before first execution, verify Python is available:
bash
python3 --version  # must be 3.9+
If
python3
is not found, try
python --version
or
py -3 --version
. If Python is unavailable or below 3.9, skip to Path 2 (curl) in execution-guide.md.
首次执行前,验证Python是否可用:
bash
python3 --version  # 必须为3.9+
如果找不到
python3
,尝试
python --version
py -3 --version
。如果Python不可用或版本低于3.9,请直接使用execution-guide.md中的方案2(curl)

Default: Run Script

默认方式:运行脚本

Script path: Scripts are in the
scripts/
subdirectory of this skill's directory (the directory containing this SKILL.md). You MUST first locate this skill's installation directory, then ALWAYS use the full absolute path to execute scripts. Do NOT assume scripts are in the current working directory. Do NOT use
cd
to switch directories before execution.
Execution note: Run all scripts in the foreground — wait for stdout; do not background.
Discovery: Run
python3 <this-skill-dir>/scripts/video.py --help
first to see all available arguments.
bash
python3 <this-skill-dir>/scripts/video.py \
  --request '{"prompt":"A detective in a rainy city at night","size":"1280*720","duration":5}' \
  --print-response
ArgumentDescription
--request '{...}'
JSON request body
--file path.json
Load request from file
--mode MODE
Override auto-detected mode (t2v/i2v/kf2v/r2v/vace)
--model ID
Override model
--output dir/
Save video and response JSON
--print-response
Print response JSON to stdout
--submit-only
Submit and exit (print task_id)
--task-id ID
Operate on existing task
--poll-interval N
Seconds between polls (default: 15)
--timeout N
Max wait seconds (default: 600)
脚本路径:脚本位于此技能目录的
scripts/
子目录中(即包含此SKILL.md的目录)。必须先定位此技能的安装目录,然后始终使用完整绝对路径执行脚本。请勿假设脚本位于当前工作目录。执行前请勿使用
cd
切换目录。
执行注意事项:所有脚本均需在前台运行——等待标准输出,不要后台运行。
查看帮助:先运行
python3 <此技能目录>/scripts/video.py --help
查看所有可用参数。
bash
python3 <此技能目录>/scripts/video.py \
  --request '{"prompt":"雨夜城市中的侦探","size":"1280*720","duration":5}' \
  --print-response
参数描述
--request '{...}'
JSON格式的请求体
--file path.json
从文件加载请求体
--mode MODE
覆盖自动检测的模式(t2v/i2v/kf2v/r2v/vace)
--model ID
覆盖默认模型
--output dir/
保存视频和响应JSON
--print-response
将响应JSON打印到标准输出
--submit-only
提交任务后退出(打印task_id)
--task-id ID
对已有任务进行操作
--poll-interval N
轮询间隔秒数(默认:15)
--timeout N
最大等待秒数(默认:600)

Verify Result

结果验证

  • Exit code
    0
    + response has
    output.task_id
    submission success
  • Poll reaches
    task_status: SUCCEEDED
    generation complete
  • Non-zero exit, HTTP error, or
    FAILED
    status → fail
  • Post-execution check: Verify the output video file exists and has non-zero size (
    ls -la <output_dir>
    )
  • MANDATORY — stderr signal check: After confirming the result, scan the command's stderr output for
    [ACTION_REQUIRED]
    or
    [UPDATE_AVAILABLE]
    . If either signal is present, you MUST follow the instructions in Update Check below before responding to the user.
  • 退出码
    0
    + 响应包含
    output.task_id
    提交成功
  • 轮询到
    task_status: SUCCEEDED
    生成完成
  • 非零退出码、HTTP错误或
    FAILED
    状态 → 任务失败
  • 执行后检查:验证输出视频文件存在且大小非零(
    ls -la <输出目录>
  • 强制检查标准错误输出:确认结果后,扫描命令的标准错误输出中是否包含
    [ACTION_REQUIRED]
    [UPDATE_AVAILABLE]
    。如果存在任一信号,必须按照下文更新检查(执行后强制操作)中的说明处理,再响应用户。

On Failure

失败处理

If the script fails, match the error output against the diagnostic table below to determine the resolution. If no match, read execution-guide.md for alternative paths: curl commands (Path 2 — all 5 modes), code generation (Path 3), and autonomous resolution (Path 5).
If Python is not available at all → skip directly to Path 2 (curl) in execution-guide.md.
Error PatternDiagnosisResolution
command not found: python3
Python not on PATHTry
python
or
py -3
; install Python 3.9+ if missing
Python 3.9+ required
Script version check failedUpgrade Python to 3.9+
SyntaxError
near type hints
Python < 3.9Upgrade Python to 3.9+
QIANWEN_API_KEY/DASHSCOPE_API_KEY not found
Missing API keyObtain key from QianWen Console; add to
.env
:
echo 'DASHSCOPE_API_KEY=sk-...' >> .env
; or run qianwen-ops-auth if available
HTTP 401
Invalid or mismatched keyRun qianwen-ops-auth (non-plaintext check only); verify key is valid
SSL: CERTIFICATE_VERIFY_FAILED
SSL cert issue (proxy/corporate)macOS: run
Install Certificates.command
; else set
SSL_CERT_FILE
env var
URLError
/
ConnectionError
Network unreachableCheck internet; set
HTTPS_PROXY
if behind proxy
HTTP 429
Rate limitedWait and retry with backoff
HTTP 5xx
Server errorRetry with backoff
ImportError: moviepy
moviepy not installed
pip install moviepy
, or use system ffmpeg instead (see merge-media.md)
PermissionError
Can't write outputUse
--output
to specify writable directory
如果脚本执行失败,请将错误输出与下面的诊断表匹配以确定解决方案。如果无匹配项,请查看execution-guide.md中的备选方案:curl命令(方案2——所有5种模式)、代码生成(方案3)和自主解决(方案5)。
如果完全没有Python环境 → 直接使用execution-guide.md中的方案2(curl)。
错误模式诊断解决方案
command not found: python3
Python不在PATH中尝试
python
py -3
;若缺失则安装Python 3.9+
Python 3.9+ required
脚本版本检查失败将Python升级到3.9+
SyntaxError
near type hints
Python版本低于3.9将Python升级到3.9+
QIANWEN_API_KEY/DASHSCOPE_API_KEY not found
缺少API密钥QianWen控制台获取密钥;添加到
.env
文件:
echo 'DASHSCOPE_API_KEY=sk-...' >> .env
;若qianwen-ops-auth可用则调用该技能
HTTP 401
密钥无效或不匹配调用qianwen-ops-auth(仅非明文检查);验证密钥有效性
SSL: CERTIFICATE_VERIFY_FAILED
SSL证书问题(代理/企业环境)macOS:运行
Install Certificates.command
;其他环境:设置
SSL_CERT_FILE
环境变量
URLError
/
ConnectionError
网络不可达检查网络;若处于代理环境则设置
HTTPS_PROXY
HTTP 429
请求频率受限等待后重试,使用退避策略
HTTP 5xx
服务器错误等待后重试,使用退避策略
ImportError: moviepy
moviepy未安装
pip install moviepy
,或使用系统ffmpeg替代(查看merge-media.md
PermissionError
无法写入输出使用
--output
指定可写入的目录

Request Fields Summary

请求字段汇总

All modes require
prompt
. See request-fields.md for full field tables per mode.
所有模式均需
prompt
字段。请查看request-fields.md获取各模式的完整字段表。

⚠️ Resolution Parameter by Mode (Critical)

⚠️ 各模式的分辨率参数(关键)

ModeParameterFormatExample
t2v
size
"WxH"
"1280*720"
,
"1920*1080"
r2v
size
"WxH"
"1280*720"
,
"1920*1080"
vace
size
"WxH"
"1280*720"
i2v
resolution
"xxxP"
"720P"
,
"1080P"
kf2v
resolution
"xxxP"
"480P"
,
"720P"
,
"1080P"
Using the wrong parameter name will cause the API call to fail.
模式参数格式示例
t2v
size
"宽x高"
"1280*720"
,
"1920*1080"
r2v
size
"宽x高"
"1280*720"
,
"1920*1080"
vace
size
"宽x高"
"1280*720"
i2v
resolution
"xxxP"
"720P"
,
"1080P"
kf2v
resolution
"xxxP"
"480P"
,
"720P"
,
"1080P"
使用错误的参数名称会导致API调用失败

Mode-Specific Required Fields

各模式的必填字段

  • i2v needs
    img_url
    /
    reference_image
    . kf2v needs
    first_frame_url
    +
    last_frame_url
    . r2v needs
    reference_urls
    . vace needs
    function
    .
  • i2v需要
    img_url
    /
    reference_image
    。kf2v需要
    first_frame_url
    +
    last_frame_url
    。r2v需要
    reference_urls
    。vace需要
    function

Cost Estimation

成本估算

🚨 NEVER guess or fabricate any price figure. Always direct the user to the official pricing page for exact rates.
Cost is billed per second of generated video. Price varies by model and resolution. For the latest rates, check the official pricing page.
Model720P (USD)1080P (USD)
wan2.7-t2vper-second billingper-second billing
wan2.7-i2vper-second billingper-second billing
wan2.6-t2vper-second billingper-second billing
wan2.6-i2v-flashper-second billingper-second billing
wan2.6-r2v-flashper-second billingper-second billing
Quick example: wan2.6-t2v 5s 720P — check the official pricing page for current per-second rates. Some models may offer a limited free quota — do not assume any call is free; use the qianwen-usage skill to check remaining free tier quota, or verify in the user's QianWen console.
To check actual usage and bills: use the qianwen-usage skill, or visit the console: Usage Analytics | Pay-as-you-go Billing | Token Plan 团队版 Subscription
NEVER fabricate, guess, or construct usage/billing/console URLs. Only provide the exact links listed in this skill. If a URL is not listed here, do not invent one.
🚨 绝对不要猜测或编造任何价格数据。始终引导用户查看 官方定价页面获取准确费率。
成本按生成视频的秒数计费。价格因模型和分辨率而异。最新费率请查看官方定价页面
模型720P1080P
wan2.7-t2v按秒计费按秒计费
wan2.7-i2v按秒计费按秒计费
wan2.6-t2v按秒计费按秒计费
wan2.6-i2v-flash按秒计费按秒计费
wan2.6-r2v-flash按秒计费按秒计费
快速示例:wan2.6-t2v生成5秒720P视频——请查看官方定价页面获取当前每秒费率。部分模型可能提供有限的免费额度——不要假设任何调用是免费的;使用qianwen-usage技能查看剩余免费额度,或在用户的QianWen控制台中验证。
如需查看实际使用情况和账单:使用qianwen-usage技能,或访问控制台: 使用分析 | 按量计费 | Token Plan团队版订阅
绝对不要编造、猜测或构建使用/账单/控制台URL。仅提供此技能中列出的准确链接。如果某个URL未在此列出,请勿自行创建。

Local File Handling

本地文件处理

When the user provides local file paths (images, videos, audio), pass them directly to the script. The script automatically uploads local files to DashScope temporary storage (
oss://
URL, 48h TTL) and injects the
X-DashScope-OssResourceResolve: enable
header. No manual upload step is needed.
Production: Default temp storage has 48h TTL and 100 QPS upload limit — not suitable for production, high-concurrency, or load-testing. To use your own OSS bucket, set
QWEN_TMP_OSS_BUCKET
and
QWEN_TMP_OSS_REGION
in
.env
, install
pip install oss2
, and provide credentials via
QWEN_TMP_OSS_AK_ID
/
QWEN_TMP_OSS_AK_SECRET
or the standard
OSS_ACCESS_KEY_ID
/
OSS_ACCESS_KEY_SECRET
. Use a RAM user with least-privilege (
oss:PutObject
+
oss:GetObject
on target bucket only). If qianwen-ops-auth is installed, see its
references/custom-oss.md
for the full setup guide.
当用户提供本地文件路径(图片、视频、音频)时,直接将其传递给脚本。脚本会自动上传本地文件到DashScope临时存储(
oss://
格式URL,有效期48小时),并注入
X-DashScope-OssResourceResolve: enable
请求头。无需手动上传步骤。
生产环境注意:默认临时存储的有效期为48小时上传QPS限制为100——不适用于生产环境、高并发或负载测试场景。如需使用自有OSS存储桶,请在
.env
中设置
QWEN_TMP_OSS_BUCKET
QWEN_TMP_OSS_REGION
,安装
pip install oss2
,并通过
QWEN_TMP_OSS_AK_ID
/
QWEN_TMP_OSS_AK_SECRET
或标准
OSS_ACCESS_KEY_ID
/
OSS_ACCESS_KEY_SECRET
提供凭证。使用具有最小权限的RAM用户(仅对目标存储桶拥有
oss:PutObject
+
oss:GetObject
权限)。如果已安装qianwen-ops-auth技能,请查看其
references/custom-oss.md
获取完整设置指南。

Cross-Skill Chaining

跨技能链式调用

When using output from another skill as input (e.g., image-gen → i2v, audio-tts → audio overlay):
  • Pass the URL directly (e.g.,
    "img_url": "<image_url from image-gen>"
    ) — do NOT download and re-pass as local path
  • The script detects URL prefixes (
    https://
    ,
    oss://
    ) and passes them through without re-upload
  • Use
    local_path
    from the response only for user preview or non-API operations
When passing this skill's output to another skill (e.g., vace edit, vision analyze):
  • Pass
    video_url
    from the response
    — do NOT download and re-pass as local path
ScenarioUse
Feed to another skill
video_url
/
image_url
(URL)
Show to user / local playback
local_path
(local file)
当使用其他技能的输出作为输入时(例如,图片生成→i2v,音频TTS→音频叠加):
  • 直接传递URL(例如
    "img_url": "<图片生成技能返回的image_url>"
    )——不要下载后作为本地路径传递
  • 脚本会检测URL前缀(
    https://
    oss://
    )并直接传递,不会重新上传
  • 仅在用户预览或非API操作时使用响应中的
    local_path
当将此技能的输出传递给其他技能时(例如,vace编辑、视觉分析):
  • 传递响应中的
    video_url
    ——不要下载后作为本地路径传递
场景使用内容
传递给其他技能
video_url
/
image_url
(URL)
展示给用户 / 本地播放
local_path
(本地文件)

Important Notes

重要注意事项

  • Async only: All video APIs require
    X-DashScope-Async: enable
    header.
  • kf2v: Uses a different API endpoint. Duration fixed at 5s, silent only.
  • r2v: Use
    character1
    /
    character2
    /... in prompt. Up to 5 references (max 3 videos).
  • vace: Must specify
    function
    . Silent only, output ≤5s.
  • Multi-shot: Set
    shot_type: "multi"
    AND
    prompt_extend: true
    .
  • Video URL expires in 24h — the script auto-downloads to
    --output
    dir. When chaining to another skill (e.g., vace edit), pass
    video_url
    directly — do NOT re-download.
  • For advanced workflows → see workflows.md.
  • 仅异步:所有视频API都需要
    X-DashScope-Async: enable
    请求头。
  • kf2v:使用不同的API端点。时长固定为5秒仅无声
  • r2v:在提示词中使用
    character1
    /
    character2
    /...。最多支持5个参考素材(最多3个视频)。
  • vace:必须指定
    function
    仅无声,输出时长**≤5秒**。
  • 多镜头生成:设置
    shot_type: "multi"
    prompt_extend: true
  • 视频URL有效期为24小时——脚本会自动下载到
    --output
    指定的目录。当链式调用其他技能(例如vace编辑)时,直接传递
    video_url
    ——不要重新下载。
  • 如需高级工作流 → 查看workflows.md

Error Handling

错误处理

ErrorCauseAction
401 Unauthorized
Invalid or missing API keyRun qianwen-ops-auth if available; else prompt user to set key (non-plaintext check only)
current user api does not support synchronous calls
Missing async headerAdd
X-DashScope-Async: enable
429
/
5xx
Rate limit or server errorRetry with backoff
Task
FAILED
Generation failedCheck
output.message
in poll response
错误原因操作
401 Unauthorized
API密钥无效或缺失若qianwen-ops-auth可用则调用该技能;否则提示用户设置密钥(仅非明文检查)
current user api does not support synchronous calls
缺少异步请求头添加
X-DashScope-Async: enable
429
/
5xx
请求频率受限或服务器错误等待后重试,使用退避策略
任务
FAILED
生成失败检查轮询响应中的
output.message

Output Location

输出位置

Prefer the current working directory. Default subdirectory:
./output/qianwen-video-generation/
.
Write prohibition: NEVER write output files into this skill's installation directory or any
skills/
hierarchy. All generated content must go to
output/
under the current working directory or a user-specified path.
优先使用当前工作目录。默认子目录:
./output/qianwen-video-generation/
写入禁止:绝对不要将输出文件写入此技能的安装目录或任何
skills/
层级目录中。所有生成的内容必须保存到当前工作目录下的
output/
或用户指定的路径。

Update Check (MANDATORY Post-Execution)

更新检查(执行后强制操作)

After script execution, check stderr for action signals. The script automatically detects update status and emits structured signals. You MUST act on them. This section also applies when the user explicitly asks to check for updates.
脚本执行后,检查标准错误输出中的操作信号。脚本会自动检测更新状态并发出结构化信号。必须按照信号执行操作。当用户明确要求检查更新时,此部分同样适用。

Signal:
[ACTION_REQUIRED] qianwen-update-check skill is not installed

信号:
[ACTION_REQUIRED] qianwen-update-check skill is not installed

When stderr contains this signal, you MUST present the following options to the user and wait for their response before proceeding. Do NOT silently skip this.
The update-check skill is not installed. It keeps you informed about new QianWen-AI/qianwen-ai features and bug fixes.
  1. Install now — I'll run the install command for you
  2. Skip for now — do nothing this time
  3. Never remind me — permanently suppress this prompt
After the user responds:
  • User chooses 1 → run:
    npx skills add QianWen-AI/qianwen-ai --skill qianwen-update-check -y
    , then run:
    python3 <this-skill-scripts-dir>/gossamer.py --dismiss
  • User chooses 2 → run:
    python3 <this-skill-scripts-dir>/gossamer.py --dismiss
    , then continue normally
  • User chooses 3 → run:
    python3 <this-skill-scripts-dir>/gossamer.py --never-install
    , then continue normally
当标准错误输出包含此信号时,必须向用户提供以下选项,并等待用户响应后再继续。请勿跳过此步骤。
更新检查技能未安装。该技能可帮助您了解QianWen-AI/qianwen-ai的新功能和Bug修复。
  1. 立即安装 — 我将为您运行安装命令
  2. 暂时跳过 — 本次不进行任何操作
  3. 永不提醒 — 永久关闭此提示
用户响应后:
  • 用户选择1 → 运行:
    npx skills add QianWen-AI/qianwen-ai --skill qianwen-update-check -y
    ,然后运行:
    python3 <此技能脚本目录>/gossamer.py --dismiss
  • 用户选择2 → 运行:
    python3 <此技能脚本目录>/gossamer.py --dismiss
    ,然后正常继续
  • 用户选择3 → 运行:
    python3 <此技能脚本目录>/gossamer.py --never-install
    ,然后正常继续

Signal:
[UPDATE_AVAILABLE]

信号:
[UPDATE_AVAILABLE]

When stderr contains this signal, you MUST append a brief update notice to your response, including the version info and the update command shown in the stderr output.
当标准错误输出包含此信号时,必须在响应中添加简短的更新通知,包括标准错误输出中显示的版本信息和更新命令。

No signal in stderr

标准错误输出无信号

If stderr contains neither
[ACTION_REQUIRED]
nor
[UPDATE_AVAILABLE]
, no action is needed — the skill is installed and up to date (or cached within 24h).
如果标准错误输出中既没有
[ACTION_REQUIRED]
也没有
[UPDATE_AVAILABLE]
,则无需操作——技能已安装且为最新版本(或24小时内已缓存)。

Explicit user request

用户明确请求

When the user explicitly asks to check for updates (e.g. "check for updates", "check version"):
  1. Look for
    qianwen-update-check/SKILL.md
    in sibling skill directories.
  2. If found — run:
    python3 <qianwen-update-check-dir>/scripts/check_update.py --print-response
    and report the result.
  3. If not found — present the install options above.
当用户明确要求检查更新时(例如“检查更新”、“查看版本”):
  1. 在同级技能目录中查找
    qianwen-update-check/SKILL.md
  2. 如果找到 — 运行:
    python3 <qianwen-update-check目录>/scripts/check_update.py --print-response
    并报告结果。
  3. 如果未找到 — 提供上述安装选项。

References

参考资料

  • execution-guide.md — Fallback paths (curl for all modes, code generation, autonomous)
  • request-fields.md — Detailed field tables by mode + audio handling
  • workflows.md — Duration extensions, audio workarounds, multi-shot, VACE pipelines
  • polling-guide.md — Polling patterns and timing recommendations
  • merge-media.md — Guide for generating merge/trim/audio-overlay code
  • examples.md — Full script execution examples for all modes
  • sources.md — Official documentation URLs
  • execution-guide.md — 备选方案(所有模式的curl命令、代码生成、自主解决)
  • request-fields.md — 各模式的详细字段表 + 音频处理说明
  • workflows.md — 时长扩展、音频解决方案、多镜头生成、VACE工作流
  • polling-guide.md — 轮询模式和时间建议
  • merge-media.md — 生成合并/裁剪/音频叠加代码的指南
  • examples.md — 所有模式的完整脚本执行示例
  • sources.md — 官方文档URL