Wan 3.0 API
Alibaba の Wan 3.0 動画生成モデル向けの完全な API リファレンスです。
モデルバリエーション {#}
この API は 4 つのモデルバリエーションをサポートしています。
クイック比較
共通エンドポイント
すべての Wan 3.0 バリエーションで動画タスクエンドポイントを使用します。
POST /api/v1/video/task
共通パラメータ
必須
任意
Wan 3.0 テキストから動画
model_name を "wan-3.0-text-to-video" に設定し、共通の必須パラメータを指定します。
リクエスト例
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: 'wan-3.0-text-to-video',
prompt: 'A cinematic tracking shot follows a cyclist through a rain-soaked neon city at night',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
Wan 3.0 画像から動画
必須の画像入力
両方の画像は、アルファチャンネルを含まない JPEG、JPG、PNG、または BMP、WEBP 形式である必要があります。画像の各辺は 240~8000 ピクセルである必要があります。
リクエスト例
{
model_name: 'wan-3.0-image-to-video',
prompt: 'The camera glides forward as daylight gradually shifts into a warm evening glow',
image_url: 'https://example.com/start-frame.jpg',
image_end_url: 'https://example.com/end-frame.jpg',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
seed: 42
}
Wan 3.0 動画編集
必須の動画入力
ソース動画の再生時間と指定する出力 duration の合計は 30 秒を超えてはなりません。
リクエスト例
{
model_name: 'wan-3.0-video-edit',
prompt: 'Turn the daytime scene into a rainy evening while preserving the subject and camera movement',
video_url: 'https://example.com/source-video.mp4',
duration: 10,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
seed: 42
}
Wan 3.0 参照から動画
参照入力は任意で、組み合わせて使用できます。ただし、files と links を同時に送信することはできません。
任意の参照入力
リクエスト例
{
model_name: 'wan-3.0-reference-to-video',
prompt: 'Use the references to create a cinematic product launch with coordinated motion and sound',
duration: 12,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
images: ['https://example.com/product-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4'],
audios: ['https://example.com/sound-reference.mp3'],
links: ['https://example.com/public-creative-brief'],
seed: 42
}
ウェブページの代わりに参照ファイルを使用するには、links を省略し、files に URL を 1 件指定します。
レスポンス形式
初期レスポンス
すべてのモデルはポーリング用の 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": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
ステータス値
submitted:タスクが受け付けられ、処理を待機中
processing:動画生成を処理中
succeed:動画生成が完了
failed:動画生成に失敗
ベストプラクティス
- プロンプトの指示:被写体、動作、カメラワーク、テンポ、環境、意図するサウンドを明確に記述します。
- 画像入力:指定するアスペクト比に合った開始画像、終了画像、参照画像を使用します。PNG 画像にアルファチャンネルを含めることはできません。
- 動画編集の時間:ソースと出力の合計が 30 秒以内に収まるよう、出力時間を指定する前にソースの再生時間を確認します。
- 参照の制限:送信前に、各参照コレクションの件数、形式、寸法、合計再生時間を検証します。
- ファイルとリンク:同じリクエストで両方を使用せず、参照ファイル 1 件または公開ウェブページのリンク 1 件のいずれかを送信します。