Flux 3 videosu oluşturun
Metinden, referans görsellerden ya da ilk ve son karelerden 720p veya 1080p boyut ön ayarıyla bir Flux 3 videosu oluşturun.
{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id değerini saklayın.
POST /v1/videos multipart/form-data kullanır. Kontrolleri form alanları olarak gönderin. Görsel girdileri için referans görsel URL’lerini veya açılış ve kapanış karelerini kullanın.
input_reference değerini first_frame ve last_frame değerlerinden ayrı tutun.
Bir giriş modu seçin
| Amaç | Gerekli alanlar | İsteğe bağlı alanlar |
|---|---|---|
| Metinden videoya | model=flux-3, prompt | seconds, size |
| HTTPS görselden videoya | model=flux-3, prompt, bir input_reference URL’si | seconds, size |
| Sıralı anahtar kareler | model=flux-3, prompt, tekrarlanan input_reference URL’leri | seconds, size |
| Yüklenen açılış karesi | model=flux-3, prompt, bir first_frame dosyası | seconds, size |
| İlk ve son kareli video | model=flux-3, prompt, first_frame, last_frame | seconds, size |
Referans görselleri kullanın
input_reference alanı yalnızca herkese açık HTTPS görsel URL’lerini kabul eder. Tek bir görsel için bir kez gönderin veya birden fazla görsel için anahtar kare sırasıyla tekrarlayın. Alan başına bir URL kullanın; toplamda en fazla 10 URL kullanabilirsiniz.
Oluşturulan videonun referans görselden koruması gereken hareketi, kamera davranışını ve görsel ayrıntıları açıklayın.
Bu sayfanın üst kısmındaki istek örnekleri, tek görselli ve çok görselli girdileri gösterir. Aşağıdaki istek, iki görseli gönderildikleri sırayla kullanır:
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'
İlk ve son kareleri ayarlayın
Açılış görselini ayarlamak içinfirst_frame gönderin. Kapanış görselini de ayarlamak için last_frame ekleyin ve iki kare arasındaki hareketi prompt içinde açıklayın.
Yalnızca bir açılış karesi için last_frame öğesini atlayın. Kapanış karesi hem first_frame hem de last_frame gerektirir.
Her alan, herkese açık bir HTTPS URL’sini veya bir PNG ya da JPEG dosyasını kabul eder. Her alanı URL veya dosya kullanarak bir kez gönderin. Her dosyayı 20 MiB veya altında tutun (20 × 1024 × 1024 bayt).
Bu sayfanın üst kısmındaki kare örnekleri, seconds ve size açıkça ayarlanmış şekilde URL girdilerini ve dosya yüklemelerini gösterir.
Süreyi ve boyutu ayarlayın
seconds değerini 5 ile 20 arasında bir tam sayı olarak açıkça ayarlayın.
size değerini şu tam WxH ön ayar değerlerinden biri olarak ayarlayın:
| Çözünürlük katmanı | Boyut |
|---|---|
720p | 1280x720 |
1080p | 1920x1080 |
Görev akışı
Görevi oluşturun
id değerini saklayın.Görevi sorgulayın
status, completed veya failed olana kadar.Sonucu indirin
completed olduğunda, çağırın Flux 3 video içeriğini indirin MP4 dosyasını kaydetmek için.Gövde
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://Yanıt
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}