$npx -y skills add QwenCloud/qwencloud-ai --skill qwencloud-video-generation[QwenCloud] Generate videos using Wan models. Supports text-to-video, image-to-video, first+last frame, reference-based role-play, and video editing (VACE). TRIGGER when: user wants to create, generate, or edit video content, mentions video generation/animation/video clips/Wan mo
| 1 | > **Agent setup**: If your agent doesn't auto-load skills (e.g. Claude Code), |
| 2 | > see [agent-compatibility.md](references/agent-compatibility.md) once per session. |
| 3 | |
| 4 | # Qwen Video Generation |
| 5 | |
| 6 | Generate videos using Wan models. All tasks are **asynchronous** — submit, then poll until |
| 7 | completion. |
| 8 | This skill is part of **qwencloud/qwencloud-ai**. |
| 9 | |
| 10 | > **⚠️ Critical Parameter Differences by Mode:** |
| 11 | > - **kf2v (First+Last Frame)**: Duration is **fixed at 5 seconds** — other values will fail. Output is **silent only**. |
| 12 | > - **Resolution parameter varies**: t2v/r2v/vace use `size` (e.g. `"1280*720"`); i2v/kf2v use `resolution` (e.g. `"720P"`). |
| 13 | |
| 14 | ## Skill directory |
| 15 | |
| 16 | Use this skill's internal files to execute and learn. Load reference files on demand when the default path fails or you need details. |
| 17 | |
| 18 | | Location | Purpose | |
| 19 | |----------|---------| |
| 20 | | `scripts/video.py` | Default execution — mode auto-detect, submit, poll, download | |
| 21 | | `references/execution-guide.md` | Fallback: curl for all 5 modes, code generation | |
| 22 | | `references/request-fields.md` | Field tables and audio handling by mode | |
| 23 | | `references/workflows.md` | Duration extensions, multi-shot, VACE pipelines | |
| 24 | | `references/polling-guide.md` | Polling patterns and timing | |
| 25 | | `references/merge-media.md` | Concat, trim, audio overlay — ffmpeg/moviepy recipes | |
| 26 | | `references/prompt-guide.md` | Per-mode prompt formulas, sound description, multi-shot structure | |
| 27 | | `references/examples.md` | Full script examples per mode | |
| 28 | | `references/sources.md` | Official documentation URLs | |
| 29 | | `references/agent-compatibility.md` | Agent self-check: register skills in project config for agents that don't auto-load | |
| 30 | |
| 31 | ## Security |
| 32 | |
| 33 | **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. |
| 34 | |
| 35 | **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 [QwenCloud Console](https://home.qwencloud.com/api-keys). Only write the actual key value if the user explicitly requests it. |
| 36 | |
| 37 | ## Key Compatibility |
| 38 | |
| 39 | Scripts require a **standard QwenCloud API key** (`sk-...`). Coding Plan keys (`sk-sp-...`) cannot be used — video generation models are not available on Coding Plan, and Coding Plan does not support the native QwenCloud API. Video generation incurs per-second charges on standard keys. The script detects `sk-sp-` keys at startup and prints a warning. If qwencloud-ops-auth is installed, see its `references/codingplan.md` for full details. |
| 40 | |
| 41 | ## Mode Selection Guide |
| 42 | |
| 43 | | User Want | Mode | Key Field | |
| 44 | |-----------|------|-----------| |
| 45 | | Generate video from text description only | **t2v** | `prompt` only | |
| 46 | | Animate a single image | **i2v** | `img_url` or `reference_image` | |
| 47 | | wan2.7 unified i2v: first frame, first+last frame, video continuation, audio sync | **i2v** | `media[]`, `first_frame_url`, `first_clip_url`, `driving_audio_url` | |
| 48 | | Transition between two images (**⚠️ 5s fixed, silent only**) | **kf2v** | `first_frame_url` + `last_frame_url` | |
| 49 | | Role-play: make characters act a new script | **r2v** | `reference_urls` (up to 5) | |
| 50 | | Video editing: multi-image ref, repainting, local edit, extend, outpaint | **vace** | `function` | |
| 51 | |
| 52 | ### Model Selection |
| 53 | |
| 54 | 1. **User specified a model** → use directly. |
| 55 | 2. **Consult the qwencloud-model-selector skill** when model choice depends on capability, scenario, or pricing. |
| 56 | 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`. For wan2.7 features, explicitly set `--model wan2.7-t2v` or `--model wan2.7-i2v`. |
| 57 | |
| 58 | ## Models |
| 59 | |
| 60 | ### t2v (Text-to-Video) |
| 61 | |
| 62 | | Model | Features | |
| 63 | |-------|----------| |
| 64 | | `wan2.7-t2v` | Ratio control, auto-dubbing, 5000 char prompt, 720P/1080P. Use `resolution` + `ratio` params. | |
| 65 | | `wan2.6-t2v` **default** | Audio, multi-shot, 2–15s, 720P/ |