nano-banana-videogen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNano Banana Video Generation
Nano Banana 视频生成
Generate videos using Google Veo 3.1 models via the CLI.
nano-banana通过 CLI 使用 Google Veo 3.1 模型生成视频。
nano-bananaPrerequisites
前置条件
- environment variable must be set
GEMINI_API_KEY - The CLI is installed via
npx @the-focus-ai/nano-banana
- 必须设置 环境变量
GEMINI_API_KEY - 通过 安装 CLI
npx @the-focus-ai/nano-banana
Quick Reference
快速参考
bash
undefinedbash
undefinedGenerate 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
--duration 8 --aspect 16:9 --resolution 1080p --seed 42
undefinednano-banana --video "Dramatic reveal scene"
--duration 8 --aspect 16:9 --resolution 1080p --seed 42
--duration 8 --aspect 16:9 --resolution 1080p --seed 42
undefinedUnderstanding Video Requests
理解视频生成需求
Before generating, clarify these video-specific aspects:
- Core Scene: What's the main action or subject?
- Camera Movement: Static, dolly, pan, tracking, crane?
- Style: Cinematic, documentary, commercial, casual?
- Audio: Dialogue? Sound effects? Ambient sounds? Music?
- Duration: 4, 6, or 8 seconds?
- Orientation: Landscape (16:9) or portrait (9:16)?
生成前,应明确以下与视频相关的要素:
- 核心场景:主要动作或主体是什么?
- 镜头运动:固定、推镜、横摇、跟拍、升降?
- 风格:电影化、纪录片、商业化、日常化?
- 音频:对白?音效?环境声?音乐?
- 时长:4 秒、6 秒还是 8 秒?
- 画幅方向:横屏(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:
- Start with camera movement (dolly, pan, static, tracking)
- Describe subject in detail (appearance, wardrobe, expression)
- Specify action with timing cues
- Include lighting and environment
- Add audio design (dialogue, SFX, ambient)
- Always end with: "No subtitles, no text overlay, no captions"
有关全面指导,请参阅 prompting-guide.md。
核心原则:
- 从镜头运动开始(推镜、横摇、固定、跟拍)
- 详细描述主体(外貌、服装、表情)
- 使用时间线索说明动作
- 加入光线和环境
- 添加音频设计(对白、SFX、环境声)
- 始终以“No subtitles, no text overlay, no captions”(无字幕、无文字叠加、无说明文字)结尾
Step 2: Consider Cost
第 2 步:考虑成本
Video generation is significantly more expensive than images:
| Model | Cost per Second | 8-Second Video |
|---|---|---|
| $0.40 | $3.20 |
| $0.15 | $1.20 |
Development workflow:
- Iterate with (cheapest)
--video-fast --no-audio - Test with (add audio when needed)
--video-fast - Final render with default model (premium quality)
视频生成的成本明显高于图片生成:
| 模型 | 每秒成本 | 8 秒视频 |
|---|---|---|
| $0.40 | $3.20 |
| $0.15 | $1.20 |
开发工作流:
- 使用 迭代(成本最低)
--video-fast --no-audio - 使用 测试(需要时添加音频)
--video-fast - 使用默认模型进行最终渲染(品质更高)
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:
- Refine camera movement - Be more explicit (e.g., "slow dolly-in over 8 seconds")
- Add negative guidance - Describe what to avoid
- Simplify - Focus on one main action per clip
- Try different duration - 4s or 6s may work better for quick actions
如果结果不符合要求:
- 优化镜头运动——表达得更明确,例如“slow dolly-in over 8 seconds”
- 添加负面指导——描述需要避免的内容
- 简化提示词——每个片段聚焦一个主要动作
- 尝试不同时长——对于快速动作,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
选项
| Option | Description | Default |
|---|---|---|
| Enable video mode | (required) |
| Veo model to use | veo-3.1-generate-001 |
| Use fast/cheap model | (premium model) |
| 4, 6, or 8 seconds | 8 |
| 16:9 or 9:16 | 16:9 |
| 720p, 1080p, or 4K | 1080p |
| Generate audio | (enabled) |
| Disable audio | - |
| Reproducibility seed | (random) |
| Output path | output/video-<timestamp>.mp4 |
| Input image to animate | - |
| 选项 | 说明 | 默认值 |
|---|---|---|
| 启用视频模式 | (必填) |
| 使用的 Veo 模型 | veo-3.1-generate-001 |
| 使用快速且低价的模型 | (高级模型) |
| 4、6 或 8 秒 | 8 |
| 16:9 或 9:16 | 16:9 |
| 720p、1080p 或 4K | 1080p |
| 生成音频 | (已启用) |
| 禁用音频 | - |
| 可复现性随机种子 | (随机) |
| 输出路径 | output/video-<timestamp>.mp4 |
| 需要制作动画的输入图片 | - |
Camera Movement Reference
镜头运动参考
Use these terms for precise camera control:
| Movement | Description | Example Prompt |
|---|---|---|
| Static | No movement | "Static shot on tripod. A coffee cup steaming..." |
| Pan | Horizontal rotation | "Slow pan left across the city skyline..." |
| Tilt | Vertical rotation | "Tilt down from face to hands..." |
| Dolly In | Camera moves closer | "Slow dolly-in from medium to close-up..." |
| Dolly Out | Camera moves away | "Dolly-out revealing the vast landscape..." |
| Tracking | Parallel to subject | "Tracking shot following character walking..." |
| Crane | Sweeping vertical | "Crane shot ascending from ground level..." |
| Handheld | Realistic 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:
- Dialogue (highest priority) - Always clear
- Sound Effects - Specific, timed actions
- Ambient - 3-5 background elements max
- 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."按以下层次组织音频:
- 对白(最高优先级)——始终保持清晰
- 音效——具体且与时间点同步的动作
- 环境声——最多添加 3–5 个背景元素
- 音乐——优先级最低,应“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
提升结果质量
- Front-load important info - Camera, subject, action first
- Use cinematic terms - "35mm lens", "shallow depth of field", "golden hour"
- Be specific about lighting - "Soft window light from left", not just "good lighting"
- Describe the mood - "Intimate", "epic", "suspenseful", "uplifting"
- Include negative guidance - What to avoid
- 优先呈现重要信息——先写镜头、主体和动作
- 使用电影化术语——如“35mm lens”(35mm 镜头)、“shallow depth of field”(浅景深)、“golden hour”(黄金时刻)
- 具体描述光线——例如“Soft window light from left”,而不是只写“good lighting”
- 描述氛围——“Intimate”“epic”“suspenseful”“uplifting”
- 加入负面指导——说明需要避免的内容
For Image-to-Video
图生视频
- Match the image - Describe motion that fits what's in the image
- Start subtle - Small movements work better than dramatic changes
- Keep lighting consistent - Don't describe lighting changes that differ from the image
- 匹配图片内容——描述与图片相符的运动
- 从细微动作开始——小幅运动通常比剧烈变化效果更好
- 保持光线一致——不要描述与原图光线不符的变化
For Consistency Across Shots
保持多个镜头的一致性
When creating multiple related videos:
- Create a character description and reuse it exactly
- Keep lighting style consistent
- Use the same camera movement style family
- Use for more reproducible results
--seed
创建多个相关视频时:
- 创建角色描述,并在所有镜头中逐字复用
- 保持光线风格一致
- 使用相同类型的镜头运动
- 使用 获得更可复现的结果
--seed
Troubleshooting
故障排查
"Video generation timeout"
“视频生成超时”
- Generation can take 2-4 minutes
- If persistent, try simpler prompts
- Use for faster generation
--video-fast
- 生成可能需要 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
undefinedbash
undefinedDevelopment (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
undefinednano-banana --video "final prompt" --resolution 1080p
undefinedExample 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 is set:
GEMINI_API_KEYbash
export GEMINI_API_KEY="your-api-key-here"Or create a file in your project:
.envGEMINI_API_KEY=your-api-key-here确保已设置 :
GEMINI_API_KEYbash
export GEMINI_API_KEY="your-api-key-here"也可以在项目中创建 文件:
.envGEMINI_API_KEY=your-api-key-here