Flux 3動画を作成する
テキスト、参照画像、または最初と最後のフレームから、720pまたは1080pのサイズプリセットでFlux 3動画を作成します。
idを保存してタスクをポーリングし、完成した動画をダウンロードします。
POST /v1/videos multipart/form-dataを使用します。コントロールはフォームフィールドとして送信します。画像入力には、参照画像URLまたは開始フレームと終了フレームを使用します。
input_referenceは、first_frameおよびlast_frameとは分けて管理してください。
入力モードを選択する
参照画像を使用する
input_referenceフィールドで受け付けるのは、公開アクセス可能なHTTPS画像URLのみです。画像が1枚の場合は1回送信し、複数画像の場合はキーフレーム順に繰り返し送信します。各フィールドにはURLを1件ずつ指定でき、合計で最大10件のURLを指定できます。
生成する動画で参照画像から維持すべき動き、カメラの挙動、視覚的な詳細を記述します。
このページ上部のリクエストサンプルでは、単一画像および複数画像の入力を示しています。次のリクエストでは、送信した順序で2枚の画像を使用します。
最初と最後のフレームを設定する
開始画像を設定するにはfirst_frameを送信します。終了画像も設定するには、last_frameを含め、2つのフレーム間の動きをpromptで記述します。
開始フレームのみの場合は、last_frameを省略します。終了フレームには、first_frameとlast_frameの両方が必要です。
各フィールドには、公開アクセス可能なHTTPS URLを1件、またはPNGもしくはJPEGファイルを1件指定できます。各フィールドはURLまたはファイルのいずれかを使用して1回だけ送信します。各ファイルは20 MiB以下(20 × 1024 × 1024バイト).
このページ上部のフレームの例では、URL入力とファイルアップロードを示し、secondsとsizeを明示的に設定しています。
長さとサイズを設定する
secondsを、5から20までの整数として明示的に設定します。
sizeを、以下のいずれかの正確なWxHプリセット値に設定します。
タスクフロー
タスクを作成する
idを保存します。タスクをポーリングする
statusがcompletedまたはfailedになるまで繰り返します。結果をダウンロードする
completedになったら、次を呼び出します。 Flux 3動画コンテンツをダウンロードする MP4ファイルを保存します。承認
Bearer authentication. Use your CometAPI API key.
ボディ
Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.
Model ID for this route. Use flux-3.
"flux-3"Text that describes the scene, motion, camera behavior, and visual details that the video should preserve.
1Requested clip duration in whole seconds. Set seconds explicitly to an integer from 5 through 20.
5 <= x <= 20Resolution 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 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}.
Task ID. Use this value as task_id in retrieve and content requests.
"<task_id>"
Object type for the asynchronous video task.
"video"Model ID that the task uses.
"flux-3"Task lifecycle status. Poll until the value is completed or failed.
queued, in_progress, completed, failed Task progress as a coarse percentage.
0 <= x <= 100Task creation time as a Unix timestamp in seconds.
Compatibility alias for id. This field can be omitted from retrieve responses.
"<task_id>"
Task completion time as a Unix timestamp in seconds when the task provides one.
Result expiration time as a Unix timestamp in seconds when the task provides one.
Video delivery URL. This field appears on completed tasks.
"https://media.example.com/flux-3-result.mp4"
Failure details. This field appears when the task fails.