Wan 2.6 API
Alibaba の Wan 2.6 動画生成モデルの完全な API リファレンスです。
モデルバリアント {#}
この API は 2 つのモデルバリアントをサポートしています:
クイック比較
Wan 2.6 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: 'wan-2.6-text-to-video',
prompt: 'A cat playing with a ball of yarn',
duration: 5,
resolution: '1080p'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Wan 2.6 Image to Video
リクエストパラメータ
必須パラメータ
オプションパラメータ
リクエスト例
{
model_name: 'wan-2.6-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Gentle camera pan from left to right',
duration: 5,
resolution: '1080p'
}
レスポンス形式
初期レスポンス
両方のモデルはポーリング用の 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"
}
}
ポーリングレスポンス
ステータスを確認するには /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: 動画生成失敗
処理時間
一般的な処理時間:長さと解像度の設定に応じて 2-5 分。
長い動画(10-15秒)は最大 8 分かかる場合があります。
ベストプラクティス
- シーンとモーションの説明:プロンプトにシーンの内容とカメラの動きの両方を含めてください
- 解像度の選択:高速処理には 720p を、最高品質には 1080p を使用してください
- 長さの計画:長い動画はより多くのコストがかかります(秒単位の価格設定)
- オーディオ統合:
audio_url パラメータを介してカスタムオーディオを追加できます
- 画像品質:画像から動画への変換では、最良の結果を得るために高品質の入力画像を使用してください
使用例
製品デモ動画
{
model_name: 'wan-2.6-text-to-video',
prompt: 'Smooth 360-degree rotation of a luxury watch on a pedestal',
duration: 8,
resolution: '1080p'
}
アニメーションポートレート
{
model_name: 'wan-2.6-image-to-video',
image_url: 'portrait.jpg',
prompt: 'Subtle head movement, natural breathing, soft smile',
duration: 5,
resolution: '1080p'
}
オーディオ付きシーン
{
model_name: 'wan-2.6-text-to-video',
prompt: 'Ocean waves crashing on a beach at sunset',
duration: 10,
resolution: '1080p',
audio_url: 'https://example.com/ocean-sounds.mp3'
}