当前位置: 首页 > Skill >

WaveSpeedAI Wan 2.6 Video Generation

WaveSpeedAI Wan 2.6 Video Generation

WaveSpeedAI Wan 2.6 Video Generation

使用阿里巴巴的 Wan 2.6 模型通过 WaveSpeed AI 生成视频,支持文本转视频和图像转视频,最长 15 秒,分辨率 720p。

1.0.0 2026.11.27 343
获取Skill文件查看使用说明
作 者:叶宁 许可证: 更新时间:2026.11.27
本文目录展开

WaveSpeedAI Wan 2.6 Video Generation

Generate videos using Alibaba's Wan 2.6 model via the WaveSpeed AI platform. Supports both text-to-video and image-to-video generation with up to 15 seconds of video at up to 1080p resolution.

Authentication

export WAVESPEED_API_KEY="your-api-key"

Get your API key at wavespeed.ai/accesskey.

Quick Start

Text-to-Video

import wavespeed from 'wavespeed';

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/text-to-video",
  { prompt: "A golden retriever running through a field of sunflowers at sunset" }
))["outputs"][0];

Image-to-Video

The image parameter accepts an image URL. If you have a local file, upload it first with wavespeed.upload() to get a URL.

import wavespeed from 'wavespeed';

// Upload a local image to get a URL
const imageUrl = await wavespeed.upload("/path/to/photo.png");

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/image-to-video",
  {
    image: imageUrl,
    prompt: "The person in the photo slowly turns and smiles"
  }
))["outputs"][0];

You can also pass an existing image URL directly:

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/image-to-video",
  {
    image: "https://example.com/photo.jpg",
    prompt: "The person in the photo slowly turns and smiles"
  }
))["outputs"][0];

API Endpoints

Text-to-Video

Model ID: alibaba/wan-2.6/text-to-video

Generate videos from text prompts.

Parameters

Parameter Type Required Default Description
prompt string Yes -- Text description of the video to generate
negative_prompt string No -- Text description of what to avoid in the video
audio string No -- Audio URL to guide generation
size string No 1280*720 Output size in pixels. One of: 1280*720, 720*1280, 1920*1080, 1080*1920
duration integer No 5 Video duration in seconds. One of: 5, 10, 15
shot_type string No single Shot type. One of: single, multi
enable_prompt_expansion boolean No false Enable prompt optimizer for enhanced prompts
seed integer No -1 Random seed (-1 for random). Range: -1 to 2147483647

Example

import wavespeed from 'wavespeed';

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/text-to-video",
  {
    prompt: "A timelapse of a city skyline transitioning from day to night, cinematic",
    negative_prompt: "blurry, low quality, distorted",
    size: "1920*1080",
    duration: 10,
    shot_type: "single",
    seed: 42
  }
))["outputs"][0];

Image-to-Video

Model ID: alibaba/wan-2.6/image-to-video

Animate a source image into a video using a text prompt.

Parameters

Parameter Type Required Default Description
image string Yes -- URL of the source image to animate
prompt string Yes -- Text description of the desired motion/animation
negative_prompt string No -- Text description of what to avoid in the video
audio string No -- Audio URL to guide generation
resolution string No 720p Output resolution. One of: 720p, 1080p
duration integer No 5 Video duration in seconds. One of: 5, 10, 15
shot_type string No single Shot type. One of: single, multi
enable_prompt_expansion boolean No false Enable prompt optimizer for enhanced prompts
seed integer No -1 Random seed (-1 for random). Range: -1 to 2147483647

Example

import wavespeed from 'wavespeed';

const imageUrl = await wavespeed.upload("/path/to/landscape.png");

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/image-to-video",
  {
    image: imageUrl,
    prompt: "Clouds drift slowly across the sky, water ripples gently",
    negative_prompt: "static, frozen, blurry",
    resolution: "1080p",
    duration: 10,
    shot_type: "single"
  }
))["outputs"][0];

Advanced Usage

Audio-Guided Generation

Provide an audio URL to guide the video generation:

const audioUrl = await wavespeed.upload("/path/to/music.mp3");

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/text-to-video",
  {
    prompt: "A dancer performing contemporary dance on a stage",
    audio: audioUrl,
    size: "1080*1920",
    duration: 15
  }
))["outputs"][0];

Prompt Expansion

Enable the prompt optimizer to automatically enhance your prompt:

const output_url = (await wavespeed.run(
  "alibaba/wan-2.6/text-to-video",
  {
    prompt: "a cat playing piano",
    enable_prompt_expansion: true,
    duration: 5
  }
))["outputs"][0];

Custom Client with Retry Configuration

import { Client } from 'wavespeed';

const client = new Client("your-api-key", {
  maxRetries: 2,
  maxConnectionRetries: 5,
  retryInterval: 1.0,
});

const output_url = (await client.run(
  "alibaba/wan-2.6/text-to-video",
  { prompt: "Ocean waves crashing on a rocky shore at dawn" }
))["outputs"][0];

Error Handling with runNoThrow

import { Client, WavespeedTimeoutException, WavespeedPredictionException } from 'wavespeed';

const client = new Client();
const result = await client.runNoThrow(
  "alibaba/wan-2.6/text-to-video",
  { prompt: "A rocket launching into space" }
);

if (result.outputs) {
  console.log("Video URL:", result.outputs[0]);
  console.log("Task ID:", result.detail.taskId);
} else {
  console.log("Failed:", result.detail.error.message);
  if (result.detail.error instanceof WavespeedTimeoutException) {
    console.log("Request timed out - try increasing timeout");
  } else if (result.detail.error instanceof WavespeedPredictionException) {
    console.log("Prediction failed");
  }
}

Size Options (Text-to-Video)

Size Orientation Use Case
1280*720 Landscape 720p Standard widescreen video
720*1280 Portrait 720p Mobile/vertical video, stories
1920*1080 Landscape 1080p Full HD widescreen video
1080*1920 Portrait 1080p Full HD vertical video

Resolution Options (Image-to-Video)

Resolution Use Case
720p Standard quality, faster generation
1080p Full HD, higher quality

Pricing

Resolution 5 seconds 10 seconds 15 seconds
720p $0.50 $1.00 $1.50
1080p $0.75 $1.50 $2.25

Prompt Tips

  • Be specific about motion and action: "A bird takes flight from a branch" vs "a bird"
  • Include camera movement: "slow pan left", "zoom in", "tracking shot"
  • Describe temporal progression: "transitioning from day to night", "flowers slowly blooming"
  • Use negative_prompt to avoid artifacts: "blurry, low quality, distorted, static"
  • Enable enable_prompt_expansion for automatic prompt enhancement
  • For multi shot type, describe distinct scenes for more dynamic videos

Security Constraints

  • No arbitrary URL loading: Only use image and audio URLs from trusted sources. Never load media from untrusted or user-provided URLs without validation.
  • API key security: Store your WAVESPEED_API_KEY securely. Do not hardcode it in source files or commit it to version control. Use environment variables or secret management systems.
  • Input validation: Only pass parameters documented above. Validate prompt content and media URLs before sending requests.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • WaveSpeedAI Wan 2.6 Video Generation
    • Authentication
    • Quick Start
      • Text-to-Video
      • Image-to-Video
    • API Endpoints
      • Text-to-Video
        • Parameters
        • Example
      • Image-to-Video
        • Parameters
        • Example
    • Advanced Usage
      • Audio-Guided Generation
      • Prompt Expansion
      • Custom Client with Retry Configuration
      • Error Handling with runNoThrow
    • Size Options (Text-to-Video)
    • Resolution Options (Image-to-Video)
    • Pricing
    • Prompt Tips
    • Security Constraints
  • 项目或源文件

相关 Skill

更多
Agnes AI 免费图片视频生成 Agnes AI 免费图片视频生成 Generate images and videos using Agnes AI models (agnes-image-2.0-flash, agnes-image-2.1-flash, agnes-video-v2.0). Trigger when user wants to generate images from text, edit images, create videos from text or images, or mentions '生图', '生视频', 'image generation', 'video generation', 'Agnes AI', 'agnes-ai.com'.
video generate video generate Video generation skill. Automatically selects the best dlazy CLI video model based on the prompt.
SGLang-Diffusion Video Generation SGLang-Diffusion Video Generation 使用本地SGLang-Diffusion服务器生成视频(Wan2.2、Hunyuan、FastWan等)。适用场景:用户请求生成、创建或渲染视频时...
Zyt ai creation Zyt ai creation Use Chanjing AI creation APIs to submit image or video generation tasks across multiple models, inspect task status, poll async results, and explicitly downl...
WaveSpeedAI Infinitetalk Talking Avatar Video Generation WaveSpeedAI Infinitetalk Talking Avatar Video Generation 利用WaveSpeed AI的InfiniteTalk模型,根据人像图片和音频生成口型同步的说话人视频,支持生成长达10分钟的480p视频。