qianwen-video-generation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent 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
(e.g.size); i2v/kf2v use"1280*720"(e.g.resolution)."720P"
基于Wan模型生成视频。所有任务均为异步操作——提交任务后,轮询直至完成。
此技能属于QianWen-AI/qianwen-ai生态。
⚠️ 不同模式的关键参数差异:
- kf2v(首尾帧生成):时长固定为5秒——其他值会导致任务失败。输出仅为无声视频。
- 分辨率参数不同:t2v/r2v/vace使用
(例如size);i2v/kf2v使用"1280*720"(例如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.
| Location | Purpose |
|---|---|
| Default execution — mode auto-detect, submit, poll, download |
| Fallback: curl for all 5 modes, code generation |
| Field tables and audio handling by mode |
| Duration extensions, multi-shot, VACE pipelines |
| Polling patterns and timing |
| Concat, trim, audio overlay — ffmpeg/moviepy recipes |
| Per-mode prompt formulas, sound description, multi-shot structure |
| Full script examples per mode |
| Official documentation URLs |
| Agent self-check: register skills in project config for agents that don't auto-load |
使用此技能的内部文件执行任务和学习。当默认路径失效或需要详细信息时,按需加载参考文件。
| 位置 | 用途 |
|---|---|
| 默认执行入口——自动检测模式、提交任务、轮询状态、下载结果 |
| 备选方案:所有5种模式的curl命令、代码生成指南 |
| 各模式的字段表及音频处理说明 |
| 时长扩展、多镜头生成、VACE工作流 |
| 轮询模式和时间建议 |
| 拼接、裁剪、音频叠加——ffmpeg/moviepy实现方案 |
| 各模式的提示词公式、声音描述、多镜头结构 |
| 所有模式的完整脚本示例 |
| 官方文档URL |
| Agent自检:对于不会自动加载技能的Agent,需在项目配置中注册技能 |
Security
安全规范
NEVER output any API key or credential in plaintext. Always use variable references ( in shell, 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 or config files that may contain secrets.
$DASHSCOPE_API_KEYos.environ["DASHSCOPE_API_KEY"].envWhen the API key is not configured, NEVER ask the user to provide it directly. Instead, help create a file with a placeholder () 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.
.envDASHSCOPE_API_KEY=sk-your-key-here绝对不要以明文形式输出任何API密钥或凭证。始终使用变量引用(Shell中使用,Python中使用)。任何凭证检查或检测必须采用非明文方式:仅报告状态(例如“已设置”/“未设置”、“有效”/“无效”),绝不显示密钥值。绝不要显示或可能包含机密信息的配置文件内容。
$DASHSCOPE_API_KEYos.environ["DASHSCOPE_API_KEY"].env当API密钥未配置时,绝不要直接要求用户提供密钥。相反,帮助用户创建带有占位符的文件(),并指导用户从QianWen控制台获取实际密钥后替换占位符。仅当用户明确要求时,才写入实际密钥值。
.envDASHSCOPE_API_KEY=sk-your-key-hereKey Compatibility
密钥兼容性
Scripts require a standard QianWen API key (). Token Plan 团队版 keys () target a different endpoint () and do not include video models. Standard key required for video. Video generation incurs per-second charges on standard keys. The script detects keys at startup and prints a warning. If qianwen-ops-auth is installed, see its for full details.
sk-...sk-sp-...token-plan.cn-beijing.maas.aliyuncs.comsk-sk-sp-references/tokenplan.md脚本需要标准QianWen API密钥(格式为)。Token Plan团队版密钥(格式为)指向不同的端点(),且不包含视频模型。视频生成必须使用标准格式密钥。标准密钥生成视频会按秒计费。脚本启动时会检测格式密钥并打印警告。如果已安装qianwen-ops-auth技能,请查看其获取详细信息。
sk-...sk-sp-...token-plan.cn-beijing.maas.aliyuncs.comsk-sk-sp-references/tokenplan.mdMode Selection Guide
模式选择指南
| User Want | Mode | Key Field |
|---|---|---|
| Generate video from text description only | t2v | |
| Animate a single image | i2v | |
| wan2.7 unified i2v: first frame, first+last frame, video continuation, audio sync | i2v | |
| Transition between two images (⚠️ 5s fixed, silent only) | kf2v | |
| Role-play: make characters act a new script | r2v | |
| Video editing: multi-image ref, repainting, local edit, extend, outpaint | vace | |
Video editing (no | videoedit | model = |
| 用户需求 | 模式 | 关键字段 |
|---|---|---|
| 仅通过文本描述生成视频 | t2v | 仅需 |
| 将单张图片动起来 | i2v | |
| wan2.7统一i2v:首帧、首尾帧、视频续播、音频同步 | i2v | |
| 在两张图片之间生成过渡视频(⚠️ 固定5秒,仅无声) | kf2v | |
| 角色扮演:让角色按照新脚本表演 | r2v | |
| 视频编辑:多图参考、重绘、局部编辑、扩展、外绘 | vace | |
视频编辑(无 | videoedit | model = |
Model Selection
模型选择
- User specified a model → use directly.
- Consult the qianwen-model-selector skill when model choice depends on capability, scenario, or pricing.
- No signal, clear task → defaults: t2v → , i2v →
wan2.6-t2v, kf2v →wan2.6-i2v-flash, r2v →wan2.2-kf2v-flash, vace →wan2.6-r2v-flash, videoedit →wan2.1-vace-plus. For wan2.7 features, explicitly setwan2.7-videoedit/--model wan2.7-t2v/--model wan2.7-i2v. For HappyHorse series (alternative T2V/I2V/R2V/video-edit), set--model wan2.7-videoedit.--model happyhorse-1.0-{t2v,i2v,r2v,video-edit}
- 用户指定模型 → 直接使用该模型。
- 当模型选择取决于能力、场景或定价时 → 调用qianwen-model-selector技能。
- 无指定信号但任务明确 → 默认模型:t2v → ,i2v →
wan2.6-t2v,kf2v →wan2.6-i2v-flash,r2v →wan2.2-kf2v-flash,vace →wan2.6-r2v-flash,videoedit →wan2.1-vace-plus。如需使用wan2.7特性,需显式设置wan2.7-videoedit/--model wan2.7-t2v/--model wan2.7-i2v。如需使用HappyHorse系列(替代T2V/I2V/R2V/video-edit),设置--model wan2.7-videoedit。--model happyhorse-1.0-{t2v,i2v,r2v,video-edit}
Models
模型列表
t2v (Text-to-Video)
t2v(文本转视频)
| Model | Features |
|---|---|
| Ratio control, auto-dubbing, 5000 char prompt, 720P/1080P. Use |
| Audio, multi-shot, 2–15s, 720P/1080P. Use |
| Audio, 5s/10s, 480P/720P/1080P |
| Silent, 5s, 480P/1080P |
| 模型 | 特性 |
|---|---|
| 比例控制、自动配音、支持5000字符提示词、720P/1080P分辨率。使用 |
| 带音频、多镜头、时长2–15秒、720P/1080P分辨率。使用 |
| 带音频、时长5秒/10秒、480P/720P/1080P分辨率 |
| 无声、时长5秒、480P/1080P分辨率 |
i2v (Image-to-Video)
i2v(图片转视频)
| Model | Features |
|---|---|
| Unified protocol: first frame, first+last frame, video continuation, audio sync. Uses |
| Audio/silent, multi-shot, 2–15s, 720P/1080P. Uses |
| Audio, multi-shot, 2–15s, 720P/1080P |
| Audio, 5s/10s, 480P/720P/1080P |
| 模型 | 特性 |
|---|---|
| 统一协议:首帧、首尾帧、视频续播、音频同步。使用 |
| 可带音频/无声、多镜头、时长2–15秒、720P/1080P分辨率。使用 |
| 带音频、多镜头、时长2–15秒、720P/1080P分辨率 |
| 带音频、时长5秒/10秒、480P/720P/1080P分辨率 |
kf2v / r2v / vace
kf2v / r2v / vace
| Model | Features |
|---|---|
| Silent, 5s, 480P/720P/1080P |
| Audio, single/multi character, 2–10s, 720P/1080P |
| Audio/silent, multi-character, 2–10s, 720P/1080P |
| Multi-image ref, repainting, local edit, ≤5s, 720P |
| 模型 | 特性 |
|---|---|
| 无声、时长5秒、480P/720P/1080P分辨率 |
| 带音频、单/多角色、时长2–10秒、720P/1080P分辨率 |
| 可带音频/无声、多角色、时长2–10秒、720P/1080P分辨率 |
| 多图参考、重绘、局部编辑、时长≤5秒、720P分辨率 |
videoedit (Video Editing)
videoedit(视频编辑)
Prompt-driven video editing with optional reference images. No field; uses
. Default model: .
functioninput.media = [1 video] + [refs]wan2.7-videoedit| Model | Refs cap | Notes |
|---|---|---|
| ≤4 | Local/global prompt-driven edit; supports |
| ≤5 | Element replacement via reference images; preserves original dynamics. 720P 0.14/s · 1080P 0.24/s |
基于提示词的视频编辑,支持可选参考图片。无字段;使用。默认模型:。
functioninput.media = [1个视频] + [参考素材]wan2.7-videoedit| 模型 | 参考素材上限 | 说明 |
|---|---|---|
| ≤4 | 局部/全局提示词驱动编辑;支持 |
| ≤5 | 通过参考图片替换元素;保留原视频动态效果。720P 0.14元/秒 · 1080P 0.24元/秒 |
HappyHorse Series
HappyHorse系列
| Model | Mode | Payload differences vs wan2.6 |
|---|---|---|
| t2v | Uses |
| i2v | Uses |
| r2v | Uses |
| videoedit | Uses |
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:(replacehttps://www.qianwenai.com/models/<model-name>with the exact model ID, e.g.<model-name>→ https://www.qianwenai.com/models/wan2.7-t2v). NEVER modify or guess the model name in the URL.wan2.7-t2v
Dynamic model queries: If the qianwen-model-selector skill or QianWen CLI () is available, use it for real-time model data. CLI requires authentication — see the qianwen-usage skill for login flow.qianwen models info <model>
| 模型 | 模式 | 与wan2.6的请求体差异 |
|---|---|---|
| t2v | 使用 |
| i2v | 使用 |
| r2v | 使用 |
| videoedit | 使用 |
定价:720P 0.14元/秒 · 1080P 0.24元/秒。端点:。
/services/aigc/video-generation/video-synthesis⚠️ 重要提示:以上模型列表为当前时间点的快照,可能已过时。模型可用性会频繁变化。在选择模型前,请务必查看官方模型列表获取权威、最新的目录信息。
模型详情:如需了解特定模型的更多信息,请引导用户访问其详情页面:(将https://www.qianwenai.com/models/<model-name>替换为准确的模型ID,例如<model-name>→ https://www.qianwenai.com/models/wan2.7-t2v)。绝不要修改或猜测URL中的模型名称。wan2.7-t2v
动态模型查询:如果qianwen-model-selector技能或QianWen CLI()可用,请使用它们获取实时模型数据。CLI需要身份验证——请查看qianwen-usage技能了解登录流程。qianwen models info <model>
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) to prevent overwrites.out_2.mp4
⚠️ 多文件生成:当在单个会话中生成多个文件时,必须为每个文件名添加数字后缀(例如、out_1.mp4),以防止文件被覆盖。out_2.mp4
Prerequisites
前置条件
- API Key: Check that (or
DASHSCOPE_API_KEY) is set using a non-plaintext check only (e.g. in shell:QIANWEN_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[ -n "$DASHSCOPE_API_KEY" ]file (.envin project root or current directory) or environment variable. The script searches forecho 'DASHSCOPE_API_KEY=sk-your-key-here' >> .envin the current working directory and the project root. Skills may be installed independently — do not assume qianwen-ops-auth is present..env - 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)是否已设置(例如在Shell中:QIANWEN_API_KEY;仅报告“已设置”或“未设置”,绝不显示密钥值)。如果未设置:若qianwen-ops-auth技能可用则调用该技能;否则引导用户从QianWen控制台获取密钥,并通过[ -n "$DASHSCOPE_API_KEY" ]文件(在项目根目录或当前目录执行.env)或环境变量设置密钥。脚本会在当前工作目录和项目根目录中查找echo 'DASHSCOPE_API_KEY=sk-your-key-here' >> .env文件。技能可能独立安装——请勿假设qianwen-ops-auth已存在。.env - 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 is not found, try or . If Python is unavailable or below 3.9, skip to Path 2 (curl) in execution-guide.md.
python3python --versionpy -3 --version首次执行前,验证Python是否可用:
bash
python3 --version # 必须为3.9+如果找不到,尝试或。如果Python不可用或版本低于3.9,请直接使用execution-guide.md中的方案2(curl)。
python3python --versionpy -3 --versionDefault: Run Script
默认方式:运行脚本
Script path: Scripts are in the 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 to switch directories before execution.
scripts/cdExecution note: Run all scripts in the foreground — wait for stdout; do not background.
Discovery: Run first to see all available arguments.
python3 <this-skill-dir>/scripts/video.py --helpbash
python3 <this-skill-dir>/scripts/video.py \
--request '{"prompt":"A detective in a rainy city at night","size":"1280*720","duration":5}' \
--print-response| Argument | Description |
|---|---|
| JSON request body |
| Load request from file |
| Override auto-detected mode (t2v/i2v/kf2v/r2v/vace) |
| Override model |
| Save video and response JSON |
| Print response JSON to stdout |
| Submit and exit (print task_id) |
| Operate on existing task |
| Seconds between polls (default: 15) |
| Max wait seconds (default: 600) |
脚本路径:脚本位于此技能目录的子目录中(即包含此SKILL.md的目录)。必须先定位此技能的安装目录,然后始终使用完整绝对路径执行脚本。请勿假设脚本位于当前工作目录。执行前请勿使用切换目录。
scripts/cd执行注意事项:所有脚本均需在前台运行——等待标准输出,不要后台运行。
查看帮助:先运行查看所有可用参数。
python3 <此技能目录>/scripts/video.py --helpbash
python3 <此技能目录>/scripts/video.py \
--request '{"prompt":"雨夜城市中的侦探","size":"1280*720","duration":5}' \
--print-response| 参数 | 描述 |
|---|---|
| JSON格式的请求体 |
| 从文件加载请求体 |
| 覆盖自动检测的模式(t2v/i2v/kf2v/r2v/vace) |
| 覆盖默认模型 |
| 保存视频和响应JSON |
| 将响应JSON打印到标准输出 |
| 提交任务后退出(打印task_id) |
| 对已有任务进行操作 |
| 轮询间隔秒数(默认:15) |
| 最大等待秒数(默认:600) |
Verify Result
结果验证
- Exit code + response has
0→ submission successoutput.task_id - Poll reaches → generation complete
task_status: SUCCEEDED - Non-zero exit, HTTP error, or status → fail
FAILED - 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 or
[ACTION_REQUIRED]. If either signal is present, you MUST follow the instructions in Update Check below before responding to the user.[UPDATE_AVAILABLE]
- 退出码+ 响应包含
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 Pattern | Diagnosis | Resolution |
|---|---|---|
| Python not on PATH | Try |
| Script version check failed | Upgrade Python to 3.9+ |
| Python < 3.9 | Upgrade Python to 3.9+ |
| Missing API key | Obtain key from QianWen Console; add to |
| Invalid or mismatched key | Run qianwen-ops-auth (non-plaintext check only); verify key is valid |
| SSL cert issue (proxy/corporate) | macOS: run |
| Network unreachable | Check internet; set |
| Rate limited | Wait and retry with backoff |
| Server error | Retry with backoff |
| moviepy not installed | |
| Can't write output | Use |
如果脚本执行失败,请将错误输出与下面的诊断表匹配以确定解决方案。如果无匹配项,请查看execution-guide.md中的备选方案:curl命令(方案2——所有5种模式)、代码生成(方案3)和自主解决(方案5)。
如果完全没有Python环境 → 直接使用execution-guide.md中的方案2(curl)。
| 错误模式 | 诊断 | 解决方案 |
|---|---|---|
| Python不在PATH中 | 尝试 |
| 脚本版本检查失败 | 将Python升级到3.9+ |
| Python版本低于3.9 | 将Python升级到3.9+ |
| 缺少API密钥 | 从QianWen控制台获取密钥;添加到 |
| 密钥无效或不匹配 | 调用qianwen-ops-auth(仅非明文检查);验证密钥有效性 |
| SSL证书问题(代理/企业环境) | macOS:运行 |
| 网络不可达 | 检查网络;若处于代理环境则设置 |
| 请求频率受限 | 等待后重试,使用退避策略 |
| 服务器错误 | 等待后重试,使用退避策略 |
| moviepy未安装 | |
| 无法写入输出 | 使用 |
Request Fields Summary
请求字段汇总
All modes require . See request-fields.md for full field tables per mode.
prompt所有模式均需字段。请查看request-fields.md获取各模式的完整字段表。
prompt⚠️ Resolution Parameter by Mode (Critical)
⚠️ 各模式的分辨率参数(关键)
| Mode | Parameter | Format | Example |
|---|---|---|---|
| t2v | | | |
| r2v | | | |
| vace | | | |
| i2v | | | |
| kf2v | | | |
Using the wrong parameter name will cause the API call to fail.
| 模式 | 参数 | 格式 | 示例 |
|---|---|---|---|
| t2v | | | |
| r2v | | | |
| vace | | | |
| i2v | | | |
| kf2v | | | |
使用错误的参数名称会导致API调用失败。
Mode-Specific Required Fields
各模式的必填字段
- i2v needs /
img_url. kf2v needsreference_image+first_frame_url. r2v needslast_frame_url. vace needsreference_urls.function
- i2v需要/
img_url。kf2v需要reference_image+first_frame_url。r2v需要last_frame_url。vace需要reference_urls。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.
| Model | 720P (USD) | 1080P (USD) |
|---|---|---|
| wan2.7-t2v | per-second billing | per-second billing |
| wan2.7-i2v | per-second billing | per-second billing |
| wan2.6-t2v | per-second billing | per-second billing |
| wan2.6-i2v-flash | per-second billing | per-second billing |
| wan2.6-r2v-flash | per-second billing | per-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.
🚨 绝对不要猜测或编造任何价格数据。始终引导用户查看 官方定价页面获取准确费率。
成本按生成视频的秒数计费。价格因模型和分辨率而异。最新费率请查看官方定价页面。
| 模型 | 720P | 1080P |
|---|---|---|
| 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控制台中验证。
绝对不要编造、猜测或构建使用/账单/控制台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 ( URL, 48h TTL) and injects the header. No manual upload step is needed.
oss://X-DashScope-OssResourceResolve: enableProduction: 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, setandQWEN_TMP_OSS_BUCKETinQWEN_TMP_OSS_REGION, install.env, and provide credentials viapip install oss2/QWEN_TMP_OSS_AK_IDor the standardQWEN_TMP_OSS_AK_SECRET/OSS_ACCESS_KEY_ID. Use a RAM user with least-privilege (OSS_ACCESS_KEY_SECRET+oss:PutObjecton target bucket only). If qianwen-ops-auth is installed, see itsoss:GetObjectfor the full setup guide.references/custom-oss.md
当用户提供本地文件路径(图片、视频、音频)时,直接将其传递给脚本。脚本会自动上传本地文件到DashScope临时存储(格式URL,有效期48小时),并注入请求头。无需手动上传步骤。
oss://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提供凭证。使用具有最小权限的RAM用户(仅对目标存储桶拥有OSS_ACCESS_KEY_SECRET+oss:PutObject权限)。如果已安装qianwen-ops-auth技能,请查看其oss:GetObject获取完整设置指南。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., ) — do NOT download and re-pass as local path
"img_url": "<image_url from image-gen>" - The script detects URL prefixes (,
https://) and passes them through without re-uploadoss:// - Use from the response only for user preview or non-API operations
local_path
When passing this skill's output to another skill (e.g., vace edit, vision analyze):
- Pass from the response — do NOT download and re-pass as local path
video_url
| Scenario | Use |
|---|---|
| Feed to another skill | |
| Show to user / local playback | |
当使用其他技能的输出作为输入时(例如,图片生成→i2v,音频TTS→音频叠加):
- 直接传递URL(例如)——不要下载后作为本地路径传递
"img_url": "<图片生成技能返回的image_url>" - 脚本会检测URL前缀(、
https://)并直接传递,不会重新上传oss:// - 仅在用户预览或非API操作时使用响应中的
local_path
当将此技能的输出传递给其他技能时(例如,vace编辑、视觉分析):
- 传递响应中的——不要下载后作为本地路径传递
video_url
| 场景 | 使用内容 |
|---|---|
| 传递给其他技能 | |
| 展示给用户 / 本地播放 | |
Important Notes
重要注意事项
- Async only: All video APIs require header.
X-DashScope-Async: enable - kf2v: Uses a different API endpoint. Duration fixed at 5s, silent only.
- r2v: Use /
character1/... in prompt. Up to 5 references (max 3 videos).character2 - vace: Must specify . Silent only, output ≤5s.
function - Multi-shot: Set AND
shot_type: "multi".prompt_extend: true - Video URL expires in 24h — the script auto-downloads to dir. When chaining to another skill (e.g., vace edit), pass
--outputdirectly — do NOT re-download.video_url - For advanced workflows → see workflows.md.
- 仅异步:所有视频API都需要请求头。
X-DashScope-Async: enable - kf2v:使用不同的API端点。时长固定为5秒,仅无声。
- r2v:在提示词中使用/
character1/...。最多支持5个参考素材(最多3个视频)。character2 - vace:必须指定。仅无声,输出时长**≤5秒**。
function - 多镜头生成:设置且
shot_type: "multi"。prompt_extend: true - 视频URL有效期为24小时——脚本会自动下载到指定的目录。当链式调用其他技能(例如vace编辑)时,直接传递
--output——不要重新下载。video_url - 如需高级工作流 → 查看workflows.md。
Error Handling
错误处理
| Error | Cause | Action |
|---|---|---|
| Invalid or missing API key | Run qianwen-ops-auth if available; else prompt user to set key (non-plaintext check only) |
| Missing async header | Add |
| Rate limit or server error | Retry with backoff |
Task | Generation failed | Check |
| 错误 | 原因 | 操作 |
|---|---|---|
| API密钥无效或缺失 | 若qianwen-ops-auth可用则调用该技能;否则提示用户设置密钥(仅非明文检查) |
| 缺少异步请求头 | 添加 |
| 请求频率受限或服务器错误 | 等待后重试,使用退避策略 |
任务 | 生成失败 | 检查轮询响应中的 |
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 hierarchy. All generated content must go to under the current working directory or a user-specified path.
skills/output/优先使用当前工作目录。默认子目录:。
./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信号:[ACTION_REQUIRED] qianwen-update-check skill is not installed
[ACTION_REQUIRED] qianwen-update-check skill is not installedWhen 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.
- Install now — I'll run the install command for you
- Skip for now — do nothing this time
- Never remind me — permanently suppress this prompt
After the user responds:
- User chooses 1 → run: , then run:
npx skills add QianWen-AI/qianwen-ai --skill qianwen-update-check -ypython3 <this-skill-scripts-dir>/gossamer.py --dismiss - User chooses 2 → run: , then continue normally
python3 <this-skill-scripts-dir>/gossamer.py --dismiss - User chooses 3 → run: , then continue normally
python3 <this-skill-scripts-dir>/gossamer.py --never-install
当标准错误输出包含此信号时,必须向用户提供以下选项,并等待用户响应后再继续。请勿跳过此步骤。
更新检查技能未安装。该技能可帮助您了解QianWen-AI/qianwen-ai的新功能和Bug修复。
- 立即安装 — 我将为您运行安装命令
- 暂时跳过 — 本次不进行任何操作
- 永不提醒 — 永久关闭此提示
用户响应后:
- 用户选择1 → 运行:,然后运行:
npx skills add QianWen-AI/qianwen-ai --skill qianwen-update-check -ypython3 <此技能脚本目录>/gossamer.py --dismiss - 用户选择2 → 运行:,然后正常继续
python3 <此技能脚本目录>/gossamer.py --dismiss - 用户选择3 → 运行:,然后正常继续
python3 <此技能脚本目录>/gossamer.py --never-install
Signal: [UPDATE_AVAILABLE]
[UPDATE_AVAILABLE]信号:[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 nor , no action is needed — the skill is installed and up to date (or cached within 24h).
[ACTION_REQUIRED][UPDATE_AVAILABLE]如果标准错误输出中既没有也没有,则无需操作——技能已安装且为最新版本(或24小时内已缓存)。
[ACTION_REQUIRED][UPDATE_AVAILABLE]Explicit user request
用户明确请求
When the user explicitly asks to check for updates (e.g. "check for updates", "check version"):
- Look for in sibling skill directories.
qianwen-update-check/SKILL.md - If found — run: and report the result.
python3 <qianwen-update-check-dir>/scripts/check_update.py --print-response - If not found — present the install options above.
当用户明确要求检查更新时(例如“检查更新”、“查看版本”):
- 在同级技能目录中查找。
qianwen-update-check/SKILL.md - 如果找到 — 运行:并报告结果。
python3 <qianwen-update-check目录>/scripts/check_update.py --print-response - 如果未找到 — 提供上述安装选项。
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