Wan 2.6 API

Wan 2.6 支持文生视频和参考图视频,并可配合音频输入生成更长的音频驱动场景。

模型 key

  • wan/wan2.6 — Wan2.6

支持的 mode 与输入

模型 Mode 名称 输入要求
wan/wan2.6 text_to_video 文生视频 Prompt max 2000 chars
Audio: 1-1 files, 50 MB, max 120s, formats mp3, wav, aac, m4a
wan/wan2.6 reference_to_video 参考图生成视频 Prompt max 2000 chars
Images reference: 1-1 files, 10 MB, formats jpg, png, webp
Audio: 1-1 files, 10 MB, max 120s, formats mp3, wav, aac, m4a

参数

模型 参数 默认值 可选值 适用 mode
wan/wan2.6 duration 5s 5s, 10s, 15s 全部 mode
wan/wan2.6 aspect_ratio 16:9 16:9, 9:16, 1:1, 4:3, 3:4 text_to_video
wan/wan2.6 resolution 720p 720p, 1080p 全部 mode
wan/wan2.6 short_type single single, multi 全部 mode
wan/wan2.6 audio false true, false 全部 mode

价格

模型 价格
wan/wan2.6 每秒 4 credits;参数倍率:resolution={"720p":1,"1080p":1.5}

生产建议

  • 显式传入 mode
  • 只使用上表列出的参数值。
  • 媒体输入类 mode 请先用 POST /api/v1/files 上传素材。
  • 如果页面包含多个变体,请使用你真正需要的模型 key。

示例:文生视频

curl https://img2vid.net/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan/wan2.6",
    "mode": "text_to_video",
    "prompt": "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
    "duration": "5s",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "short_type": "single",
    "audio": "false"
  }'

示例:素材驱动视频

curl https://img2vid.net/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan/wan2.6",
    "mode": "reference_to_video",
    "prompt": "Animate the source into a polished cinematic motion shot with natural camera movement",
    "image_urls": ["https://example.com/reference.png"],
    "duration": "5s",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "short_type": "single",
    "audio": "false"
  }'

SDK 示例

下面的示例使用本页的公开模型 key、mode 和参数值。片段假设你已经按快速开始初始化了 SDK client,并引入了对应语言需要的 SDK 类型。媒体输入类 mode 仍然需要先上传本地文件,再把返回的 URL 放入 image_urlsstart_framevideo_urls 等公开字段。

JavaScript / TypeScript

const task = await buble.generations.create({
  model: 'wan/wan2.6',
  mode: 'text_to_video',
  prompt:
    'A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion',
  duration: '5s',
  resolution: '720p',
  aspect_ratio: '16:9',
  short_type: 'single',
  audio: 'false',
});

const result = await buble.generations.wait(task.data.id);
console.log(result.data.result?.videos?.[0]?.url);

Python

task = client.generations.create(
    model="wan/wan2.6",
    mode="text_to_video",
    prompt="A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
    duration="5s",
    resolution="720p",
    aspect_ratio="16:9",
    short_type="single",
    audio="false",
)

result = client.generations.wait(task["data"]["id"])
print(result["data"]["result"]["videos"][0]["url"])

Go

task, err := client.Generations.Create(ctx, &buble.CreateGenerationRequest{
	Model:  "wan/wan2.6",
	Mode:   "text_to_video",
	Prompt: "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
	Params: map[string]any{
		"duration": "5s",
		"resolution": "720p",
		"aspect_ratio": "16:9",
		"short_type": "single",
		"audio": "false",
	},
})
if err != nil {
	return err
}

result, err := client.Generations.Wait(ctx, task.Data.ID)
if err != nil {
	return err
}
fmt.Println(result.Data.Result.Videos[0].URL)

Rust

let task = client.generations().create(
    CreateGenerationRequest::new("wan/wan2.6")
        .mode("text_to_video")
        .prompt("A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion")
        .param("duration", "5s")?
        .param("resolution", "720p")?
        .param("aspect_ratio", "16:9")?
        .param("short_type", "single")?
        .param("audio", "false")?,
).await?;

let result = client
    .generations()
    .wait(&task.data.id, WaitOptions::default())
    .await?;

Swift

let task = try await client.generations.create(
    try CreateGenerationRequest(model: "wan/wan2.6")
        .mode("text_to_video")
        .prompt("A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion")
        .param("duration", "5s")
        .param("resolution", "720p")
        .param("aspect_ratio", "16:9")
        .param("short_type", "single")
        .param("audio", "false")
)

let result = try await client.generations.wait(task.data.id)
print(result.data.result?.videos?.first?.url.absoluteString ?? "")

Dart / Flutter

final task = await client.generations.create(
  CreateGenerationRequest(
    model: 'wan/wan2.6',
    mode: 'text_to_video',
    prompt: 'A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion',
  ).withParam('duration', '5s').withParam('resolution', '720p').withParam('aspect_ratio', '16:9').withParam('short_type', 'single').withParam('audio', 'false'),
);

final result = await client.generations.wait(task.data.id);
print(result.data.result?.videos.firstOrNull?.url);

Elixir

{:ok, task} =
  Buble.Generations.create(client, %{
    model: "wan/wan2.6",
    mode: "text_to_video",
    prompt: "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
    duration: "5s",
    resolution: "720p",
    aspect_ratio: "16:9",
    short_type: "single",
    audio: "false"
  })

{:ok, result} = Buble.Generations.wait(client, task["data"]["id"])
IO.puts(result["data"]["result"]["videos"] |> List.first() |> Map.fetch!("url"))

Java

Envelope<GenerationTask> task = client.generations().create(
        CreateGenerationRequest.builder()
                .model("wan/wan2.6")
                .mode("text_to_video")
                .prompt("A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion")
                .param("duration", "5s")
                .param("resolution", "720p")
                .param("aspect_ratio", "16:9")
                .param("short_type", "single")
                .param("audio", "false")
                .build());

Envelope<GenerationTask> result = client.generations().wait(task.getData().getId());

.NET

var task = await client.Generations.CreateAsync(new CreateGenerationRequest
{
    Model = "wan/wan2.6",
    Mode = "text_to_video",
    Prompt = "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion"
}.WithParam("duration", "5s").WithParam("resolution", "720p").WithParam("aspect_ratio", "16:9").WithParam("short_type", "single").WithParam("audio", "false"));

var result = await client.Generations.WaitAsync(task!.Data!.Id!);

PHP

$task = $client->generations()->create(
    CreateGenerationRequest::make(
        model: 'wan/wan2.6',
        mode: 'text_to_video',
        prompt: 'A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion',
    )
    ->withParam('duration', '5s')
    ->withParam('resolution', '720p')
    ->withParam('aspect_ratio', '16:9')
    ->withParam('short_type', 'single')
    ->withParam('audio', 'false')
);

$result = $client->generations()->wait($task['data']['id']);

Ruby

task = client.generations.create(
  model: "wan/wan2.6",
  mode: "text_to_video",
  prompt: "A cinematic product launch shot with slow camera movement, premium lighting, and realistic motion",
  duration: "5s",
  resolution: "720p",
  aspect_ratio: "16:9",
  short_type: "single",
  audio: "false"
)

result = client.generations.wait(task.dig("data", "id"))
puts result.dig("data", "result", "videos", 0, "url")