الانتقال إلى المحتوى الرئيسي
POST
أنشئ فيديو Wan من النص أو الوسائط المرجعية أو الإطارين الأول والأخير. خزّن id المُعاد للاستعلام عن حالة المهمة وتنزيل الفيديو المكتمل. POST /v1/videos يستخدم multipart/form-data. أرسل قيمة صحيحة صريحة لـ seconds وsize بصيغة WxH. wan3.0-prime يستخدم حقول الطلب العامة نفسها وحدود الوسائط وتدفق المهمة نفسه الذي يستخدمه wan3.0. اضبط model على القيمة الدقيقة wan3.0-prime عند استهداف Prime. يدعم Prime تحويل النص إلى فيديو، وتحويل الصورة إلى فيديو، ومدخلات الإطارين الأول والأخير، ومراجع الصور والفيديو والصوت المجمعة. يجب إرسال الوسائط المرجعية ومدخلات الإطارات في طلبات منفصلة.

اختر وضع الإدخال

يتطلب كل وضع model وprompt. تعتمد مدخلات الوسائط المتاحة على النموذج: للعثور على معرّف نموذج Wan متاح لمفتاح API الخاص بك، استخدم إدراج النماذج المتاحة.

إنشاء فيديو Wan 3.0 Prime

ينشئ هذا الطلب الأدنى مهمة تحويل نص إلى فيديو مدتها خمس ثوانٍ باستخدام Prime:

استخدام الصور المرجعية

بالنسبة إلى wan2.7 وwan3.0 وwan3.0-prime، أرسل الصور المرجعية عبر input_reference كعناوين URL عامة يمكن الوصول إليها عبر HTTPS أو كملفات مرفوعة. للصور المتعددة، كرر الحقل بترتيب الصور، مع عنوان URL واحد أو ملف واحد لكل حقل. استخدم جميع عناوين URL أو جميع الملفات ضمن input_reference. أرسل كل عنوان URL على حدة بدلًا من دمج عناوين URL في قيمة مفصولة بفواصل. استخدم صور PNG أو JPEG بحجم يصل إلى 20 MB لكل صورة. يستخدم عنوان URL أو ملف input_reference واحد سير عمل تحويل الصورة إلى فيديو. توجه الصورة التكوين والمظهر؛ استخدم Prompt لوصف الحركة وسلوك الكاميرا. بالنسبة إلى wan3.0 وwan3.0-prime، أرسل ما لا يزيد على 10 صور مرجعية عبر input_reference، سواء استخدمت عناوين URL أو ملفات مرفوعة.

استخدم مقاطع الفيديو والصوت المرجعية

أرسل مقاطع الفيديو عبر reference_videos والمقاطع الصوتية عبر reference_audios، مع تكرار كل حقل مرة واحدة لكل إدخال. يمكن أن يكون كل إدخال عنوان URL عبر HTTPS متاحًا للعامة أو ملفًا مرفوعًا. استخدم ملفات MP4 بفيديو مُرمَّز باستخدام H.264 لمراجع الفيديو. استخدم ملفات MP3 منفصلة لمراجع الصوت. يمكن للحقول المختلفة استخدام أنواع إدخال مختلفة، مثل عنوان URL لصورة مع مقاطع فيديو مرفوعة. ضمن reference_videos أو reference_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_reference وreference_audios وfirst_frame وlast_frame. اضبط seconds على 5 أو 10. تنشئ هذه الأمثلة فيديو مدته خمس ثوانٍ من مرجعَي فيديو. استبدل عناوين URL للوسائط أو أسماء الملفات بإدخالاتك:

مراجع الصور والفيديو في Wan 2.7

ادمج مراجع الصور والفيديو لتوجيه مظهر العناصر وحركتها. اضبط seconds على عدد صحيح من 2 إلى 10. احذف reference_audios. استخدم عنوانَي URL لصورتين أو صورتين مرفوعتين مع مرجع فيديو:

مراجع الصور والفيديو والصوت في Wan 3.0

بالنسبة إلى wan3.0 وwan3.0-prime، ادمج مراجع الصور والفيديو مع مراجع الصوت لتوجيه المظهر والحركة والإيقاع. أرسل ما لا يزيد على خمسة مراجع فيديو، بمدة إجمالية لا تتجاوز 15 ثانية. يجب أن يكون معدل كل فيديو 16 fps على الأقل. أرسل ما لا يزيد على خمسة مراجع صوتية، بمدة إجمالية لا تتجاوز 15 ثانية. احسب مدة الفيديو والصوت بشكل منفصل. اضبط seconds للإخراج على عدد صحيح من 2 إلى 30. استخدم عنوانَي URL لصورتين أو صورتين مرفوعتين مع مرجع فيديو واحد ومقطعين صوتيين:

استخدم الإطارين الأول والأخير

بالنسبة إلى wan2.7 وwan3.0 وwan3.0-prime، أرسل first_frame للصورة الافتتاحية وlast_frame اختياريًا للصورة الختامية. يقبل كل حقل عنوان URL واحدًا متاحًا للعامة عبر HTTPS لصورة PNG أو JPEG، أو ملف PNG أو JPEG واحدًا تم تحميله. بالنسبة إلى مدخلات الإطارات في Wan 2.7، تحدد الصورة الافتتاحية نسبة العرض إلى الارتفاع، بينما يحدد size فئة دقة الإخراج. أرسل مدخلات الإطارات في طلب منفصل عن input_reference وreference_videos وreference_audios. تنشئ أمثلة Wan 2.7 هذه انتقالًا بين الإطارين الافتتاحي والختامي:
تنشئ أمثلة Wan 3.0 وWan 3.0 Prime هذه انتقالًا بين الإطارين الافتتاحي والختامي:

تعيين المدة والحجم

أرسل seconds كعدد صحيح ضمن النطاق الخاص بطرازك ووضع الإدخال. عيّن size إلى إحدى قيم WxH أدناه للطراز المستهدف. تنطبق قيم حجم Wan 3.0 أيضًا على wan3.0-prime.

قيم حجم Wan 3.0

قيم حجم Wan 2.7

قيم حجم Wan 2.6

تدفق المهمة

1

إنشاء المهمة

أرسل طلب النموذج متعدد الأجزاء وخزّن القيمة المُعادة id.
2

استعلم عن المهمة دوريًا

استدعِ استرداد فيديو Wan إلى أن تصبح status هي completed أو failed أو error.
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. Wan 3.0 and Wan 3.0 Prime use the same public request fields, task flow, and media limits; use the exact model ID wan3.0-prime when targeting Prime. Use wan2.6 for text or reference-video input. Use wan2.7 for text, image/video references, or frame inputs. Wan 3.0 and Wan 3.0 Prime also support reference audio.

مثال:

"wan3.0-prime"

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, 480p: 832x480, 480x832, 624x624, 704x528, 528x704; 720p: 1280x720, 720x1280, 960x960, 1088x832, 832x1088; 1080p: 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.

آخر تعديل في ١٠ أكتوبر ٢٠٢٦