الانتقال إلى المحتوى الرئيسي
POST
أنشئ فيديو Flux 3 من النص أو الصور المرجعية أو الإطارين الأول والأخير. خزّن قيمة id المُعادة للاستعلام عن المهمة وتنزيل الفيديو المكتمل. POST /v1/videos يستخدم multipart/form-data. أرسل عناصر التحكم كحقول نموذج. بالنسبة إلى إدخالات الصور، استخدم عناوين URL للصور المرجعية أو الإطارات الافتتاحية والختامية. احتفظ بـ input_reference منفصلًا عن first_frame وlast_frame.

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

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

لا يقبل الحقل input_reference سوى عناوين URL لصور HTTPS المتاحة للعامة. أرسله مرة واحدة لصورة واحدة، أو كرره بترتيب الإطارات الرئيسية لصور متعددة. استخدم عنوان URL واحدًا لكل حقل، بحد أقصى 10 عناوين URL إجمالًا. صِف الحركة وسلوك الكاميرا والتفاصيل المرئية التي ينبغي أن يحافظ عليها الفيديو المُنشأ من الصورة المرجعية. تُظهر عينات الطلبات أعلى هذه الصفحة إدخالات لصورة واحدة ولصور متعددة. يستخدم الطلب التالي صورتين بالترتيب الذي أُرسلتا به:

عيّن الإطارين الأول والأخير

أرسل first_frame لتعيين الصورة الافتتاحية. ولتعيين الصورة الختامية أيضًا، ضمّن last_frame وصِف الحركة بين الإطارين في prompt. للإطار الافتتاحي وحده، احذف last_frame. يتطلب الإطار الختامي كلاً من first_frame وlast_frame. يقبل كل حقل عنوان URL واحدًا عبر HTTPS متاحًا للعامة أو ملف PNG أو JPEG واحدًا. أرسل كل حقل مرة واحدة، باستخدام عنوان URL أو ملف. اجعل حجم كل ملف مساويًا لـ 20 MiB أو أقل (20 × 1024 × 1024 بايت). تُظهر أمثلة الإطارات أعلى هذه الصفحة إدخالات عناوين URL وعمليات رفع الملفات، مع تعيين seconds وsize صراحةً.

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

عيّن seconds صراحةً إلى عدد صحيح من 5 حتى 20. عيّن size إلى إحدى قيم الإعداد المسبق WxH الدقيقة التالية: تحدد قيمة الحجم فئة دقة الإخراج. بالنسبة إلى تحويل النص إلى فيديو، يمكن ضبط الأبعاد المُرمّزة لمحاذاة برنامج الترميز. بالنسبة إلى تحويل الصورة إلى فيديو، يمكن أن تحدد الصورة المرجعية أيضًا التأطير النهائي ونسبة العرض إلى الارتفاع.

تدفق المهمة

1

إنشاء المهمة

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

استعلم عن المهمة

استدعِ استرداد فيديو Flux 3 حتى تصبح قيمة status هي completed أو failed.
3

تنزيل النتيجة

عندما تكون المهمة completed، استدعِ تنزيل محتوى فيديو Flux 3 لحفظ ملف MP4.

التفويضات

Authorization
string
header
مطلوب

Bearer authentication. Use your CometAPI API key.

الجسم

multipart/form-data

Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.

model
string
افتراضي:flux-3
مطلوب

Model ID for this route. Use flux-3.

Allowed value: "flux-3"
prompt
string
افتراضي:A paper boat glides across a still pond while the camera moves forward.
مطلوب

Text that describes the scene, motion, camera behavior, and visual details that the video should preserve.

Minimum string length: 1
seconds
integer

Requested clip duration in whole seconds. Set seconds explicitly to an integer from 5 through 20.

النطاق المطلوب: 5 <= x <= 20
size
enum<string>
افتراضي:1280x720

Resolution preset in exact WxH form. Use 1280x720 for the 720p tier or 1920x1080 for the 1080p tier. Encoded dimensions can be codec-aligned; image-to-video framing can follow the reference image.

الخيارات المتاحة:
1280x720,
1920x1080
input_reference

Reference image URLs. Send one publicly accessible HTTPS image URL per input_reference field. For multiple images, repeat the field in keyframe order, up to 10 URLs. This field accepts URLs only. Keep it separate from first_frame and last_frame.

Pattern: ^https://
first_frame
مطلوب if last_frame is set

Opening-frame image as one publicly accessible HTTPS URL or one PNG or JPEG file. Keep each file at or below 20 MiB (20 × 1024 × 1024 bytes). Send the field once, using either a URL or a file. Pair with last_frame to set both boundaries. Keep frame inputs separate from input_reference.

Pattern: ^https://
last_frame

Closing-frame image as one publicly accessible HTTPS URL or one PNG or JPEG file. Keep each file at or below 20 MiB (20 × 1024 × 1024 bytes). Send the field once, using either a URL or a file. To specify the closing image through this endpoint, send last_frame together with first_frame. Keep frame inputs separate from input_reference.

Pattern: ^https://

الاستجابة

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

id
string
مطلوب

Task ID. Use this value as task_id in retrieve and content requests.

مثال:

"<task_id>"

object
string
مطلوب

Object type for the asynchronous video task.

Allowed value: "video"
model
string
مطلوب

Model ID that the task uses.

Allowed value: "flux-3"
status
enum<string>
مطلوب

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

الخيارات المتاحة:
queued,
in_progress,
completed,
failed
progress
integer
مطلوب

Task progress as a coarse percentage.

النطاق المطلوب: 0 <= x <= 100
created_at
integer<int64>
مطلوب

Task creation time as a Unix timestamp in seconds.

task_id
string

Compatibility alias for id. This field can be omitted from retrieve responses.

مثال:

"<task_id>"

completed_at
integer<int64>

Task completion time as a Unix timestamp in seconds when the task provides one.

expires_at
integer<int64>

Result expiration time as a Unix timestamp in seconds when the task provides one.

video_url
string<uri>

Video delivery URL. This field appears on completed tasks.

مثال:

"https://media.example.com/flux-3-result.mp4"

error
object

Failure details. This field appears when the task fails.

آخر تعديل في ٩ سبتمبر ٢٠٢٦