nano-banana-videogen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Nano Banana Video Generation

Nano Banana 视频生成

Generate videos using Google Veo 3.1 models via the
nano-banana
CLI.
通过
nano-banana
CLI 使用 Google Veo 3.1 模型生成视频。

Prerequisites

前置条件

  • GEMINI_API_KEY
    environment variable must be set
  • The CLI is installed via
    npx @the-focus-ai/nano-banana
  • 必须设置
    GEMINI_API_KEY
    环境变量
  • 通过
    npx @the-focus-ai/nano-banana
    安装 CLI

Quick Reference

快速参考

bash
undefined
bash
undefined

Generate a video from text

Generate a video from text

nano-banana --video "A sunset over mountains, slow dolly-in, cinematic lighting"
nano-banana --video "A sunset over mountains, slow dolly-in, cinematic lighting"

Animate an existing image

Animate an existing image

nano-banana --video "The character slowly turns and smiles" --file portrait.png
nano-banana --video "The character slowly turns and smiles" --file portrait.png

Cost-optimized development mode

Cost-optimized development mode

nano-banana --video "Quick test scene" --video-fast --no-audio --resolution 720p
nano-banana --video "Quick test scene" --video-fast --no-audio --resolution 720p

Specify output path

Specify output path

nano-banana --video "A cat playing" --output cat-video.mp4
nano-banana --video "A cat playing" --output cat-video.mp4

Full control over settings

Full control over settings

nano-banana --video "Dramatic reveal scene"
--duration 8 --aspect 16:9 --resolution 1080p --seed 42
undefined
nano-banana --video "Dramatic reveal scene"
--duration 8 --aspect 16:9 --resolution 1080p --seed 42
undefined

Understanding Video Requests

理解视频生成需求

Before generating, clarify these video-specific aspects:
  1. Core Scene: What's the main action or subject?
  2. Camera Movement: Static, dolly, pan, tracking, crane?
  3. Style: Cinematic, documentary, commercial, casual?
  4. Audio: Dialogue? Sound effects? Ambient sounds? Music?
  5. Duration: 4, 6, or 8 seconds?
  6. Orientation: Landscape (16:9) or portrait (9:16)?
生成前,应明确以下与视频相关的要素:
  1. 核心场景:主要动作或主体是什么?
  2. 镜头运动:固定、推镜、横摇、跟拍、升降?
  3. 风格:电影化、纪录片、商业化、日常化?
  4. 音频:对白?音效?环境声?音乐?
  5. 时长:4 秒、6 秒还是 8 秒?
  6. 画幅方向:横屏(16:9)还是竖屏(9:16)?

The Five-Part Video Prompt Formula

五段式视频提示词公式

Structure prompts with these elements:
[Camera Movement] + [Subject] + [Action] + [Environment] + [Audio/Style]
Example - Weak prompt:
"a person walking"
Example - Strong prompt:
"Slow dolly-in shot. A woman in her 30s, shoulder-length wavy black hair,
green jacket, walks confidently through a sunlit park. Golden hour lighting,
warm color grading. Ambient sounds: birds chirping, distant traffic.
Cinematic, aspirational mood. No subtitles, no text overlay."
使用以下要素组织提示词:
[Camera Movement] + [Subject] + [Action] + [Environment] + [Audio/Style]
示例——薄弱提示词:
"a person walking"
示例——优质提示词:
"Slow dolly-in shot. A woman in her 30s, shoulder-length wavy black hair,
green jacket, walks confidently through a sunlit park. Golden hour lighting,
warm color grading. Ambient sounds: birds chirping, distant traffic.
Cinematic, aspirational mood. No subtitles, no text overlay."

Workflow

工作流

Step 1: Craft the Prompt

第 1 步:编写提示词

Use the prompting-guide.md for comprehensive guidance.
Key principles:
  1. Start with camera movement (dolly, pan, static, tracking)
  2. Describe subject in detail (appearance, wardrobe, expression)
  3. Specify action with timing cues
  4. Include lighting and environment
  5. Add audio design (dialogue, SFX, ambient)
  6. Always end with: "No subtitles, no text overlay, no captions"
有关全面指导,请参阅 prompting-guide.md。
核心原则:
  1. 从镜头运动开始(推镜、横摇、固定、跟拍)
  2. 详细描述主体(外貌、服装、表情)
  3. 使用时间线索说明动作
  4. 加入光线和环境
  5. 添加音频设计(对白、SFX、环境声)
  6. 始终以“No subtitles, no text overlay, no captions”(无字幕、无文字叠加、无说明文字)结尾

Step 2: Consider Cost

第 2 步:考虑成本

Video generation is significantly more expensive than images:
ModelCost per Second8-Second Video
veo-3.1-generate-001
$0.40$3.20
veo-3.1-fast-generate-001
$0.15$1.20
Development workflow:
  1. Iterate with
    --video-fast --no-audio
    (cheapest)
  2. Test with
    --video-fast
    (add audio when needed)
  3. Final render with default model (premium quality)
视频生成的成本明显高于图片生成:
模型每秒成本8 秒视频
veo-3.1-generate-001
$0.40$3.20
veo-3.1-fast-generate-001
$0.15$1.20
开发工作流:
  1. 使用
    --video-fast --no-audio
    迭代(成本最低)
  2. 使用
    --video-fast
    测试(需要时添加音频)
  3. 使用默认模型进行最终渲染(品质更高)

Step 3: Generate

第 3 步:生成

bash
nano-banana --video "your detailed prompt here"
Generation takes 2-4 minutes. Progress is shown in the terminal.
bash
nano-banana --video "your detailed prompt here"
生成过程需要 2–4 分钟,进度会显示在终端中。

Step 4: Iterate

第 4 步:迭代

If the result isn't right:
  1. Refine camera movement - Be more explicit (e.g., "slow dolly-in over 8 seconds")
  2. Add negative guidance - Describe what to avoid
  3. Simplify - Focus on one main action per clip
  4. Try different duration - 4s or 6s may work better for quick actions
如果结果不符合要求:
  1. 优化镜头运动——表达得更明确,例如“slow dolly-in over 8 seconds”
  2. 添加负面指导——描述需要避免的内容
  3. 简化提示词——每个片段聚焦一个主要动作
  4. 尝试不同时长——对于快速动作,4 秒或 6 秒可能效果更好

Commands

命令

Text-to-Video

文生视频

bash
nano-banana --video "<prompt>"
bash
nano-banana --video "<prompt>"

Image-to-Video (Animation)

图生视频(动画)

bash
nano-banana --video "<motion description>" --file <input-image>
The motion description should describe how the image should animate:
  • "The character slowly turns their head and smiles"
  • "The scene comes alive with subtle wind movement"
  • "Zoom out to reveal the full landscape"
bash
nano-banana --video "<motion description>" --file <input-image>
运动描述应说明图片应如何产生动画效果:
  • “The character slowly turns their head and smiles”
  • “The scene comes alive with subtle wind movement”
  • “Zoom out to reveal the full landscape”

Options

选项

OptionDescriptionDefault
--video
Enable video mode(required)
--video-model <name>
Veo model to useveo-3.1-generate-001
--video-fast
Use fast/cheap model(premium model)
--duration <sec>
4, 6, or 8 seconds8
--aspect <ratio>
16:9 or 9:1616:9
--resolution <res>
720p, 1080p, or 4K1080p
--audio
Generate audio(enabled)
--no-audio
Disable audio-
--seed <number>
Reproducibility seed(random)
--output <file>
Output pathoutput/video-<timestamp>.mp4
--file <image>
Input image to animate-
选项说明默认值
--video
启用视频模式(必填)
--video-model <name>
使用的 Veo 模型veo-3.1-generate-001
--video-fast
使用快速且低价的模型(高级模型)
--duration <sec>
4、6 或 8 秒8
--aspect <ratio>
16:9 或 9:1616:9
--resolution <res>
720p、1080p 或 4K1080p
--audio
生成音频(已启用)
--no-audio
禁用音频-
--seed <number>
可复现性随机种子(随机)
--output <file>
输出路径output/video-<timestamp>.mp4
--file <image>
需要制作动画的输入图片-

Camera Movement Reference

镜头运动参考

Use these terms for precise camera control:
MovementDescriptionExample Prompt
StaticNo movement"Static shot on tripod. A coffee cup steaming..."
PanHorizontal rotation"Slow pan left across the city skyline..."
TiltVertical rotation"Tilt down from face to hands..."
Dolly InCamera moves closer"Slow dolly-in from medium to close-up..."
Dolly OutCamera moves away"Dolly-out revealing the vast landscape..."
TrackingParallel to subject"Tracking shot following character walking..."
CraneSweeping vertical"Crane shot ascending from ground level..."
HandheldRealistic shake"Handheld camera, documentary style..."
Important: Use ONE primary movement per shot. Don't combine multiple movements.
使用以下术语可精确控制镜头:
运动说明示例提示词
Static(固定镜头)无运动“Static shot on tripod. A coffee cup steaming...”
Pan(横摇)水平旋转“Slow pan left across the city skyline...”
Tilt(垂直摇摄)垂直旋转“Tilt down from face to hands...”
Dolly In(推镜)相机向主体靠近“Slow dolly-in from medium to close-up...”
Dolly Out(拉镜)相机远离主体“Dolly-out revealing the vast landscape...”
Tracking(跟拍)与主体平行移动“Tracking shot following character walking...”
Crane(升降镜头)大幅垂直移动“Crane shot ascending from ground level...”
Handheld(手持镜头)真实手持晃动“Handheld camera, documentary style...”
重要提示:每个镜头只使用一种主要运动方式,不要组合多种镜头运动。

Dialogue Formatting

对白格式

For spoken dialogue, use the colon format:
Character description says: "Exact dialogue here."
Example:
"A friendly young woman, excited and cheerful, says: 'Welcome to our store!'
Standing in bright retail environment. Natural lip-sync. No subtitles."
Guidelines:
  • Keep dialogue to 6-12 words for 8 seconds
  • Describe the speaker's tone and emotion
  • Always add "No subtitles, no text overlay"
对于口头对白,请使用冒号格式:
Character description says: "Exact dialogue here."
示例:
"A friendly young woman, excited and cheerful, says: 'Welcome to our store!'
Standing in bright retail environment. Natural lip-sync. No subtitles."
指导原则:
  • 8 秒视频的对白应控制在 6–12 个单词
  • 描述说话者的语气和情绪
  • 始终添加“No subtitles, no text overlay”(无字幕、无文字叠加)

Audio Design

音频设计

Structure audio in layers:
  1. Dialogue (highest priority) - Always clear
  2. Sound Effects - Specific, timed actions
  3. Ambient - 3-5 background elements max
  4. Music - Lowest priority, "ducks under dialogue"
Example:
"Sound effects: Door closing at 2-second mark, footsteps on wood.
Ambient sounds: Quiet office hum, distant typing.
Background music: Soft jazz, low volume, ducks under dialogue."
按以下层次组织音频:
  1. 对白(最高优先级)——始终保持清晰
  2. 音效——具体且与时间点同步的动作
  3. 环境声——最多添加 3–5 个背景元素
  4. 音乐——优先级最低,应“ducks under dialogue”(在对白下方压低音量)
示例:
"Sound effects: Door closing at 2-second mark, footsteps on wood.
Ambient sounds: Quiet office hum, distant typing.
Background music: Soft jazz, low volume, ducks under dialogue."

Best Practices

最佳实践

For Better Results

提升结果质量

  1. Front-load important info - Camera, subject, action first
  2. Use cinematic terms - "35mm lens", "shallow depth of field", "golden hour"
  3. Be specific about lighting - "Soft window light from left", not just "good lighting"
  4. Describe the mood - "Intimate", "epic", "suspenseful", "uplifting"
  5. Include negative guidance - What to avoid
  1. 优先呈现重要信息——先写镜头、主体和动作
  2. 使用电影化术语——如“35mm lens”(35mm 镜头)、“shallow depth of field”(浅景深)、“golden hour”(黄金时刻)
  3. 具体描述光线——例如“Soft window light from left”,而不是只写“good lighting”
  4. 描述氛围——“Intimate”“epic”“suspenseful”“uplifting”
  5. 加入负面指导——说明需要避免的内容

For Image-to-Video

图生视频

  1. Match the image - Describe motion that fits what's in the image
  2. Start subtle - Small movements work better than dramatic changes
  3. Keep lighting consistent - Don't describe lighting changes that differ from the image
  1. 匹配图片内容——描述与图片相符的运动
  2. 从细微动作开始——小幅运动通常比剧烈变化效果更好
  3. 保持光线一致——不要描述与原图光线不符的变化

For Consistency Across Shots

保持多个镜头的一致性

When creating multiple related videos:
  1. Create a character description and reuse it exactly
  2. Keep lighting style consistent
  3. Use the same camera movement style family
  4. Use
    --seed
    for more reproducible results
创建多个相关视频时:
  1. 创建角色描述,并在所有镜头中逐字复用
  2. 保持光线风格一致
  3. 使用相同类型的镜头运动
  4. 使用
    --seed
    获得更可复现的结果

Troubleshooting

故障排查

"Video generation timeout"

“视频生成超时”

  • Generation can take 2-4 minutes
  • If persistent, try simpler prompts
  • Use
    --video-fast
    for faster generation
  • 生成可能需要 2–4 分钟
  • 如果持续超时,请尝试更简单的提示词
  • 使用
    --video-fast
    加快生成速度

Poor quality or wrong content

质量不佳或内容错误

  • Add more specific descriptions
  • Include negative guidance
  • Try the premium model instead of fast
  • 添加更具体的描述
  • 加入负面指导
  • 尝试使用高级模型而非快速模型

Subtitles appearing in video

视频中出现字幕

  • Always include "No subtitles, no text overlay, no captions" in prompt
  • Veo was trained on videos with subtitles and tends to add them
  • 始终在提示词中加入“No subtitles, no text overlay, no captions”(无字幕、无文字叠加、无说明文字)
  • Veo 的训练数据包含带字幕的视频,因此往往会生成字幕

Audio doesn't match video

音频与视频不匹配

  • Be more specific about when sounds occur
  • Use "Sound effect: X at Y-second mark"
  • Simplify audio layers (fewer elements)
  • 更具体地说明声音出现的时间
  • 使用“Sound effect: X at Y-second mark”格式
  • 简化音频层次,减少音频元素

Safety filter rejection

安全过滤器拒绝生成

  • Avoid violence, weapons, explicit content
  • Rephrase ambiguous terms
  • Try more generic descriptions
  • 避免暴力、武器和露骨内容
  • 重新表述含义模糊的词语
  • 尝试使用更通用的描述

Cost Optimization

成本优化

bash
undefined
bash
undefined

Development (cheapest): ~$1.20 per video

Development (cheapest): ~$1.20 per video

nano-banana --video "test prompt" --video-fast --no-audio --resolution 720p
nano-banana --video "test prompt" --video-fast --no-audio --resolution 720p

Testing with audio: ~$1.20 per video

Testing with audio: ~$1.20 per video

nano-banana --video "test prompt" --video-fast
nano-banana --video "test prompt" --video-fast

Production quality: ~$3.20 per video

Production quality: ~$3.20 per video

nano-banana --video "final prompt" --resolution 1080p
undefined
nano-banana --video "final prompt" --resolution 1080p
undefined

Example Prompts

示例提示词

See the examples/ directory for complete prompt examples:
  • cinematic-shots.md - Camera movements
  • dialogue-and-audio.md - Speech and sound
  • image-to-video.md - Animating images
有关完整的提示词示例,请参阅 examples/ 目录:
  • cinematic-shots.md——镜头运动
  • dialogue-and-audio.md——语音与声音
  • image-to-video.md——图片动画化

Environment Setup

环境设置

Ensure
GEMINI_API_KEY
is set:
bash
export GEMINI_API_KEY="your-api-key-here"
Or create a
.env
file in your project:
GEMINI_API_KEY=your-api-key-here
确保已设置
GEMINI_API_KEY
:
bash
export GEMINI_API_KEY="your-api-key-here"
也可以在项目中创建
.env
文件:
GEMINI_API_KEY=your-api-key-here