FL Gemini Image Editor
FL_GeminiImageEditor — generate and edit images with Google Gemini (Nano Banana) from ComfyUI
- image1
- image2
- image3
- image4
- image
- API Respond
This node puts Google's Gemini image model inside your ComfyUI graph. You type an instruction, optionally hand it up to four reference images, and it generates or edits an image by calling Google's API. The current default model, gemini-2.5-flash-image, is the one the community knows as "Nano Banana" - the instruction-editing model that got very good at "change this, keep the vibe."
The thing to be clear-eyed about: this runs in the cloud, not on your GPU. No VRAM, no local weights, no model download - but you need a Google API key, and every generation costs money on Google's side. It's a bridge from your local ComfyUI workflow out to a hosted model and back, which is a genuinely useful thing to have when the hosted model does something your local stack can't, but it's a different animal from a Flux or SDXL node.
Where it fits
Instruction-editing models like this took over a big chunk of what people used to inpaint by hand. Ask in a sentence - "remove the sign," "make it night," "put her in a red coat" - and it reasons about what belongs there. The catch, same as every model in this class, is that it takes the whole image as context and emits a whole new image, so pixels you didn't ask to change can drift. If you need the rest of the frame byte-identical, you still want masked inpainting. If you want fast, smart, describe-it-and-go edits, this is the easy button.
The inputs and outputs
prompt(multiline) - your instruction. Write it like a directive, not a caption.api_key- your Google AI Studio / Gemini API key.model- the Gemini variant;models/gemini-2.5-flash-imageis the sensible default. Others in the list are preview/older variants your key may or may not have access to.image1–image4(optional) - up to four reference images to edit or compose from.aspect_ratio,image_size(1K/2K/4K),temperature,batch_size(1–8) - output shape, resolution, randomness, and how many to make per call.
Outputs: image (a list of generated images) and API Respond (the raw API response text) - that second one is your friend when something fails, because the error usually lands there.
How to install it
Part of filliptm's Fill-Nodes pack. ComfyUI Manager → search ComfyUI_Fill-Nodes → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
pip install -r ComfyUI_Fill-Nodes/requirements.txt
No weights to download. You do need a Gemini API key from Google AI Studio, and the account behind it needs image-generation access and billing set up.
Common issues & troubleshooting
Auth errors / the model 404s. Two common causes: an invalid or unpermissioned key, or a model your key can't reach. The image-generation Gemini variants roll in and out of preview and are access- and region-gated, so a model that works for someone else may not be enabled on your key. Check the API Respond output - the real reason is almost always spelled out there.
Empty output or a silent fail. Read API Respond first, every time, before assuming the node is broken. Rate limits, safety blocks, and quota exhaustion all show up as a message there rather than a friendly node error.
Unmasked stuff changed. That's the edit-model tax, not a bug - it re-emits the whole image. If you need the untouched parts preserved exactly, crop-and-stitch the region and edit only that, or use a masked inpainting path instead.
It costs real money. Each call bills to your Google account, and 2K/4K at batch_size 8 adds up quicker than you'd think. Prototype at 1K and small batches.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_key | STRING | — | |
| model | COMBO | models/gemini-2.5-flash-image | 5 options: models/gemini-2.0-flash-exp, models/gemini-2.0-flash-preview-image-generation, models/gemini-2.5-flash-image-preview, models/gemini-2.5-flash-image, models/gemini-3-pro-image-preview |
| aspect_ratio | COMBO | 1:1 | 10 options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, +4 |
| image_size | COMBO | 1K | Resolution size (2K/4K only supported by gemini-3-pro-image-preview) |
| always_square | BOOLEAN | false | — |
| temperature | FLOAT | 1.000–2 | — |
| max_retries | INT | 31–5 | — |
| batch_size | INT | 11–8 | — |
| seedopt | INT | 666666660–66666666 | — |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| API Respond | STRING | — |