Skip to main content
POST
Tạo video Wan từ văn bản, nội dung đa phương tiện tham chiếu hoặc khung hình đầu và cuối. Lưu id được trả về để truy vấn tác vụ và tải video đã hoàn tất xuống. POST /v1/videos sử dụng multipart/form-data. Gửi một giá trị số nguyên seconds rõ ràng và một size ở dạng WxH.

Chọn chế độ đầu vào

Mọi chế độ đều yêu cầu modelprompt. Đầu vào nội dung đa phương tiện khả dụng tùy thuộc vào model: Để tìm ID model Wan khả dụng cho API key của bạn, hãy dùng Liệt kê các model khả dụng.

Sử dụng hình ảnh tham chiếu

Đối với wan2.7, wan3.0wan3.0-prime, hãy gửi hình ảnh tham chiếu qua input_reference dưới dạng URL HTTPS có thể truy cập công khai hoặc tệp đã tải lên. Đối với nhiều hình ảnh, hãy lặp lại trường theo thứ tự hình ảnh, với một URL hoặc tệp cho mỗi trường. Chỉ dùng toàn bộ URL hoặc toàn bộ tệp trong input_reference. Gửi riêng từng URL thay vì kết hợp các URL thành một giá trị được phân tách bằng dấu phẩy. Sử dụng hình ảnh PNG hoặc JPEG có dung lượng tối đa 20 MB mỗi ảnh. Một URL hoặc tệp input_reference duy nhất sử dụng quy trình chuyển hình ảnh thành video. Hình ảnh định hướng bố cục và diện mạo; dùng prompt để mô tả chuyển động và hành vi của camera. Đối với wan3.0wan3.0-prime, hãy gửi tối đa 10 hình ảnh tham chiếu qua input_reference, dù bạn dùng URL hay tệp đã tải lên.

Sử dụng video và âm thanh tham chiếu

Gửi video qua reference_videos và đoạn âm thanh qua reference_audios, lặp lại mỗi trường một lần cho mỗi dữ liệu đầu vào. Mỗi dữ liệu đầu vào có thể là URL HTTPS công khai hoặc tệp đã tải lên. Dùng tệp MP4 có video được mã hóa H.264 cho video tham chiếu. Dùng các tệp MP3 riêng biệt cho âm thanh tham chiếu. Các trường khác nhau có thể dùng các loại dữ liệu đầu vào khác nhau, chẳng hạn như URL hình ảnh cùng với video đã tải lên. Trong reference_videos hoặc reference_audios, chỉ dùng toàn bộ URL hoặc toàn bộ tệp. Bạn có thể tải lên tối đa năm tệp video, mỗi tệp không quá 50 MiB (50 × 1024 × 1024 byte). Bạn có thể tải lên tối đa năm tệp âm thanh, mỗi tệp không quá 15 MiB (15 × 1024 × 1024 byte).

Video tham chiếu Wan 2.6

Gửi từ một đến ba reference_videos, mỗi video dài 2–30 giây, tối đa 30 MB và ít nhất 16 fps. Các giới hạn này áp dụng cho cả URL và video đã tải lên. Trong prompt, hãy tham chiếu các chủ thể là @Video1, @Video2@Video3 theo thứ tự đầu vào. Đối với chế độ này, hãy bỏ qua input_reference, reference_audios, first_framelast_frame. Đặt seconds thành 5 hoặc 10. Các ví dụ này tạo video dài năm giây từ hai video tham chiếu. Thay thế URL phương tiện hoặc tên tệp bằng dữ liệu đầu vào của bạn:

Hình ảnh và video tham chiếu Wan 2.7

Kết hợp hình ảnh và video tham chiếu để định hướng diện mạo và chuyển động của chủ thể. Đặt seconds thành một số nguyên từ 2 đến 10. Bỏ qua reference_audios. Dùng hai URL hình ảnh hoặc hai hình ảnh đã tải lên cùng một video tham chiếu:

Hình ảnh, video và âm thanh tham chiếu Wan 3.0

Đối với wan3.0wan3.0-prime, hãy kết hợp hình ảnh và video tham chiếu với âm thanh tham chiếu để định hướng diện mạo, chuyển động và nhịp điệu. Gửi tối đa năm video tham chiếu với tổng thời lượng không quá 15 giây. Mỗi video phải có ít nhất 16 fps. Gửi tối đa năm âm thanh tham chiếu với tổng thời lượng không quá 15 giây. Tính riêng thời lượng video và âm thanh. Đặt seconds đầu ra thành một số nguyên từ 2 đến 30. Dùng hai URL hình ảnh hoặc hai hình ảnh đã tải lên cùng một video và hai đoạn âm thanh:

Sử dụng khung hình đầu tiên và cuối cùng

Đối với wan2.7, wan3.0wan3.0-prime, hãy gửi first_frame cho hình ảnh mở đầu và tùy chọn last_frame cho hình ảnh kết thúc. Mỗi trường chấp nhận một URL PNG hoặc JPEG HTTPS có thể truy cập công khai hoặc một tệp PNG hoặc JPEG đã tải lên. Đối với dữ liệu đầu vào khung hình Wan 2.7, hình ảnh mở đầu xác định tỷ lệ khung hình, trong khi size chọn cấp độ độ phân giải đầu ra. Gửi dữ liệu đầu vào khung hình trong một yêu cầu riêng biệt với input_reference, reference_videosreference_audios. Các ví dụ Wan 2.7 này tạo chuyển tiếp giữa khung hình mở đầu và khung hình kết thúc:
Các ví dụ Wan 3.0 này tạo chuyển tiếp giữa khung hình mở đầu và khung hình kết thúc:

Thiết lập thời lượng và kích thước

Gửi seconds dưới dạng số nguyên trong phạm vi dành cho model và chế độ nhập của bạn. Đặt size thành một trong các giá trị WxH bên dưới cho model mục tiêu. Các giá trị kích thước Wan 3.0 cũng áp dụng cho wan3.0-prime.

Các giá trị kích thước Wan 3.0

Các giá trị kích thước Wan 2.7

Các giá trị kích thước Wan 2.6

Luồng tác vụ

1

Tạo tác vụ

Gửi yêu cầu biểu mẫu nhiều phần và lưu trữ id được trả về.
2

Thăm dò tác vụ

Gọi Truy xuất video Wan cho đến khi statuscompleted, failed hoặc error.
3

Tải kết quả xuống

Khi tác vụ ở trạng thái completed, hãy gọi Truy xuất nội dung video Wan để tải tệp MP4 xuống.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer authentication. Use your CometAPI API key.

Nội dung

multipart/form-data
model
string
bắt buộc

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.

Ví dụ:

"wan3.0"

prompt
string
bắt buộc

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.

Ví dụ:

"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.

Phạm vi bắt buộc: 2 <= x <= 30
Ví dụ:

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.

Ví dụ:

"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://

Phản hồi

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

id
string
bắt buộc

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

Ví dụ:

"task_example"

object
string
bắt buộc

Object type. Video tasks return video.

Ví dụ:

"video"

model
string
bắt buộc

Model ID used for the task.

Ví dụ:

"wan3.0"

status
enum<string>
bắt buộc

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

Tùy chọn có sẵn:
queued,
in_progress,
completed,
failed,
error
Ví dụ:

"queued"

progress
integer
bắt buộc

Task progress as a coarse percentage.

Phạm vi bắt buộc: 0 <= x <= 100
Ví dụ:

0

created_at
integer
bắt buộc

Task creation time as a Unix timestamp in seconds.

Ví dụ:

1779938152

task_id
string

Compatibility alias for id when present.

Ví dụ:

"task_example"

completed_at
integer

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

Ví dụ:

1779938219

video_url
string

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

Ví dụ:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

Lần sửa đổi cuối 9 tháng 9, 2026