π BananaForge Text β Image
Gemini's image model, inside ComfyUI β no GPU required
- IMAGE
If you've seen "Nano Banana" output all over social media - Google's rebrand of Gemini-native image generation, technically stunning and aggressively censored - this node is how you call the same model without leaving ComfyUI. It's a thin wrapper around the Gemini API. No local checkpoint, no diffusion steps on your GPU, no model download. Just a prompt, an API key, and Google's servers do the heavy lifting.
That last part is the whole pitch, honestly. You can run this on a laptop with no GPU, because the actual generation happens in Google's cloud. The trade is that you're paying per image (or staying inside the free tier) and you inherit every guardrail Google ships - more on that in a minute.
How it works
The node takes your text prompt and POSTs it to {api_url}/models/{model_name}:generateContent (that's the Google Generative Language API, with the default URL already filled in). The response is a base64-encoded image, which the node decodes into a normal ComfyUI IMAGE tensor. It even appends a little settings hint to your prompt - [Image settings: aspect ratio 1:1] - as well as passing the ratio to the API's imageConfig.
Under the hood there are three retries with exponential backoff for transient connection errors, and a 300-second timeout, so flaky networks don't nuke your run with one bad request. Every step logs to the ComfyUI console with a π prefix, which makes it easy to see what the node actually sent.
The default model is gemini-3-pro-image-preview, which is Nano Banana Pro: 4K native output, "thinking mode," genuinely the flagship. You can swap to gemini-2.5-flash-image (plain Nano Banana) if you want something faster and friendlier to the free tier. Worth knowing: image_size (2K/4K) only actually takes effect when the model name contains "pro" - the code checks for that string, so don't expect 4K out of the flash model.
The inputs that matter
- api_key - paste your key from Google AI Studio, or set
use_env_filetoyesand drop a.envnext to the node files. The code readsAPI_KEY/GEMINI_API_KEYfrom it. - model_name - defaults to the Pro preview; change to the flash model for cheaper/faster.
- prompt - the actual description. Make it specific; the API is prompt-sensitive in a different way than local diffusion.
- aspect_ratio - 1:1, 16:9, 9:16, 4:3, 3:4.
- image_size - default, 2K, or 4K (Pro only, as above).
- wait_seconds - a sleep before the API call, your first line of defense against rate limits.
The single output is IMAGE, which you can wire straight into a Save Image node or pass onward for upscaling/VAE-free use. No negatives, no seed - you don't control sampling here; Gemini handles all of that.
Installing it
The whole pack is three nodes (TextβImage, ImageβImage, Batch) under one install:
cd ComfyUI/custom_nodes
git clone https://github.com/peter119lee/ComfyUI-BananaForge
Restart ComfyUI and you'll find them under the Banana Forge category. ComfyUI Manager users can just search "BananaForge." There's a requirements.txt, but it's essentially empty - the node only needs standard-library urllib plus torch/numpy/PIL, which ComfyUI already ships. No model files to fetch, no GPU requirements.
Where people get burned
- "API key cannot be empty" - you forgot the key or the
.envisn't in the node's folder. The.envmust live incustom_nodes/ComfyUI-BananaForge/, not your ComfyUI root. - "Content blocked by safety filters" - this is the big one. Gemini image generation is famously censored: "powerful, unimaginative, massive hidden biasing" is how one r/StableDiffusion thread put it, and Google tightened IMAGE_SAFETY filtering further in early 2026. If the model refuses, the node surfaces the block reason. Reword the prompt; this model isn't the one to fight filters with.
- Rate limits - the free tier throttles fast. Bump
wait_secondsto 2β5s between runs. - "No image in response" / "No candidates" - the model string you typed doesn't exist or got renamed. Google churns preview model names; check the current
gemini-*-image-previewname before blaming the node.
One more note: the repo's author renamed their GitHub account from peter119lee to Rinne414, so you'll see both URLs around. They're the same codebase - GitHub redirects the old one.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| api_url | STRING | https://generativelanguage.googleapis.com/v1beta | API base URL |
| api_key | STRING | API key (leave empty to use .env file) | |
| use_env_file | COMBO | no | Load API key from .env file |
| model_name | STRING | gemini-3-pro-image-preview | Model name |
| prompt | STRING | A beautiful landscape | Text prompt for image generation |
| aspect_ratio | COMBO | 1:1 | Output aspect ratio |
| image_size | COMBO | default | Output resolution |
| wait_seconds | FLOAT | 0.00β60 | Wait time before API call (to avoid rate limits) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |