NanoBanana - Vision Analysis
Ask Gemini what's actually in your image — up to four at once
- ref_image_1
- ref_image_2
- ref_image_3
- ref_image_4
- network
- text
Vision is the pack's general-purpose "describe or interrogate this image" node. You feed it one to four ComfyUI images, ask a question, and get text back from Gemini - captions, style analysis, subject detail, "what's wrong with this render," or a natural-language description to hand to a downstream prompt. If you've been captioning locally with a weak clip model, the gap in quality is immediate: Gemini sees composition, lighting, and small details the way a person would.
It defaults to gemini-3.1-flash-lite-preview - the cheap, fast member of the lineup - which is the right call for captioning. The prompt defaults to "Describe this image." You can push it as hard as you want from there.
How it works
It encodes each input image and sends them alongside your prompt to generate_content with the TEXT modality. By default images go out as JPEG; there's a lossless toggle that switches to PNG. That toggle exists for a concrete reason: JPEG artifacts smear small text and fine detail, which measurably hurts OCR and fine-grained tasks. Flip it on for screenshots, dense documents, or any image where you're reading characters - just know PNG is chunkier over the wire, so it's a bandwidth-for-accuracy trade.
The pack's shared machinery applies: retry with jittered backoff, key redaction, always re-execute. Worth remembering that re-execute part - every run is a billed vision call.
The inputs
- api_key, model (35 options, default the flash-lite preview), custom_model - the standard set.
- prompt - what to ask about the image(s).
- system_instruction - guide the analysis, e.g. "describe only the subject, not the style."
- temperature - default 0.1; low is right for analysis, raise it for creative interpretation.
- lossless - PNG vs JPEG encoding.
- ref_image_1 through ref_image_4 - up to four IMAGE inputs.
Output: one text STRING. Feed it into a ShowText node, a prompt refiner, a TextGen node, or a condition that branches your workflow.
Installing it
ComfyUI Manager → search NanoBanana2, or
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-NanoBanana2
pip install google-genai
Python 3.10+, google-genai >= 0.8.0, API key from aistudio.google.com. No model files.
Where people get burned
Vague prompts give vague captions - "describe this image" is fine, but asking for structured output ("list the objects left to right, then the lighting") returns something you can actually use. Don't forget the lossless toggle for text-heavy images; people hit weird OCR failures on JPEG and assume the model is broken when it's the encoding. And if you batch a folder through this, remember each image set is a billed call on every run.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | NanoBanana - API key. Leave blank to use GEMINI_API_KEY env var. | |
| model | COMBO | gemini-3.1-flash-lite-preview | NanoBanana - model for vision analysis. |
| custom_model | STRING | Override with a custom model ID. | |
| prompt | STRING | Describe this image. | What to ask about the image(s). |
| system_instructionopt | STRING | System instruction to guide analysis. | |
| temperatureopt | FLOAT | 0.100–2 | Controls randomness. Lower = more focused analysis. |
| losslessopt | BOOLEAN | false | Encode images as lossless PNG instead of JPEG. Use for OCR, small-text recognition, or fine-grained classification where JPEG artifacts degrade accuracy. Higher bandwidth. |
| ref_image_1opt | IMAGE | First image to analyze. | |
| ref_image_2opt | IMAGE | Second image to analyze. | |
| ref_image_3opt | IMAGE | Third image to analyze. | |
| ref_image_4opt | IMAGE | Fourth image to analyze. | |
| networkopt | NB_NETWORK | Optional. Wire a NanoBanana - Network Route node here to route this request through that proxy (e.g. US egress). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |