特色栏目

ASP源码

PHP源码

.NET源码

JSP源码

游戏频道
专题合集
关闭菜单
首页> AI教程> Qwen Video:基于阿里云 DashScope 的 AI 文本生成视频 - Openclaw Skills

Qwen Video:基于阿里云 DashScope 的 AI 文本生成视频 - Openclaw Skills

时间:2026-03-27 20:36:01 作者:互联网

什么是 Qwen / Wan Video (DashScope)?

Qwen / Wan Video 技能为阿里云 DashScope Wan(通义万相)文本生成视频 API 提供了一个强大的接口,专为 AI 智能体处理异步视频生成而设计。该技能简化了提交任务、轮询完成状态以及管理本地文件存储的复杂过程。通过使用 Openclaw Skills 的这一扩展,开发者可以将 wan2.6 等先进的视频合成模型集成到他们的自动化工作流中,从而能够根据简单的文本描述创建高清电影级内容。

该技能在构建时充分考虑了开发者的便利性,包括对 WSL2 等环境的优化支持,允许将生成的 MP4 文件直接保存到 Windows 桌面。该技能弥合了远程云端 AI 生成与本地资产管理之间的鸿沟,使其成为任何自动化媒体生产流水线中的重要组件。

下载入口:https://github.com/openclaw/skills/tree/main/skills/547895019/qwen-video

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install qwen-video

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 qwen-video。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Qwen / Wan Video (DashScope) 应用场景

Qwen / Wan Video (DashScope) 工作原理
  1. 智能体使用特定的文本提示、分辨率和持续时间参数触发生成脚本。
  2. 该技能向 DashScope 视频合成端点发送异步请求,并返回唯一的任务 ID。
  3. 专用轮询机制定期检查任务状态,直到生成达到 SUCCEEDED(成功)状态。
  4. 视频准备就绪后,该技能会自动获取远程 URL 并将 MP4 文件下载到指定的本地目录。

Qwen / Wan Video (DashScope) 配置指南

要使用此技能,请确保您已准备好阿里云凭据。在终端环境中设置您的 API 密钥:

export DASHSCOPE_API_KEY="sk-..."

然后,您可以使用提供的脚本通过一个步骤生成视频:

bash {baseDir}/scripts/generate.sh r
  --prompt "未来城市夜晚的电影视角" r
  --duration 4 r
  --size 1280*720 r
  --out "/path/to/destination.mp4"

Qwen / Wan Video (DashScope) 数据架构与分类体系

该技能高效地管理任务元数据和媒体文件。它在视频生成请求的生命周期中专门跟踪并输出以下字段:

数据点 描述
TASK_ID DashScope 为异步作业提供的唯一标识符。
VIDEO_URL 生成的 MP4 的临时远程云存储 URL。
MEDIA 文件下载到的绝对本地路径。
MODEL 使用的特定 Wan 模型变体(例如 wan2.6-t2v)。
name: qwen-video
description: Generate videos using Alibaba Cloud DashScope Wan (通义万相) text-to-video (t2v) API (e.g., wan2.6-t2v). Use when the user asks to create a short video from a text prompt via 百炼/通义万相/wan 文生视频, and wants the agent to submit an async task, poll status, and download the mp4 locally (e.g., to Windows Desktop from WSL2).

Qwen / Wan Video (DashScope) — 文生视频

This skill provides simple CLI scripts to:

  1. submit an async Wan t2v job
  2. poll task status until SUCCEEDED/FAILED
  3. download the resulting mp4

Requirements

export DASHSCOPE_API_KEY="sk-..."

Quick start (one command)

Generate a video and download to Windows Desktop (WSL2):

bash {baseDir}/scripts/generate.sh r
  --prompt "4秒赛博朋克雨夜城市镜头,霓虹反射,电影感镜头运动,高清" r
  --duration 4 r
  --size 1280*720 r
  --out "/mnt/c/Users//Desktop/wan_video.mp4"

Submit only (returns task_id)

bash {baseDir}/scripts/submit.sh --prompt "..." --duration 4 --size 1280*720

Poll status only

bash {baseDir}/scripts/poll.sh --task-id ""

高级功能

多镜头叙事 (Multi-shot)

仅 wan2.6 系列模型支持此功能。通过设置 prompt_extend: trueshot_type: "multi" 启用。

curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' r
  -H 'X-DashScope-Async: enable' r
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" r
  -H 'Content-Type: application/json' r
  -d '{
    "model": "wan2.6-t2v",
    "input": {
      "prompt": "史诗级战斗场景..."
    },
    "parameters": {
      "size": "1280*720",
      "prompt_extend": true,
      "duration": 10,
      "shot_type": "multi"
    }
  }'

自动配音 (Auto Audio)

仅 wan2.6 和 wan2.5 系列模型支持。若不提供 input.audio_url,模型将根据视频内容自动生成匹配的背景音乐或音效。

curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' r
  -H 'X-DashScope-Async: enable' r
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" r
  -H 'Content-Type: application/json' r
  -d '{
    "model": "wan2.5-t2v-preview",
    "input": {
      "prompt": "史诗级战斗场景..."
    },
    "parameters": {
      "size": "832*480",
      "prompt_extend": true,
      "duration": 10
    }
  }'

传入音频文件 (Custom Audio)

仅 wan2.6 和 wan2.5 系列模型支持。通过 input.audio_url 参数传入自定义音频的 URL。

curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' r
  -H 'X-DashScope-Async: enable' r
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" r
  -H 'Content-Type: application/json' r
  -d '{
    "model": "wan2.5-t2v-preview",
    "input": {
      "prompt": "史诗级战斗场景...",
      "audio_url": "https://example.com/audio.mp3"
    },
    "parameters": {
      "size": "832*480",
      "prompt_extend": true,
      "duration": 10
    }
  }'

生成无声视频 (Silent Video)

仅 wan2.2 和 wanx2.1 系列模型支持生成无声视频。默认生成无声视频,无需设置。

wan2.6 及 wan2.5 系列模型默认生成有声视频。

curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' r
  -H 'X-DashScope-Async: enable' r
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" r
  -H 'Content-Type: application/json' r
  -d '{
    "model": "wan2.2-t2v-plus",
    "input": {
      "prompt": "低对比度,复古70年代风格地铁站..."
    },
    "parameters": {
      "size": "832*480",
      "prompt_extend": true
    }
  }'

使用反向提示词 (Negative Prompt)

通过 negative_prompt 排除不需要的元素。

curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' r
  -H 'X-DashScope-Async: enable' r
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" r
  -H 'Content-Type: application/json' r
  -d '{
    "model": "wan2.2-t2v-plus",
    "input": {
      "prompt": "一只小猫在月光下奔跑",
      "negative_prompt": "花朵"
    },
    "parameters": {
      "size": "832*480"
    }
  }'

API Endpoint (current)

Scripts print:

模型功能对照表

模型 多镜头叙事 自动配音 自定义音频 无声视频 反向提示词
wan2.6-t2v ? ? ? - ?
wan2.5-t2v-preview - ? ? - ?
wan2.2-t2v-plus - - - ? ?
wanx2.1 - - - ? -
相关文章

热门文章

猜你喜欢

返回顶部