跳轉到主要內容
POST
從文字、參考圖片或首尾影格建立 Flux 3 影片。儲存傳回的 id,以輪詢工作並下載完成的影片。 POST /v1/videos 使用 multipart/form-data。請將控制項作為表單欄位傳送。對於圖片輸入,請使用參考圖片 URL 或開頭與結尾影格。 請將 input_reference 與 first_frame 及 last_frame 分開。

選擇輸入模式

使用參考圖片

input_reference 欄位僅接受可公開存取的 HTTPS 圖片 URL。單一圖片請傳送一次;多張圖片則依關鍵影格順序重複傳送。每個欄位使用一個 URL,總計最多 10 個 URL。 描述生成影片應從參考圖片保留的動作、攝影機行為及視覺細節。 本頁頂端的請求範例顯示單張圖片與多張圖片輸入。以下請求依提交順序使用兩張圖片:

設定首尾影格

傳送 first_frame 以設定開頭圖片。若也要設定結尾圖片,請加入 last_frame,並在 prompt 中描述兩個影格之間的動作。 若僅使用開頭影格,請省略 last_frame。結尾影格需要同時提供 first_frame 和 last_frame。 每個欄位接受一個可公開存取的 HTTPS URL,或一個 PNG 或 JPEG 檔案。每個欄位僅傳送一次,可使用 URL 或檔案。每個檔案必須小於或等於 20 MiB(20 × 1024 × 1024 位元組). 本頁頂端的影格範例顯示 URL 輸入和檔案上傳,並明確設定 seconds 和 size。

設定時長與尺寸

將 seconds 明確設為介於 5 到 20 的整數。 將 size 設為以下其中一個完全相符的 WxH 預設值: 尺寸值會選擇輸出解析度等級。對於文字轉影片,編碼尺寸可能會為了編解碼器對齊而調整。對於圖片轉影片,參考圖片也可能決定最終構圖和長寬比。

工作流程

1

建立工作

傳送 multipart 表單請求,並儲存傳回的 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.

最後修改於 2026年9月9日