curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": true
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": True,
},
)
print(response.json())
const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "viduq4-preview",
prompt: "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
image_urls: ["https://example.com/portrait.jpg"],
duration: 5,
resolution: "1080p",
audio: true
})
});
console.log(await response.json());
{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"status": "<string>",
"created_at": 123
}Vidu Q4 Preview
Vidu Q4 Preview 動画生成
Vidu Q4 Preview モデルで動画を生成します。画像から動画、複数参照画像から動画(参照音声対応)に対応しています
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": true
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": True,
},
)
print(response.json())
const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "viduq4-preview",
prompt: "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
image_urls: ["https://example.com/portrait.jpg"],
duration: 5,
resolution: "1080p",
audio: true
})
});
console.log(await response.json());
{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"status": "<string>",
"created_at": 123
}中国本土のユーザーへ: API エンドポイント(Base URL)には
https://toapis.cn をご利用ください。本ドキュメントの例にある https://toapis.com は https://toapis.cn に置き換えてください。- 非同期タスク API。送信後にタスク ID を返します
- 対応モデル:
viduq4-preview - 2 つの生成モード:
- 先頭フレーム画像から動画:1 枚の画像を先頭フレームとして使用
- 参照画像から動画:複数の参照画像と任意の参照音声
公開アクセス可能な画像・音声 URL を指定してください。
image_urls、reference_images、sounds に base64 データを直接渡さないでください。ローカルファイルは先に 画像アップロード API で URL を取得してください。認証
string
必須
すべてのエンドポイントで Bearer Token 認証が必要です。
Authorization: Bearer YOUR_API_KEY
リクエストパラメータ
string
必須
モデル名。
viduq4-preview 固定です。string
必須
動画プロンプト。被写体、動き、シーン、カメラワーク、スタイルを記述します。
string[]
画像 URL の配列。モードは
video_generation_mode と画像枚数で決まります:- 先頭フレームモード(デフォルト):
image_urlsに画像 URL を 1 枚だけ渡します。画像が先頭フレームになります。 - 参照モード:
video_generation_modeをreference_images_to_videoに設定し、image_urls(またはreference_images)に参照画像を渡します。
["https://example.com/first-frame.jpg"]string
生成モードセレクター。オプション:
reference_images_to_video- 複数参照画像による生成。image_urlsの複数画像を参照画像として扱います
reference_images、sounds を含むリクエストは自動的に参照画像から動画にルーティングされます。integer
デフォルト:"5"
動画の長さ(秒)。
3 から 16。string
デフォルト:"720p"
動画の解像度。オプション:
540p720p1080p2K4K
string
動画のアスペクト比。参照モードで使用します。オプション:
16:9、9:16、4:3、3:4、1:1boolean
デフォルト:"true"
動画に音声を生成するかどうか。
boolean
デフォルト:"false"
生成動画にウォーターマークを付けるかどうか。
integer
ランダムシード。同じパラメータでより再現性の高い結果を得られます。
object
拡張パラメータ。上流 API がサポートするがトップレベルフィールドとして公開されていない項目を渡します。
表示 metadata フィールドを表示
表示 metadata フィールドを表示
boolean
プロンプトを自動で拡張・最適化するかどうか。省略時の上流デフォルトは
true です。string[]
参照音声 URL の配列(参照画像から動画モードのみ)。最大 3 件。例:
["https://example.com/voice.mp3"]integer
ウォーターマーク位置。
1 から 4。watermark が true のとき有効です。string
カスタムウォーターマーク画像 URL。
watermark が true のとき有効です。string
カスタムメタデータ識別子。JSON 形式の文字列としてそのまま結果に透過されます。
string
ToAPIs 最終タスク Webhook。先に Token URL と署名シークレットを設定してください。タスク Webhooks を参照。
モード選択
| モード | トリガー方法 | 画像入力 | 音声入力 |
|---|---|---|---|
| 先頭フレーム画像から動画 | image_urls に 1 枚(デフォルト) | ちょうど 1 枚 | audio フラグのみ |
| 参照画像から動画 | video_generation_mode: "reference_images_to_video"、または複数画像 / reference_images / sounds | 最大 15 枚の参照画像 | 最大 3 件の sounds + audio フラグ |
課金単位
Vidu Q4 Preview は生成動画の秒数課金で、解像度ごとに価格が異なります:540p/720p/1080p/2K/4K- 解像度が高いほど秒単価が上がります
レスポンス
string
タスク ID。タスクステータスの照会に使用します。
string
オブジェクトタイプ。通常は
generation.task です。string
リクエストで使用されたモデル。
string
タスクステータス:
queued、in_progress、completed、failed。integer
タスク作成タイムスタンプ。
例
先頭フレーム画像から動画
{
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": true
}
参照画像から動画
{
"model": "viduq4-preview",
"prompt": "参照画像のキャラクターの一貫性を保ち、夜のネオン街を歩く",
"video_generation_mode": "reference_images_to_video",
"image_urls": [
"https://example.com/character-front.jpg",
"https://example.com/character-side.jpg"
],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "3:4",
"audio": true
}
参照音声付き参照画像から動画
{
"model": "viduq4-preview",
"prompt": "キャラクターがセリフを話し、リップシンクする",
"video_generation_mode": "reference_images_to_video",
"image_urls": ["https://example.com/character.jpg"],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"metadata": {
"sounds": ["https://example.com/voice.mp3"]
}
}
プロンプト拡張とウォーターマーク
{
"model": "viduq4-preview",
"prompt": "夕日の浜辺を歩く猫",
"image_urls": ["https://example.com/cat.jpg"],
"duration": 8,
"resolution": "2K",
"watermark": true,
"metadata": {
"is_rec": true
}
}
動画生成は非同期です。動画タスクステータスの取得 エンドポイントで進捗と結果を確認してください。
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": true
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "viduq4-preview",
"prompt": "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 5,
"resolution": "1080p",
"audio": True,
},
)
print(response.json())
const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "viduq4-preview",
prompt: "画像の人物がゆっくり振り向いて微笑む、シネマティックな照明",
image_urls: ["https://example.com/portrait.jpg"],
duration: 5,
resolution: "1080p",
audio: true
})
});
console.log(await response.json());