إنشاء فيديو Flux 3
أنشئ فيديو Flux 3 من النص أو الصور المرجعية أو الإطارين الأول والأخير باستخدام إعداد مسبق للحجم 720p أو 1080p.
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=flux-3' \
--form-string 'prompt=A paper boat glides across a still pond while the camera moves forward.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720'{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id المُعادة للاستعلام عن المهمة وتنزيل الفيديو المكتمل.
POST /v1/videos يستخدم multipart/form-data. أرسل عناصر التحكم كحقول نموذج. بالنسبة إلى إدخالات الصور، استخدم عناوين URL للصور المرجعية أو الإطارات الافتتاحية والختامية.
احتفظ بـ input_reference منفصلًا عن first_frame وlast_frame.
اختر وضع الإدخال
| الهدف | الحقول المطلوبة | الحقول الاختيارية |
|---|---|---|
| تحويل النص إلى فيديو | model=flux-3, prompt | seconds, size |
| تحويل صورة HTTPS إلى فيديو | model=flux-3, prompt، عنوان URL واحد لـ input_reference | seconds, size |
| إطارات رئيسية مرتبة | model=flux-3, prompt، عناوين URL متكررة لـ input_reference | seconds, size |
| إطار افتتاحي مرفوع | model=flux-3, prompt، ملف واحد لـ first_frame | seconds, size |
| فيديو بالإطارين الأول والأخير | model=flux-3, prompt, first_frame, last_frame | seconds, size |
استخدم الصور المرجعية
لا يقبل الحقلinput_reference سوى عناوين URL لصور HTTPS المتاحة للعامة. أرسله مرة واحدة لصورة واحدة، أو كرره بترتيب الإطارات الرئيسية لصور متعددة. استخدم عنوان URL واحدًا لكل حقل، بحد أقصى 10 عناوين URL إجمالًا.
صِف الحركة وسلوك الكاميرا والتفاصيل المرئية التي ينبغي أن يحافظ عليها الفيديو المُنشأ من الصورة المرجعية.
تُظهر عينات الطلبات أعلى هذه الصفحة إدخالات لصورة واحدة ولصور متعددة. يستخدم الطلب التالي صورتين بالترتيب الذي أُرسلتا به:
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=flux-3' \
--form-string 'prompt=Move smoothly through the supplied reference images in their given order. Preserve recognizable subjects and visual details as the scene changes. Keep the camera movement gentle.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form-string 'input_reference=https://apidoc.cometapi.com/images/image/gemini/6100640_569429.png' \
--form-string 'input_reference=https://apidoc.cometapi.com/images/image/gemini/6100640_569420.png'
عيّن الإطارين الأول والأخير
أرسل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 الدقيقة التالية:
| فئة الدقة | الحجم |
|---|---|
720p | 1280x720 |
1080p | 1920x1080 |
تدفق المهمة
إنشاء المهمة
id المُعادة.استعلم عن المهمة
status هي completed أو failed.تنزيل النتيجة
completed، استدعِ تنزيل محتوى فيديو Flux 3 لحفظ ملف MP4.الجسم
Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.
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.
^https://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.
^https://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.
^https://الاستجابة
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=flux-3' \
--form-string 'prompt=A paper boat glides across a still pond while the camera moves forward.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720'{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}