Veo 3 は、テキスト プロンプトから 8 秒間の 720p 動画を高忠実度で生成する Google の最先端モデルです。驚くほどリアルな映像と、ネイティブに生成された音声が特徴です。Veo 3 は、幅広いビジュアル スタイルとシネマティック スタイルに優れています。以下の例から選択して、会話、映画のようなリアリズム、クリエイティブなアニメーションを含む動画を生成する方法をご覧ください。
画像から動画を生成する
次のコードは、Imagen を使用して画像を生成し、その画像を動画の開始フレームとして使用する方法を示しています。
Python
import time
from google import genai
client = genai.Client()
prompt = "Panning wide shot of a calico kitten sleeping in the sunshine"
# Step 1: Generate an image with Imagen
imagen = client.models.generate_images(
model="imagen-3.0-generate-002",
prompt=prompt,
)
# Step 2: Generate video with Veo 2 using the image
operation = client.models.generate_videos(
model="veo-2.0-generate-001",
prompt=prompt,
image=imagen.generated_images[0].image,
)
# Poll the operation status until the video is ready
while not operation.done:
print("Waiting for video generation to complete...")
time.sleep(10)
operation = client.operations.get(operation)
# Download the video
video = operation.response.generated_videos[0]
client.files.download(file=video.video)
video.video.save("veo2_with_image_input.mp4")
print("Generated video saved to veo2_with_image_input.mp4")
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const prompt = "Panning wide shot of a calico kitten sleeping in the sunshine";
// Step 1: Generate an image with Imagen
const imagenResponse = await ai.models.generateImages({
model: "imagen-3.0-generate-002",
prompt: prompt,
});
// Step 2: Generate video with Veo 2 using the image
let operation = await ai.models.generateVideos({
model: "veo-2.0-generate-001", // Use Veo 2
prompt: prompt,
image: {
imageBytes: imagenResponse.generatedImages[0].image.imageBytes,
mimeType: "image/png",
},
});
// Poll the operation status until the video is ready
while (!operation.done) {
console.log("Waiting for video generation to complete...")
await new Promise((resolve) => setTimeout(resolve, 10000));
operation = await ai.operations.getVideosOperation({
operation: operation,
});
}
// Download the video
ai.files.download({
file: operation.response.generatedVideos[0].video,
downloadPath: "veo2_with_image_input.mp4",
});
console.log(`Generated video saved to veo2_with_image_input.mp4`);
Go
package main
import (
"context"
"log"
"os"
"time"
"google.golang.org/genai"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
prompt := "Panning wide shot of a calico kitten sleeping in the sunshine"
// Step 1: Generate an image with Imagen
imagenResponse, err := client.Models.GenerateImages(
ctx,
"imagen-3.0-generate-002",
prompt,
nil, // GenerateImagesConfig
)
if err != nil {
log.Fatal(err)
}
// Step 2: Generate video with Veo 2 using the image
operation, err := client.Models.GenerateVideos(
ctx,
"veo-2.0-generate-001",
prompt,
imagenResponse.GeneratedImages[0].Image, // Use generated image
nil, // GenerateVideosConfig
)
if err != nil {
log.Fatal(err)
}
// Poll the operation status until the video is ready
for !operation.Done {
log.Println("Waiting for video generation to complete...")
time.Sleep(10 * time.Second)
operation, _ = client.Operations.GetVideosOperation(ctx, operation, nil)
}
// Download the video
video := operation.Response.GeneratedVideos[0]
client.Files.Download(ctx, video.Video, nil)
fname := "veo2_with_image_input.mp4"
_ = os.WriteFile(fname, video.Video.VideoBytes, 0644)
log.Printf("Generated video saved to %s\n", fname)
}
動画生成のパラメータと仕様
API リクエストで設定して動画生成プロセスを制御できるパラメータは次のとおりです。
パラメータ | 説明 | Veo 3(プレビュー) | Veo 2(安定版) |
---|---|---|---|
prompt |
動画のテキストによる説明。音声キューをサポートしています。 | string |
string |
negativePrompt |
動画で避けるべき内容を説明するテキスト。 | string |
string |
image |
アニメーション化する最初の画像。 | サポート対象外 | Image オブジェクト |
aspectRatio |
動画のアスペクト比。 | "16:9" |
"16:9" 、"9:16" |
personGeneration |
人物の生成を制御します。 | "allow_all" |
"allow_all" 、"allow_adult" 、"dont_allow" |
リクエストでパラメータを設定することで、動画の生成をカスタマイズできます。たとえば、negativePrompt
を指定してモデルをガイドできます。
Python
import time
from google import genai
from google.genai import types
client = genai.Client()
operation = client.models.generate_videos(
model="veo-3.0-generate-preview",
prompt="A cinematic shot of a majestic lion in the savannah.",
config=types.GenerateVideosConfig(negative_prompt="cartoon, drawing, low quality"),
)
# Poll the operation status until the video is ready
while not operation.done:
print("Waiting for video generation to complete...")
time.sleep(10)
operation = client.operations.get(operation)
# Download the generated video
generated_video = operation.response.generated_videos[0]
client.files.download(file=generated_video.video)
generated_video.video.save("parameters_example.mp4")
print("Generated video saved to parameters_example.mp4")
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
let operation = await ai.models.generateVideos({
model: "veo-3.0-generate-preview",
prompt: "A cinematic shot of a majestic lion in the savannah.",
config: {
aspectRatio: "16:9",
negativePrompt: "cartoon, drawing, low quality"
},
});
// Poll the operation status until the video is ready
while (!operation.done) {
console.log("Waiting for video generation to complete...")
await new Promise((resolve) => setTimeout(resolve, 10000));
operation = await ai.operations.getVideosOperation({
operation: operation,
});
}
// Download the generated video
ai.files.download({
file: operation.response.generatedVideos[0].video,
downloadPath: "parameters_example.mp4",
});
console.log(`Generated video saved to parameters_example.mp4`);
Go
package main
import (
"context"
"log"
"os"
"time"
"google.golang.org/genai"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
videoConfig := &genai.GenerateVideosConfig{
AspectRatio: "16:9",
NegativePrompt: "cartoon, drawing, low quality",
}
operation, _ := client.Models.GenerateVideos(
ctx,
"veo-3.0-generate-preview",
"A cinematic shot of a majestic lion in the savannah.",
nil,
videoConfig,
)
// Poll the operation status until the video is ready
for !operation.Done {
log.Println("Waiting for video generation to complete...")
time.Sleep(10 * time.Second)
operation, _ = client.Operations.GetVideosOperation(ctx, operation, nil)
}
// Download the generated video
video := operation.Response.GeneratedVideos[0]
client.Files.Download(ctx, video.Video, nil)
fname := "parameters_example.mp4"
_ = os.WriteFile(fname, video.Video.VideoBytes, 0644)
log.Printf("Generated video saved to %s\n", fname)
}
REST
# Note: This script uses jq to parse the JSON response.
# GEMINI API Base URL
BASE_URL="https://generativelanguage.googleapis.com/v1beta"
# Send request to generate video and capture the operation name into a variable.
operation_name=$(curl -s "${BASE_URL}/models/veo-3.0-generate-preview:predictLongRunning" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X "POST" \
-d '{
"instances": [{
"prompt": "A cinematic shot of a majestic lion in the savannah."
}
],
"parameters": {
"aspectRatio": "16:9",
"negativePrompt": "cartoon, drawing, low quality"
}
}' | jq -r .name)
# Poll the operation status until the video is ready
while true; do
# Get the full JSON status and store it in a variable.
status_response=$(curl -s -H "x-goog-api-key: $GEMINI_API_KEY" "${BASE_URL}/${operation_name}")
# Check the "done" field from the JSON stored in the variable.
is_done=$(echo "${status_response}" | jq .done)
if [ "${is_done}" = "true" ]; then
# Extract the download URI from the final response.
video_uri=$(echo "${status_response}" | jq -r '.response.generateVideoResponse.generatedSamples[0].video.uri')
echo "Downloading video from: ${video_uri}"
# Download the video using the URI and API key and follow redirects.
curl -L -o parameters_example.mp4 -H "x-goog-api-key: $GEMINI_API_KEY" "${video_uri}"
break
fi
# Wait for 5 seconds before checking again.
sleep 10
done
非同期オペレーションの処理
動画の生成は、コンピューティング集約型のタスクです。リクエストを送信すると、API は長時間実行ジョブを開始し、すぐに operation
オブジェクトを返します。次に、done
ステータスが true になるまでポーリングする必要があります。これは、動画の準備ができたことを示します。
このプロセスの中心はポーリング ループです。このループは、ジョブのステータスを定期的に確認します。
Python
import time
from google import genai
from google.genai import types
client = genai.Client()
# After starting the job, you get an operation object
operation = client.models.generate_videos(
model="veo-3.0-generate-preview",
prompt="A cinematic shot of a majestic lion in the savannah.",
)
# Alternatively, you can use the operation.name to get the operation
operation = types.GenerateVideosOperation(name=operation.name)
# This loop checks the job status every 10 seconds
while not operation.done:
time.sleep(10)
# Refresh the operation object to get the latest status
operation = client.operations.get(operation)
# Once done, the result is in operation.response
# ... process and download your video ...
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
// After starting the job, you get an operation object
let operation = await ai.models.generateVideos({
model: "veo-3.0-generate-preview",
prompt: "A cinematic shot of a majestic lion in the savannah.",
});
// Alternatively, you can use the operation.name to get the operation
// operation = types.GenerateVideosOperation(name=operation.name)
// This loop checks the job status every 10 seconds
while (!operation.done) {
await new Promise((resolve) => setTimeout(resolve, 1000));
// Refresh the operation object to get the latest status
operation = await ai.operations.getVideosOperation({ operation });
}
// Once done, the result is in operation.response
// ... process and download your video ...
モデルの特徴
機能 | 説明 | Veo 3(プレビュー) | Veo 2(安定版) |
---|---|---|---|
音声 | 動画とともに音声をネイティブに生成します。 | ✔️ 常にオン | ❌ サイレントのみ |
入力モード | 生成に使用される入力のタイプ。 | Text-to-Video | テキストから動画、画像から動画 |
解決策 | 動画の出力解像度。 | 720p | 720p |
フレームレート | 動画の出力フレームレート。 | 24 fps | 24 fps |
動画の再生時間 | 生成された動画の長さ。 | 8秒 | 5 ~ 8 秒 |
リクエストあたりの動画数 | リクエストごとに生成される動画の数。 | 1 | 1 または 2 |
ステータスと詳細 | モデルの提供状況と詳細。 | プレビュー | Stable |
Veo の使用制限について詳しくは、モデル、料金、レート制限の各ページをご覧ください。
Veo プロンプト ガイド
このセクションでは、Veo を使用して作成できる動画の例と、プロンプトを変更して異なる結果を生成する方法について説明します。
安全フィルタ
Veo は Gemini 全体に安全フィルタを適用し、生成された動画やアップロードされた写真に不快なコンテンツが含まれないようにします。Google の規約とガイドラインに違反するプロンプトはブロックされます。
音声のプロンプト(Veo 3)
Veo 3 では、効果音、周囲のノイズ、会話のキューを指定できます。モデルはこれらのキューのニュアンスを捉え、同期されたサウンドトラックを生成します。
- 会話: 特定の発言には引用符を使用します。(例: 「これが鍵に違いない」と彼はつぶやいた。)
- 効果音(SFX): 音を明確に説明します。(例: タイヤのきしむ音、エンジンのうなり声など)。
- 周囲のノイズ: 環境のサウンドスケープを説明します。(例: 背景でかすかに不気味なうなり声が響く。)
これらの動画では、Veo 3 の音声生成を、詳細レベルを上げてプロンプトで指示する様子をご覧いただけます。
プロンプト | 生成された出力 |
---|---|
詳細(セリフと雰囲気) 壁に描かれた謎めいた絵をじっと見つめる 2 人の人物のクローズアップ。懐中電灯の光がちらついている。「これが鍵に違いない」と彼はつぶやき、パターンをなぞった。「でも、どういう意味?」と、彼女は首を傾げながら尋ねました。湿った石、複雑な彫刻、隠されたシンボル。背景に、かすかで不気味なハミングが響く。 |
|
詳細を減らす(会話) キャンプ(ストップ モーション): キャンパー: 「私は今、自然と一体になっている!」クマ: 「自然はパーソナル スペースを好む」。 |
|
以下のプロンプトを試して、音声を聞いてみましょう。 Veo 3 を試す
プロンプト作成の基本
適切なプロンプトは、説明的で明確です。Veo を最大限に活用するには、まずコアとなるアイデアを特定し、キーワードと修飾子を追加してアイデアを絞り込み、動画固有の用語をプロンプトに組み込みます。
プロンプトには次の要素を含める必要があります。
- 主題: 動画に含めたい物体、人物、動物、風景(街並み、自然、乗り物、子犬など)。
- アクション: 対象が行っていること(歩く、走る、頭を回すなど)。
- スタイル: SF、ホラー映画、フィルム ノワール、漫画などのアニメーション スタイルなど、特定の映画スタイルのキーワードを使用してクリエイティブの方向性を指定します。
- カメラの位置と動き: [省略可] 空撮、目の高さ、俯瞰撮影、ドリー撮影、ローアングルなどの用語を使用して、カメラの位置と動きを制御します。
- 構図: [省略可] ワイドショット、クローズアップ、シングルショット、ツーショットなど、ショットの構図。
- フォーカスとレンズ効果: [省略可] 浅いフォーカス、深いフォーカス、ソフト フォーカス、マクロ レンズ、広角レンズなどの用語を使用して、特定の視覚効果を実現します。
- 雰囲気: [省略可] 色と光がシーンにどのように貢献しているか(青いトーン、夜、暖かいトーンなど)。
プロンプトの書き方に関するその他のヒント
- わかりやすい表現を使用する: 形容詞や副詞を使用して、Veo の明確な画像を描きます。
- 顔の細部を補正する: プロンプトで「ポートレート」という単語を使用するなど、写真の焦点として顔の細部を指定します。
より包括的なプロンプト戦略については、プロンプト設計の概要をご覧ください。
プロンプトと出力の例
このセクションでは、いくつかのプロンプトを紹介し、説明的な詳細情報が各動画の結果をどのように向上させるかを示します。
アイシクル
この動画では、プロンプト作成の基本の要素をプロンプトで使用する方法について説明します。
プロンプト | 生成された出力 |
---|---|
凍った岩壁(コンテキスト)で溶けているつらら(被写体)のクローズアップ ショット(構図)。クールな青色のトーン(雰囲気)で、水滴(アクション)のクローズアップのディテールを維持しながらズームイン(カメラの動き)している。 |
|
電話中の男性
これらの動画では、より具体的な詳細情報をプロンプトに追加して、Veo が出力を好みに合わせて調整する方法を示しています。
プロンプト | 生成された出力 |
---|---|
詳細を減らす カメラがドリーして、緑色のトレンチコートを着た絶望的な表情の男のクローズアップを映す。緑色のネオンライトを背景に、ダイヤル式の壁掛け電話で話している。映画のシーンのように見えます。 |
|
詳細 緑色のネオンサインの不気味な光に照らされた、ざらざらしたレンガの壁に取り付けられたダイヤル式電話を回す、緑色のトレンチコートを着た絶望的な男を追うクローズアップの映画のようなショット。カメラがドリーインし、電話をかけようと苦労する彼の顎の緊張と顔に刻まれた絶望を映し出す。被写界深度が浅いため、眉をひそめた男性と黒いダイヤル式電話に焦点が当てられ、背景はネオンカラーと不明瞭な影の海にぼかされ、緊急性と孤立感が生まれている。 |
|
ユキヒョウ
プロンプト | 生成された出力 |
---|---|
シンプルなプロンプト: 雪豹のような毛皮を持つかわいい生き物が冬の森を歩いている、3D アニメ風のレンダリング。 |
|
詳細なプロンプト: 楽しいアニメ風の短い 3D アニメーション シーンを作成して。雪豹のような毛皮、大きな表情豊かな目、丸みを帯びた愛らしい姿をした生き物が、風変わりな冬の森を嬉しそうに跳ね回っている。丸みを帯びた雪に覆われた木々、優しく舞い落ちる雪、枝の間から差し込む暖かい日差しが映し出されている必要があります。生き物の弾むような動きと満面の笑みで、純粋な喜びを表現します。明るく陽気な色と遊び心のあるアニメーションで、明るく心温まるトーンを目指します。 |
|
ライティング要素別の例
これらの例は、基本的な要素ごとにプロンプトを調整する方法を示しています。
件名とコンテキスト
主な焦点(被写体)と背景または環境(コンテキスト)を指定します。
プロンプト | 生成された出力 |
---|---|
白いコンクリート製のアパートメント ビルの建築レンダリング。流れるような有機的な形状で、緑豊かな緑と未来的な要素がシームレスに融合している |
|
宇宙空間を漂う衛星。背景には月と星がいくつか見える。 |
|
アクション
被写体が何をしているか(歩いている、走っている、頭を回しているなど)を指定します。
プロンプト | 生成された出力 |
---|---|
ビーチを歩き、夕日の水平線を眺めて満足そうな女性をワイドショットで撮影。 |
|
スタイル
キーワードを追加して、特定の美学(シュール、ヴィンテージ、未来、フィルム ノワールなど)に沿って生成されるようにします。
プロンプト | 生成された出力 |
---|---|
フィルム ノワール風、通りを歩く男女、ミステリー、映画風、白黒。 |
|
カメラの動きと構図
カメラの動き(POV ショット、空撮、追跡ドローン ビュー)とショットのフレーミング(ワイドショット、クローズアップ、ローアングル)を指定します。
プロンプト | 生成された出力 |
---|---|
雨の中を走るクラシックカーからの POV ショット、カナダの夜、映画のような雰囲気。 |
|
街が映り込んだ目の極端なクローズアップ。 |
|
雰囲気
カラーパレットと照明はムードに影響します。「くすんだオレンジ色の暖色系」、「自然光」、「日の出」、「クールな青色系」などのキーワードを試してみてください。
プロンプト | 生成された出力 |
---|---|
公園で愛らしいゴールデン レトリバーの子犬を抱いている少女のクローズアップ、太陽光。 |
|
雨の中、バスに乗る悲しそうな女性の映画のようなクローズアップ ショット。クールな青色のトーン、悲しい雰囲気。 |
|
参照画像を使用して動画を生成する
Veo の画像から動画生成機能を使用すると、画像を動画に変換できます。
プロンプト | 生成された出力 |
---|---|
入力画像(Imagen で生成) チョコレート キャンディ バーを持ったウサギ。 |
|
出力動画(Veo 2 で生成) ウサギが逃げていく。 |
|
ネガティブ プロンプト
ネガティブ プロンプトでは、動画に含めたくない要素を指定します。
- ❌ 「なし」や「しない」などの手順を示す言葉は使用しないでください。(例: 「壁なし」)。
- ✅ 含めたくないものを記述します。(例: 「壁、フレーム」)。
プロンプト | 生成された出力 |
---|---|
ネガティブ プロンプトなし: 強い風に葉が激しく揺れる、大きな一本のオークの木を短く様式化されたアニメーションで生成して... [切り捨て] |
|
ネガティブ プロンプトあり: [同じプロンプト] ネガティブ プロンプト: 都会の背景、人工建造物、暗い、嵐、脅迫的な雰囲気。 |
|
アスペクト比
Veo では、動画のアスペクト比を指定できます。
プロンプト | 生成された出力 |
---|---|
ワイドスクリーン(16:9) 1970 年代のパーム スプリングスで、赤いオープンカーを運転する男性を追跡するドローンからの視点で撮影した動画を作成します。暖かい日差し、長い影。 |
|
縦向き(9:16 - Veo 2 のみ) 緑豊かな熱帯雨林にある雄大なハワイの滝の滑らかな動きをハイライトした動画を作成します。リアルな水の流れ、細部まで描かれた葉、自然な光に焦点を当て、静けさを表現します。流れ落ちる水、霧が立ち込める雰囲気、密生した林冠から差し込むまだら模様の陽光を捉えます。滑らかで映画のようなカメラワークで、滝とその周辺の様子を映し出します。平和で現実的なトーンを目指し、視聴者をハワイの熱帯雨林の静かな美しさに誘います。 |
|
制限事項
- リクエストのレイテンシ: 最小: 11 秒、最大: 6 分(ピーク時)。
- 地域による制限:
personGeneration: "allow_all"
(Veo 3 のデフォルト)と画像から動画への変換personGeneration
(Veo 2)は、EU、英国、スイス、中東および北アフリカの地域では使用できません。 - 動画の保持: 生成された動画は 2 日間サーバーに保存され、その後削除されます。ローカルコピーを保存するには、動画が生成されてから 2 日以内にダウンロードする必要があります。
- 透かし: Veo で作成された動画には、AI 生成コンテンツに透かしを入れて識別する Google のツールである SynthID を使用して透かしが入れられます。
- 安全性: 生成された動画は、プライバシー、著作権、バイアスのリスクを軽減するのに役立つ安全フィルタと記憶チェック プロセスを通過します。
次のステップ
- Veo クイックスタート Colab で Veo 3 を試す。
- プロンプト設計の概要で、さらに優れたプロンプトを作成する方法をご確認ください。
- 画像から動画への変換やその他の Veo 2 機能を使用する必要がある場合は、Veo 2 と移行ガイドをご覧ください。