Skip to main content
POST
使用文本、参考媒体或首尾帧创建 Wan 视频。保存返回的 id,以便轮询任务并下载已完成的视频。 POST /v1/videos 使用 multipart/form-data。请以 seconds 的形式发送明确的整数值,并以 sizeWxH 格式发送。

选择输入模式

每种模式都需要 modelprompt。可用的媒体输入取决于模型: 要查找可供您的 API 密钥使用的 Wan 模型 ID,请使用 列出可用模型.

使用参考图像

对于 wan2.7wan3.0wan3.0-prime,请通过 input_reference 以可公开访问的 HTTPS URL 或上传文件的形式发送参考图像。 对于多张图像,请按图像顺序重复该字段,每个字段提供一个 URL 或文件。 input_reference 中使用全部 URL 或全部文件。请分别发送每个 URL,而不要将多个 URL 合并为逗号分隔的值。 使用每张最大 20 MB 的 PNG 或 JPEG 图像。 单个 input_reference URL 或文件将使用图像生成视频工作流。该图像会引导构图和外观;请使用 Prompt 描述运动和摄像机行为。 对于 wan3.0wan3.0-prime,无论使用 URL 还是上传文件,均最多通过 input_reference 发送 10 张参考图像。

使用参考视频和音频

通过 reference_videos 发送视频,并通过 reference_audios 发送音频片段;每个输入均需重复传入相应字段一次。 每个输入都可以是可公开访问的 HTTPS URL 或上传的文件。 视频参考请使用包含 H.264 编码视频的 MP4 文件。音频参考请使用单独的 MP3 文件。 不同字段可以使用不同的输入类型,例如将图片 URL 与上传的视频搭配使用。在 reference_videosreference_audios 中,请全部使用 URL 或全部使用文件。 最多可上传五个视频文件,每个最大为 50 MiB(50 × 1024 × 1024 字节). 最多可上传五个音频文件,每个最大为 15 MiB(15 × 1024 × 1024 字节).

Wan 2.6 视频参考

发送一到三个 reference_videos,每个时长为 2–30 秒,大小不超过 30 MB,且帧率至少为 16 fps。 这些限制同时适用于 URL 和上传的视频。在 Prompt 中,按照输入顺序将主体称为 @Video1@Video2@Video3 在此模式下,省略 input_referencereference_audiosfirst_framelast_frame。将 seconds 设置为 510 以下示例根据两个视频参考创建一个五秒视频。请将媒体 URL 或文件名替换为你的输入:

Wan 2.7 图片和视频参考

结合图片和视频参考来引导主体外观和动作。将 seconds 设置为从 210 的整数。省略 reference_audios 使用两个图片 URL 或两张上传的图片,并搭配一个视频参考:

Wan 3.0 图片、视频和音频参考

对于 wan3.0wan3.0-prime,结合图片和视频参考以及音频参考,以引导外观、动作和节奏。 最多发送五个视频参考,总时长不超过 15 秒。每个视频的帧率必须至少为 16 fps。 最多发送五个音频参考,总时长不超过 15 秒。视频和音频时长分别计算。 将输出 seconds 设置为从 230 的整数。 使用两个图片 URL 或两张上传的图片,并搭配一个视频和两个音频片段:

使用首帧和尾帧

对于 wan2.7wan3.0wan3.0-prime,为起始图像发送 first_frame,并可选地为结束图像发送 last_frame。 每个字段都接受一个可公开访问的 HTTPS PNG 或 JPEG URL,或者一个已上传的 PNG 或 JPEG 文件。 对于 Wan 2.7 帧输入,起始图像决定宽高比,而 size 选择输出分辨率级别。 请将帧输入与 input_referencereference_videosreference_audios 分开提交请求。 以下 Wan 2.7 示例会在起始帧和结束帧之间创建过渡:
以下 Wan 3.0 示例会在起始帧和结束帧之间创建过渡:

设置时长和尺寸

seconds 作为整数发送,其值须在适用于你的模型和输入模式的范围内。 size 设置为适用于目标模型的以下 WxH 值之一。 Wan 3.0 的尺寸值也适用于 wan3.0-prime

Wan 3.0 尺寸值

Wan 2.7 尺寸值

Wan 2.6 尺寸值

任务流程

1

创建任务

发送 multipart 表单请求,并存储返回的 id
2

轮询任务

调用 检索 Wan 视频 直到 statuscompletedfailederror
3

下载结果

当任务状态为 completed 时,调用 检索 Wan 视频内容 以下载 MP4 文件。

授权

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

请求体

multipart/form-data
model
string
必填

Wan model ID: wan2.6, wan2.7, wan3.0, or wan3.0-prime. Use wan2.6 for text or reference-video input. Use wan2.7 for text, image/video references, or frame inputs. Use wan3.0 or wan3.0-prime to also include reference audio.

示例:

"wan3.0"

prompt
string
必填

Text prompt that describes the video to generate. Describe the appearance and motion to preserve from references, or the transition between first_frame and last_frame. For wan2.6 video references, use @Video1, @Video2, and @Video3 in input order.

示例:

"A small robot walks through a bright greenhouse with smooth camera movement."

seconds
integer

Requested output duration in whole seconds. Send an explicit integer. For wan2.6 reference-to-video, use 5 or 10; text-to-video also accepts 15. For wan2.7 reference-to-video, use 2 through 10; text and frame inputs accept 2 through 15. For wan3.0 and wan3.0-prime, use 2 through 30. Default is 5.

必填范围: 2 <= x <= 30
示例:

5

size
string

Supported WxH size values. For wan3.0 and wan3.0-prime: 832x480, 480x832, 624x624, 640x480, 480x640, 1280x720, 720x1280, 960x960, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is 1920x1080. For Wan 2.7 frame inputs, the opening image determines the aspect ratio; size selects the output resolution tier.

示例:

"1920x1080"

input_reference

PNG or JPEG reference images for wan2.7, wan3.0, and wan3.0-prime. Repeat input_reference with one publicly accessible HTTPS image URL or uploaded image file per field. Use all URLs or all files within this field. Do not combine URLs into a comma-separated value. A single URL or file uses the image-to-video workflow. Each image can be up to 20 MB. For wan3.0 and wan3.0-prime, send at most 10 reference images, whether you use URLs or uploaded files. Image and video references can share a request; reference audio requires wan3.0 or wan3.0-prime. Submit frame inputs separately. Omit for text-to-video and wan2.6 reference-to-video. Submit images in the order you want to reference them in the prompt.

Pattern: ^https://
reference_videos
(string<uri> | file)[]

Reference videos for wan2.6, wan2.7, wan3.0, and wan3.0-prime. Repeat reference_videos with publicly accessible HTTPS URLs or uploaded MP4 files with H.264 video. Use one input type within this field: all URLs or all files. For wan2.6, send 1 to 3 clips, each 2 to 30 seconds and up to 30 MB, with at least 16 fps; omit image, audio, and frame fields. For wan2.7, combine video references with image references. For wan3.0 and wan3.0-prime, send at most 5 clips totaling at most 15 seconds, with at least 16 fps. Video uploads are limited to 5 files, each at most 50 MiB (50 x 1024 x 1024 bytes); the lower wan2.6 limits still apply. Submit frame inputs separately.

Minimum array length: 1
Pattern: ^https://
reference_audios
(string<uri> | file)[]

Reference audio for wan3.0 and wan3.0-prime, combined with image or video references. Repeat reference_audios with publicly accessible HTTPS MP3 URLs or uploaded MP3 files. Use one input type within this field: all URLs or all files. Send at most 5 audio references totaling at most 15 seconds, counted separately from reference video duration. Audio uploads are limited to 5 files, each at most 15 MiB (15 x 1024 x 1024 bytes). Submit frame inputs separately. Omit for wan2.6 and wan2.7.

Minimum array length: 1
Pattern: ^https://
first_frame

Opening frame for wan2.7, wan3.0, and wan3.0-prime, as one publicly accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file. Use first_frame alone or add last_frame to guide the ending. Submit frame inputs in a separate request from input_reference, reference_videos, and reference_audios. Omit for wan2.6. For Wan 2.7 frame inputs, the opening image determines the aspect ratio; size selects the output resolution tier.

Pattern: ^https://
last_frame

Ending frame for wan2.7, wan3.0, and wan3.0-prime, as one publicly accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file. Use with first_frame to guide the ending. Submit frame inputs in a separate request from input_reference, reference_videos, and reference_audios. Omit for wan2.6. For Wan 2.7 frame inputs, the opening image determines the aspect ratio; size selects the output resolution tier.

Pattern: ^https://

响应

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
必填

Task ID. Use this value with retrieve and content endpoints.

示例:

"task_example"

object
string
必填

Object type. Video tasks return video.

示例:

"video"

model
string
必填

Model ID used for the task.

示例:

"wan3.0"

status
enum<string>
必填

Task lifecycle status. Poll until the value is completed, failed, or error.

可用选项:
queued,
in_progress,
completed,
failed,
error
示例:

"queued"

progress
integer
必填

Task progress as a coarse percentage.

必填范围: 0 <= x <= 100
示例:

0

created_at
integer
必填

Task creation time as a Unix timestamp in seconds.

示例:

1779938152

task_id
string

Compatibility alias for id when present.

示例:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

示例:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

示例:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

最后修改于 2026年9月9日