🎁 Free Trial
Register and get $0.5 credit toward Nano Banana Pro usage🚀 Live Demo
AI Images - Try instantly, no code requiredPrerequisites
1 Get API Key Login to YeLIn AI console to get your API key 2 Configure Billing Mode Edit token settings and select one of these billing modes (same price):- Pay-per-use Priority (Recommended): Use balance first, auto-switch when insufficient
- Pay-per-use: Direct charge per request. Best for strict budget control
请在 Console 查看对应界面截图。
Model Overview
Nano Banana Pro Edit (gemini-3-pro-image-preview) is designed for scenarios requiring precise control and high-quality output. Unlike simple filters or patches, it understands complex natural language instructions and makes logical modifications to images.
Core Capabilities
- Precise Local Editing: “Replace that cat with a dog wearing glasses, but keep the same pose”
- Perfect Style Transfer: “Transform this photo into cyberpunk-style oil painting with stronger lighting”
- Multi-Image Creative Fusion: “Combine these two images to generate a brand new poster”
- 4K HD Output: Supports 2K/4K resolution output for edited results
🌟 Core Features
- ⚡ Fast Response: ~10 seconds average for editing
- 💰 Great Value: 0.09/edit(62.50.09/edit (62.5% cheaper than official 0.09/edit(62.50.24)
- 🔄 Dual Compatibility: Supports OpenAI SDK and Google native formats
- 📐 Flexible Sizes: Google native format supports 10 aspect ratios
- 🖼️ High Resolution: Supports 1K, 2K, 4K resolution output
- 🧠 Thinking Mode: Built-in reasoning ability, understands complex editing instructions
- 🌐 Search Grounding: Supports combining real-time search data for editing
- 🎨 Multi-Image Reference: Supports up to 14 reference images for complex compositing
- 📦 Base64 Output: Returns base64 encoded image data directly
- 🔗 URL Direct Input: Google native format supports direct image URL input (overseas accessible required), no Base64 encoding needed
🔀 Two API Modes
💡 How to Choose?
- For default ratio images, use OpenAI Compatible Mode - simple and fast
- For custom aspect ratios (like 16:9, 9:16) or high-res (2K/4K), use Google Native Format
📋 Model Comparison
Comparison with Other Editing Models
Pro / Banana2 / Standard Detailed Comparison
💰 Price Advantage
- Nano Banana Pro: 0.09/edit(LaoZhangAPI)vs0.09/edit (LaoZhang API) vs 0.09/edit(LaoZhangAPI)vs0.24/edit (official), 62.5% cheaper
- Bonus: Get +10% bonus on large deposits
- Exchange Rate: Paying in CNY is even more cost-effective
🚀 Quick Start
Prerequisites
1 Create Token Login to LaoZhang API Token Management and create a pay-per-use type token(截图请在 Console 查看) 2 Select Billing Type Important: Must select “Pay-per-use” type 3 Save Token Copy the generated token in formatsk-xxxxxx
Method 1: OpenAI Compatible Mode
Single Image Edit - Curl
Single Image Edit - Python SDK
Multi-Image Compositing - Python SDK
Method 2: Google Native Format (Custom Aspect Ratio + 4K)
Authentication Methods
Google native format supports three authentication methods:Supported Resolutions
💡 How to Set Resolution
Pass
"2K" or "4K" in generationConfig.imageConfig.imageSize. Default is "1K" if not specified.
Image Input Methods
Google native format supports two image input methods: 💡 Two Methods Comparisoninline_data: Pass Base64 encoded data, suitable for local imagesfileData: Pass image URL directly, more concise (recommended for online images)
fileData.fileUri to pass image URL, the following conditions must be met:
- Image URL must be directly accessible from overseas public network
- Image server must not have anti-crawling mechanisms (e.g., Cloudflare verification, CAPTCHA, User-Agent detection)
- For images on domestic CDN or with access restrictions, use
inline_datamethod (download first, then convert to Base64)
4K HD Editing - Curl (Base64 Method)
4K HD Editing - Curl (URL Method)
UsefileData.fileUri to pass online image URL directly, no Base64 conversion needed:
- Use
fileData.fileUriinstead ofinline_data.data - Must specify
mimeType(e.g.,image/png,image/jpeg) - Optionally add
role: "user"to specify the role - Image URL must be directly accessible from overseas public network
Python Code Examples
💡 Progressive Examples Example 1 edits image → Example 2 transforms its style → Example 3 fuses both images. Clear progression! Example 1: Single Image Edit → Add Elements to First Image🎯 Editing Scenarios
1. Single Image Edit - Add Elements
2. Style Transfer
3. Multi-Image Compositing
💡 Best Practices
Edit Instruction Optimization
Multi-Image Processing Strategy
❓ FAQ
What’s the difference between Pro and Standard?
How to use 4K resolution?
4K is only supported by Nano Banana Pro, use Google native format and add
imageSize parameter:
- JPG/JPEG
- PNG
- WebP
- GIF (static)
- Recommended size: Single image ≤ 5MB
- Maximum size: ≤ 10MB
- Larger images increase processing time, recommend compressing before upload
- Nano Banana Pro: Up to 14 images
- Nano Banana: Up to 3 images
- Too many images affects quality and processing time, recommend ≤ 4
Nano Banana Pro offers exceptional value at LaoZhang API!
Does it support Chinese editing instructions?
Perfectly supported! Gemini 3 Pro has top-tier multilingual understanding. You can describe editing requirements in Chinese directly.
How to get better editing results?
- Detailed description: Provide specific editing details
- Step by step: Describe complex edits in multiple steps
- Reference style: Specify art style
- Keep subject: Clearly state what needs to be preserved
fileData.fileUri) - More concise
inline_data) - More universal
- Image URL must be directly accessible from overseas public network
- Image server must not have anti-crawling mechanisms (Cloudflare verification, CAPTCHA, etc.)
- For images on domestic CDN or with access restrictions, use Base64 method
- Images hosted on AWS S3, Google Cloud Storage, Cloudinary, etc. → Use URL
- Images on domestic servers or with access restrictions → Use Base64
🎯 Common Use Cases
- E-commerce Model Swap: Upload clothing and model photos, generate outfit effects
- Interior Design: Upload raw room photos, generate decorated results via prompt
- Game Assets: Quickly modify game icons or character appearances
- Social Media: Transform portrait photos into various art styles
- Product Display: Place products into different scene backgrounds
- Creative Posters: Fuse multiple assets to generate poster designs
🔗 Related Resources
Pro Image Generation
Learn how to generate images from text with Nano Banana ProStandard Image Editing
More affordable Nano Banana Standard editing versionToken Management
Create and manage your API tokensPricing
View detailed pricing and billing information📝 Changelog
2025-01: Google Native Format Supports URL Image Input 🔗 New fileData.fileUri Method- Support direct online image URL input, no download and Base64 encoding needed
- Added Curl and Python code examples
- Note: Image URL must be accessible from overseas public network without anti-crawling
- Added related FAQ
- Split from combined documentation into dedicated Pro version
- Complete 4K resolution editing guide
- Detailed multi-image compositing instructions
- Complete code examples and best practices
- Comparison with Nano Banana Standard