Seedance 2.5 Flash API
ByteDance の動画生成モデル Seedance 2.5 Flash の API リファレンスです。
モデルの種類
この API は次の 3 種類のモデルに対応しています。
機能比較
対応するアスペクト比
テキストからの生成と参照素材からの生成では次の比率を指定できます。
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
画像からの生成では aspect_ratio パラメータは使用できません。
選択可能な解像度
Seedance 2.5 Flash Text to Video
エンドポイント {#}
POST /api/v1/video/task
リクエストパラメータ
必須
任意
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'seedance-v2.5-flash-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
resolution: '720p',
duration: 8,
aspect_ratio: '16:9',
sound: true
})
});
const { data } = await response.json();
const taskId = data.task_id;
Seedance 2.5 Flash Image to Video
リクエストパラメータ
必須
任意
画像から動画を生成するリクエストに aspect_ratio を含めないでください。このモデルはこのパラメータに対応していません。
リクエスト例
{
model_name: 'seedance-v2.5-flash-image-to-video',
image_url: 'https://example.com/first-frame.jpg',
image_end_url: 'https://example.com/last-frame.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
resolution: '720p',
duration: 8,
sound: true
}
Seedance 2.5 Flash Reference to Video
リクエストパラメータ
必須
参照メディア
参照メディアはすべて任意です。画像のみ、動画のみ、音声のみ、または参照メディアなしのリクエストにも対応しています。参照素材を使わない場合はテキストからの動画生成を推奨します。
@ (AT) 参照用プレースホルダー
@ (AT) 参照機能では番号付きの <<<...>>> プレースホルダーで参照メディアをプロンプトに関連付けます。番号はメディアの種類ごとに 1 から始まり、対応する配列の順序に従います。
例えば最初の画像が人物、2 枚目が場面の参照画像であれば、prompt 内で人物を <<<image_1>>>、場面を <<<image_2>>> と指定します。各プレースホルダーは対応する配列に存在する要素を指す必要があります。
任意
リクエスト例
{
model_name: 'seedance-v2.5-flash-reference-to-video',
prompt: 'Use image one for the subject, video one for the movement, and audio one for the atmosphere',
resolution: '720p',
duration: 8,
aspect_ratio: '16:9',
sound: true,
images: ['https://example.com/subject-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4'],
audios: ['https://example.com/atmosphere-reference.mp3']
}
@ (AT) 参照を使った動画生成のリクエスト例
{
model_name: 'seedance-v2.5-flash-reference-to-video',
prompt: 'Place the explorer from <<<image_1>>> in the environment from <<<image_2>>>, following the camera movement in <<<video_1>>> and speaking with the reference voice from <<<audio_1>>>',
resolution: '720p',
duration: 10,
aspect_ratio: '16:9',
sound: true,
images: [
'https://example.com/explorer-reference.jpg',
'https://example.com/environment-reference.png'
],
videos: ['https://example.com/camera-movement-reference.mp4'],
audios: ['https://example.com/voice-reference.mp3']
}
メディアの制限
以下の制限は、このページのモデルで使用する開始フレーム画像、終了フレーム画像、参照メディアに適用されます。
参照音声と参照動画の合計時間の上限はそれぞれ別に 30 秒です。件数も個別に数え、画像は最大 10 枚、動画は最大 5 本、音声は最大 5 件です。
すべてのモデルで resolution と duration は必須で、既定値はありません。テキストからの生成と参照素材からの生成では aspect_ratio を省略すると 16:9 になります。音声生成の既定値は true です。無音にするには false を指定してください。
レスポンス形式
初回のレスポンス
すべてのモデルがポーリング用の task_id を返します。
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
ポーリングのレスポンス
GET /api/v1/video/{taskId} を定期的に呼び出してステータスを確認します。
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"credit": 0.2,
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
ステータスの値
submitted:タスクを受け付け、処理を待機中
processing:動画を生成中
succeed:動画の生成が完了
failed:動画の生成に失敗
処理時間
処理時間は動画の長さ、解像度、現在のキューの状況によって変わります。
5~10 秒間隔でポーリングしてステータスを確認してください。
推奨事項
- 必須パラメータ:
prompt、resolution、duration は必ず指定してください。テキストからの生成と参照素材からの生成では aspect_ratio は任意で、既定値は 16:9 です
- 画像から生成する動画の比率:画像から動画を生成するリクエストには
aspect_ratio を含めないでください
- 参照動画:動画は任意です。各動画の長さと合計時間を上記の制限内に収めてください
- 参照画像:動画や音声の有無にかかわらず画像は任意です。対応形式の画像 URL は最大 10 件指定できます
- 参照音声:各音声は 2~30 秒かつ 15 MB 以下、合計時間は 30 秒以内にしてください
- 参照順序:
images、videos、audios の要素を意図した順序で並べ、プロンプトでもその順序に従って参照してください
- 音声:
sound を省略すると既定値の true が適用されます。音声生成を無効にするには false を指定してください