Vidu動画を作成する
POST /v1/videos を使用して、CometAPI 経由で Vidu Q3 または Q4 の動画タスクを作成します。テキストから動画または画像から動画には Q3 を、画像から動画または参照画像から動画には Q4 を使用します。その後、タスクをポーリングして、完了した MP4 ファイルをダウンロードします。
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F model=viduq3-turbo \
-F 'prompt=An astronaut walks through soft blue fog with a slow cinematic camera move.' \
-F seconds=1{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "viduq3-turbo",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}viduq4-preview は、画像から動画および参照画像から動画のタスクを作成します。API は直ちにタスク ID を返すため、返された id を保存し、ターミナルステータスに達するまでタスクをポーリングしてください。
POST /v1/videos multipart/form-data を使用します。スカラー制御はフォームフィールドとして、参照画像は input_reference フィールドとして送信します。
入力モードを選択する
| 目的 | モデル ID | 必須フィールド | 任意フィールド |
|---|---|---|---|
| テキストから動画 | viduq3, viduq3-turbo | model, prompt | seconds, size |
| 画像から動画 | viduq3, viduq3-turbo | model, prompt、input_reference ファイル1つ | seconds, size |
| 画像から動画 | viduq4-preview | model, prompt、input_reference ファイル1つまたは HTTPS 画像 URL | seconds, size |
| 参照画像から動画 | viduq4-preview | model, prompt, 2–12 input_reference HTTPS 画像 URL | seconds, size, reference_audios |
viduq4-preview reference_audios はリクエストからモードを選択します。参照音声なしの参照画像1枚では、画像から動画タスクが作成されます。参照画像が2枚以上ある場合、または参照画像1枚に加えて参照音声がある場合は、参照画像から動画タスクが作成されます。
viduq3 または viduq3-turbo が API キーで利用可能か確認するには、次を使用します 利用可能なモデルを一覧表示する.
参照画像を使用する
Q3 の画像から動画では、input_reference マルチパートフィールドを通じて参照画像を1枚アップロードします。ファイルは最大 20 MB です。
画像は生成される動画の構図と見た目を導きます。プロンプトを使用して、動画で保持すべき動き、カメラの挙動、詳細を説明します。
viduq4-preview の画像から動画では、アップロードしたファイルとして、または input_reference 内の一般公開された HTTPS URL として画像を1枚送信します。動画はこの画像から開始され、そのアスペクト比を維持します。
viduq4-preview の参照画像から動画では、一般公開された HTTPS 画像 URL を2~12件送信します。画像ごとに input_reference を1回繰り返し、各 URL をそれぞれ独自のフィールドで送信します。PNG、JPEG、または WEBP 画像を使用してください。
プロンプトでは、リクエスト内の順序で参照画像を指定します。@1 は最初の input_reference 画像、@2 は2番目の画像です。以降も同様です。例: The pink car from @1 drives across the snowy hill from @2.
参照音声を追加する
viduq4-preview の参照画像から動画では、reference_audios により音声参照を追加します。長さがそれぞれ3~12秒の、一般公開された MP3 クリップの HTTPS URL を最大3件送信し、クリップごとに reference_audios を1回繰り返します。同じリクエストで少なくとも1枚の input_reference 画像を送信してください。
期間とサイズを設定する
| モデルID | seconds | デフォルト |
|---|---|---|
viduq3-turbo | 整数 1-16 | 5 秒、 1280x720 |
viduq3 | 整数 1-16 | 5 秒、 1280x720 |
viduq4-preview | 整数 3-16 | 5 秒、 1280x720 |
size を以下のWxH値のいずれかに設定します。
| 解像度ティア | アスペクト比 | size (WxH) |
|---|---|---|
540p | 16:9 | 960x528 |
720p | 16:9 | 1280x720 |
1080p | 16:9 | 1920x1080 |
viduq4-preview では、size を以下のWxH値のいずれかに設定します。reference-to-videoでは、size がフレーム形状を設定します。image-to-videoでは、出力は入力画像のアスペクト比を維持します。
| 解像度ティア | アスペクト比 | size (WxH) |
|---|---|---|
720p | 16:9 (デフォルト) | 1280x720 |
720p | 9:16 | 720x1280 |
720p | 1:1 | 960x960 |
720p | 4:3 | 1104x816 |
720p | 3:4 | 816x1104 |
viduq4-preview 動画には生成されたオーディオトラックが含まれます。
タスクフロー
タスクを作成する
id を保存します。タスクをポーリングする
status が completed、failed、または error になるまで呼び出します。結果をダウンロードする
completed になったら、次のエンドポイント「 Vidu動画コンテンツを取得 」を呼び出して、MP4ファイルをダウンロードします。ボディ
Text prompt that describes the video to generate. For image-to-video, describe the motion and camera behavior that should animate the reference image. For viduq4-preview reference-to-video, refer to reference images as @1, @2, and so on, in the order of the input_reference fields. Up to 5000 characters for viduq4-preview.
"An astronaut walks through soft blue fog with a slow cinematic camera move."
Output size as WxH. Supported WxH size values for viduq3 and viduq3-turbo: 960x528, 1280x720, 1920x1080. Supported WxH size values for viduq4-preview: 1280x720, 720x1280, 960x960, 1104x816, 816x1104. Default is 1280x720. For viduq4-preview reference-to-video, size sets the frame shape. For viduq4-preview image-to-video, the output keeps the aspect ratio of the input image.
Reference images. For Q3 image-to-video, upload one image file up to 20 MB. For viduq4-preview image-to-video, send one image file or one publicly accessible HTTPS image URL. For viduq4-preview reference-to-video, send 2-12 publicly accessible HTTPS image URLs by repeating input_reference once per image. Use PNG, JPEG, or WEBP images. Omit this field for text-to-video.
Voice references for viduq4-preview reference-to-video. Send up to 3 publicly accessible HTTPS URLs of MP3 clips, each 3-12 seconds long, by repeating reference_audios once per clip. Send at least one input_reference image in the same request.
^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" \
-F model=viduq3-turbo \
-F 'prompt=An astronaut walks through soft blue fog with a slow cinematic camera move.' \
-F seconds=1{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "viduq3-turbo",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}