返回顶部
a

aliyun-wan-video阿里云万相视频

Use when generating videos with Model Studio DashScope SDK using Wan video generation models (wan2.6-t2v, wan2.6-i2v-flash, wan2.6-i2v and regional variants). Use when implementing or documenting video.generate requests/responses, mapping prompt/negative_prompt/duration/fps/size/seed/reference_image/motion_strength, or integrating video generation into the video-agent pipeline.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
112
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

aliyun-wan-video

技能名称: aliyun-wan-video

分类: 提供者

Model Studio Wan Video

验证

bash
mkdir -p output/aliyun-wan-video
python -m pycompile skills/ai/video/aliyun-wan-video/scripts/generatevideo.py && echo pycompileok > output/aliyun-wan-video/validate.txt

通过标准:命令退出码为0,且生成 output/aliyun-wan-video/validate.txt 文件。

输出与证据

  • - 将任务ID、轮询响应和最终视频URL保存到 output/aliyun-wan-video/ 目录。
  • 保留一次完整的端到端运行日志,以便故障排查。

通过标准化 video.generate 的输入/输出,并使用 DashScope SDK(Python)及精确的模型名称,为视频代理管道提供一致的视频生成行为。

关键模型名称

使用以下精确的模型字符串之一:

  • - wan2.6-t2v
  • wan2.6-t2v-us
  • wan2.2-t2v-plus
  • wan2.2-t2v-flash
  • wan2.6-i2v-flash
  • wan2.6-i2v
  • wan2.6-i2v-us
  • wanx2.1-t2v-turbo

前置条件

  • - 安装SDK(建议在虚拟环境中安装,以避免PEP 668限制):

bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope

  • - 在环境中设置 DASHSCOPEAPIKEY,或将 dashscopeapikey 添加到 ~/.alibabacloud/credentials 文件中(环境变量优先级更高)。

标准化接口 (video.generate)

请求

  • - prompt(字符串,必填)
  • negativeprompt(字符串,可选)
  • duration(数字,必填)秒
  • fps(数字,必填)
  • size(字符串,必填)例如 1280*720
  • seed(整数,可选)
  • referenceimage(字符串 | 字节,t2v模型可选,i2v系列模型必填)
  • motion_strength(数字,可选)

响应

  • - video_url(字符串)
  • duration(数字)
  • fps(数字)
  • seed(整数)

快速入门 (Python + DashScope SDK)

视频生成通常是异步的。获取任务ID后轮询直至完成。
注意:Wan i2v模型需要输入图像;纯t2v模型(如 wan2.6-t2v)可以省略 reference_image。

python
import os
from dashscope import VideoSynthesis

优先使用环境变量进行身份验证:export DASHSCOPEAPIKEY=...

或者使用 ~/.alibabacloud/credentials 文件,在 [default] 下添加 dashscopeapikey。

def generate_video(req: dict) -> dict:
payload = {
model: req.get(model, wan2.6-i2v-flash),
prompt: req[prompt],
negativeprompt: req.get(negativeprompt),
duration: req.get(duration, 4),
fps: req.get(fps, 24),
size: req.get(size, 1280*720),
seed: req.get(seed),
motionstrength: req.get(motionstrength),
apikey: os.getenv(DASHSCOPEAPI_KEY),
}

if req.get(reference_image):
# DashScope 期望 i2v 模型使用 img_url;本地文件会自动上传。
payload[imgurl] = req[referenceimage]

response = VideoSynthesis.call(payload)

# 某些 SDK 版本需要轮询以获取最终结果。
# 如果返回了 task_id,则轮询直到状态为 SUCCEEDED。
result = response.output.get(results, [None])[0]

return {
video_url: None if not result else result.get(url),
duration: response.output.get(duration),
fps: response.output.get(fps),
seed: response.output.get(seed),
}

异步处理 (轮询)

python
import os
from dashscope import VideoSynthesis

task = VideoSynthesis.async_call(
model=req.get(model, wan2.6-i2v-flash),
prompt=req[prompt],
imgurl=req[referenceimage],
duration=req.get(duration, 4),
fps=req.get(fps, 24),
size=req.get(size, 1280*720),
apikey=os.getenv(DASHSCOPEAPI_KEY),
)

final = VideoSynthesis.wait(task)
videourl = final.output.get(videourl)

操作指南

  • - 视频生成可能需要数分钟;请展示进度并允许取消/重试。
  • 根据 (prompt, negativeprompt, duration, fps, size, seed, referenceimage hash, motionstrength) 进行缓存。
  • 将视频资源存储在对象存储中,元数据中仅持久化URL。
  • referenceimage 可以是URL或本地路径;SDK会自动上传本地文件。
  • 如果遇到 Field required: input.img_url 错误,说明参考图像缺失或未正确映射。
  • 根据官方文档,wan2.6-t2v 和 wan2.6-t2v-us 支持多镜头叙事功能和可选的音频输入。

尺寸说明

  • - 使用 WxH 格式(例如 1280*720)。
  • 优先使用常见尺寸;不支持的尺寸可能返回400错误。

输出位置

  • - 默认输出:output/aliyun-wan-video/videos/
  • 可通过 OUTPUT_DIR 覆盖基础目录。

反模式

  • - 不要发明模型名称或别名;仅使用官方的Wan i2v模型ID。
  • 不要在没有进度更新的情况下阻塞UI。
  • 不要在4xx错误时盲目重试;应显式处理验证失败。

工作流程

1) 确认用户意图、区域、标识符,以及操作是只读还是修改。
2) 首先执行一个最小的只读查询,以验证连接和权限。
3) 使用明确的参数和有限的范围执行目标操作。
4) 验证结果并保存输出/证据文件。

参考

  • - 有关DashScope SDK映射和异步处理说明,请参阅 references/api_reference.md。
  • - 来源列表:references/sources.md

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 aliyun-wan-video-1775882108 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 aliyun-wan-video-1775882108 技能

通过命令行安装

skillhub install aliyun-wan-video-1775882108

下载

⬇ 下载 aliyun-wan-video v1.0.0(免费)

文件大小: 9.9 KB | 发布时间: 2026-4-12 08:58

v1.0.0 最新 2026-4-12 08:58
Initial release of aliyun-wan-video skill.

- Provides integration with Model Studio DashScope SDK for Wan video generation models.
- Standardizes video.generate request/response for video-agent pipeline.
- Documents required/optional parameters: prompt, negative_prompt, duration, fps, size, seed, reference_image, motion_strength.
- Ensures output and logging to `output/aliyun-wan-video/` for validation.
- Includes operational, interface, and async polling guidance for consistent behavior.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部