Gemini Image
Nano Banana, now living in your ComfyUI graph
- image1
- image2
- image3
- image4
- image5
- image6
- images
This is Google's Gemini image generation ("Nano Banana" to the internet) as a single ComfyUI node. It runs gemini-2.5-flash-image-preview, the same model behind ImageFX, and drops the result straight into your graph as a standard IMAGE. It's the node that makes you stop and ask why you're fighting a checkpoint on a 24GB card when the thing you actually want is a photorealistic render with correct text.
What it's for
Two things, really. Pure text-to-image, where Gemini 2.5 Flash Image is legitimately excellent - great at long natural-language prompts, real text rendering, and following weird compositional instructions that local models choke on. And reference-guided generation: the node accepts up to six input images alongside the prompt, which is how people use it for character consistency, style transfer, or editing existing renders without a LoRA in sight. The KB's closed-source-models essay covers why the community keeps measuring against this line of models; it's that good at things open models are still catching up on.
How it works
The node opens a google-genai client for your project, converts each optional input image to PNG bytes, and sends the whole batch - images plus prompt - to generate_content with response_modalities=["TEXT", "IMAGE"]. It pulls the returned image parts, decodes them to RGBA tensors, and hands you a batched IMAGE. The seed input is forwarded to the API so you can reproduce a result, which the Gemini image model honors well enough for iteration.
Inputs that matter
- project_id - your GCP project. location defaults to
global, which is unusual for this pack (the Imagen and Veo nodes default tous-central1). Leave it unless you know your project restricts Gemini to a region. - prompt - multiline, and this model rewards plain descriptive sentences over tag soup.
- seed - reproducibility, defaulting to a random value per new node.
- image1 through image6 - optional reference images. Feed it a character sheet and it'll keep that character through new scenes.
The output is images, a standard IMAGE tensor - wire it into any preview, save, or further image-processing node. No custom output type to learn.
Installing
Standard pack install. ComfyUI Manager → search "Vertex AI", or:
cd ComfyUI/custom_nodes
git clone https://github.com/khanhlvg/vertex-ai-comfyui-nodes.git
cd vertex-ai-comfyui-nodes
pip install -r requirements.txt
Then the pack-wide auth ritual - gcloud auth application-default login, plus GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION exported or typed into the node. The google-genai dependency handles the API call. No model files, no VRAM, just a billing-enabled project with the Gemini API on.
Where people get burned
- "No valid images were returned" is the node's way of telling you the safety filters ate your request. The prompt is the problem, not the setup.
- You need billing. This is a paid API, per-image pricing, and there's no free tier that'll cover serious iteration. The image generation has a baked-in invisible watermark, too - fine for most work, relevant if you're selling.
- Location trips people up. If your project's Gemini access is pinned to a specific region, the
globaldefault can fail with a permission error. Set it explicitly.
One nice detail: because it emits ordinary IMAGE, you can chain a local upscaler or a detail pass after Gemini output. Cloud generation for the hard part, local tools for the polish.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| project_id | STRING | — | |
| location | STRING | global | — |
| prompt | STRING | A beautiful landscape painting. | — |
| model_name | COMBO | 1 options: gemini-2.5-flash-image-preview | |
| seed | INT | 21345688130–2147483647 | — |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |