nanobanana
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNanobanana
Nanobanana
This is a guide for generating and editing images using the nanobanana CLI tool.
Nanobanana is a command-line interface for the Nano Banana image generation API, which uses Google's generative AI models.
这是一份使用nanobanana CLI工具借助生成式AI生成和编辑图片的指南。
Nanobanana是对接Nano Banana图片生成API的命令行界面,该API使用谷歌的生成式AI模型。
Installation
安装
If the nanobanana CLI is not already installed, install it using:
bash
go install maragu.dev/nanobanana@latest如果尚未安装nanobanana CLI,可通过以下命令安装:
bash
go install maragu.dev/nanobanana@latestPrerequisites
前提条件
The environment variable must be set, or a file with the key must be present in the working directory.
GOOGLE_API_KEY.env必须设置环境变量,或者在工作目录中存在包含该密钥的文件。
GOOGLE_API_KEY.envGenerating images
生成图片
To generate a single image:
bash
nanobanana generate output.png "a beautiful sunset over mountains"The output can be either a or file.
.png.jpg生成单张图片:
bash
nanobanana generate output.png "a beautiful sunset over mountains"输出文件可以是或格式。
.png.jpgUsing the pro model
使用专业版模型
To use the higher-quality pro model for generation:
bash
nanobanana generate -pro output.png "a beautiful sunset over mountains"The flag enables Google's premium generative AI model, which typically produces higher quality results but may take slightly longer to generate.
-pro若要使用更高质量的专业版模型生成图片:
bash
nanobanana generate -pro output.png "a beautiful sunset over mountains"-proEditing existing images
编辑现有图片
To edit or modify an existing image using a text prompt:
bash
nanobanana generate -i input.png output.png "make the sky purple and add stars"This is useful for making specific changes to existing images based on natural language instructions.
使用文本提示词编辑或修改现有图片:
bash
nanobanana generate -i input.png output.png "make the sky purple and add stars"这一功能可根据自然语言指令对现有图片进行特定修改,非常实用。
Tips for effective prompts
有效提示词技巧
- Be specific and descriptive about what you want in the image
- Include details about style, colors, mood, composition, and subject matter
- For edits, clearly describe what should change while the rest remains the same
- You can reference art styles, artists, or specific visual aesthetics
- 对想要的图片内容要具体且描述详尽
- 包含风格、颜色、氛围、构图和主题等细节
- 进行编辑时,清晰描述需要更改的部分,同时说明其余部分保持不变
- 可以参考艺术风格、艺术家或特定视觉美学
Examples
示例
Generate a logo:
bash
nanobanana generate logo.png "minimalist tech company logo with geometric shapes in blue and white"Create concept art:
bash
nanobanana generate concept.png "futuristic city skyline at night with neon lights and flying vehicles, cyberpunk style"Edit an existing photo:
bash
nanobanana generate -i photo.png enhanced.png "enhance the colors and make it look like golden hour"生成logo:
bash
nanobanana generate logo.png "minimalist tech company logo with geometric shapes in blue and white"创建概念艺术图:
bash
nanobanana generate concept.png "futuristic city skyline at night with neon lights and flying vehicles, cyberpunk style"编辑现有照片:
bash
nanobanana generate -i photo.png enhanced.png "enhance the colors and make it look like golden hour"