Run Nano Banana Locally: Setup Guide and Offline Alternatives
Running Nano Banana locally means setting up a client on your own machine that communicates with Google’s cloud model through the Gemini API. The image generation itself happens on Google’s infrastructure — your computer acts as the controller, handling image uploads, prompt input, and result downloads. This setup gives you a private, scriptable interface without relying on third-party platforms or web apps.
The critical distinction: Nano Banana Pro is a closed-source model that cannot run fully offline. If you need true air-gapped image generation without any internet connection, open-source alternatives like HunyuanImage 3.0, Qwen-Image, and Z-Image can run entirely on local hardware — but with different quality characteristics and heavier GPU requirements.
What “Running Locally” Actually Means
Before diving into setup, the architecture needs to be clear. Nano Banana (Gemini 2.5 Flash Image) and Nano Banana Pro (Gemini 3 Pro Image) are closed-source models hosted on Google’s servers. When documentation says “run locally,” it means running a local client application that sends requests to the cloud API and receives results.
This local client approach provides several advantages over using the Gemini web app. Your images stay on your machine’s file system rather than being stored in Google’s cloud. You can script batch operations, integrate with existing workflows, and control exactly how images are processed. The API key authenticates your requests, and generation costs follow the same pricing as direct API access — $0.045 to $0.24 per image depending on model and resolution.
| Aspect | Local Client | Web App (Gemini) | True Offline |
|---|---|---|---|
| Internet required | Yes (API calls) | Yes | No |
| Model runs on | Google’s cloud | Google’s cloud | Your GPU |
| Privacy | Images stay on your disk | Images in Google’s cloud | Fully local |
| GPU needed | No | No | Yes (8GB+ VRAM) |
| Model quality | Nano Banana Pro/2 | Nano Banana Pro/2 | Open-source (varies) |
| Scriptable | Yes (Python/JS SDK) | No | Yes |
How to Set Up the Nano Banana Local Client
The entire setup takes under 5 minutes. You need Python installed and a Google API key — no GPU required since all computation happens in the cloud.
- Get your API key from Google AI Studio — click “Get API Key” and copy it somewhere safe
- Create a workspace and activate a Python virtual environment:
mkdir nano-client && cd nano-client
python -m venv venv
source venv/bin/activate # Mac/Linux
# .\venv\Scripts\activate # Windows
- Install the Google GenAI SDK and Pillow for image handling:
pip install google-genai pillow
- Create your generation script (save as
nano_api.py):
import os
from google import genai
from PIL import Image
client = genai.Client(api_key=os.environ["GOOGLE_API_KEY"])
response = client.models.generate_images(
model="gemini-3-pro-image",
prompt="A cinematic landscape at golden hour",
config={"number_of_images": 1}
)
for i, img in enumerate(response.images):
img.save(f"output_{i}.png")
print(f"Saved output_{i}.png")
- Set your API key as an environment variable and run:
export GOOGLE_API_KEY="your-key-here"
python nano_api.py
The script connects to Nano Banana Pro in the cloud, sends your prompt, and saves the generated image to your local file system. Every image stays on your disk — nothing is stored in Google’s cloud beyond the standard API logging.
Local GUI Applications
If you prefer a visual interface over command-line scripts, several open-source applications provide local Nano Banana interfaces that run in your browser while connecting to the API.
Nano Banana App (React/TypeScript)
An open-source image editing application built with React, Vite, and TypeScript. It provides a browser-based GUI for uploading images, writing prompts, and generating edits — all running locally on port 3500. Features include masking specific areas for targeted edits, reloading completed images for refinement passes, and controlling output resolution. Setup requires Node.js v20+ and a Gemini API key.
The Docker deployment option makes it portable across systems: build the image once and run it anywhere with a single command. This approach suits teams who want a shared local tool without installing Node.js on every machine.
ComfyUI Integration
For users already working with ComfyUI for Stable Diffusion workflows, Nano Banana Pro integrates directly as a node. Update ComfyUI to the latest version and navigate to Template, then select Nano Banana Pro. This integration lets you combine Nano Banana’s generation quality with ComfyUI’s node-based workflow system for complex multi-step pipelines.
LobeHub
An open-source all-in-one AI client with 64,900+ GitHub stars. It supports Nano Banana alongside GPT-4, Claude, and other models through a unified interface. Fully local deployment, no message limits, and a plugin ecosystem for extended functionality. Particularly suited for users who want a single client for multiple AI models rather than separate tools for each service.
True Offline Alternatives (No Internet Required)
If your use case demands fully air-gapped operation — sensitive data, restricted networks, or simply preferring zero cloud dependency — you need open-source models that run entirely on your hardware. These alternatives trade Nano Banana’s quality for complete independence from external services.
| Model | GPU Requirement | Quality Level | Offline Capable |
|---|---|---|---|
| HunyuanImage 3.0 | 12GB+ VRAM | High | Yes |
| Qwen-Image | 8GB+ VRAM | Good | Yes |
| Z-Image | 8GB+ VRAM | Good | Yes |
| GLM-Image | 12GB+ VRAM | High | Yes |
| Stable Diffusion 3.5 | 8GB+ VRAM | Good | Yes |
These models require a dedicated GPU with sufficient VRAM (minimum 8GB, 12GB+ recommended for best results) and a more involved setup process — downloading model weights (often 10-30GB), configuring inference frameworks, and managing dependencies. The trade-off is complete privacy and zero per-image cost after initial setup, but the image quality and prompt understanding generally fall below Nano Banana Pro’s level, especially for complex multi-element compositions and text rendering.
GPU VRAM Requirements for Local AI Image Models (GB)
When to Use Each Approach
Use the local API client when you want Nano Banana Pro quality with better privacy than the web app, need to script batch operations, or want to integrate image generation into existing tools. You still need internet, but images stay on your machine. Costs follow standard API pricing.
Use local GUI apps when you want a visual interface running on your machine rather than in Google’s web app. The Nano Banana App and LobeHub provide familiar editing experiences while keeping files local. Still requires internet for the API connection.
Use true offline models when you work with sensitive data that cannot touch external servers, operate in air-gapped environments, or want zero ongoing costs after setup. Expect lower quality than Nano Banana Pro and higher hardware requirements.
Our latest state of the art image model. Now you can get the advanced world knowledge, quality and reasoning you love, at the fast speed you need to bring your wildest ideas to life.
Google — Nano Banana Overview
