NanoBanana - Text Gen + Google Search
TextGen that can actually look things up — with citations
- network
- text
- citations_json
Plain text models have a hard wall: their training cutoff. Ask NanoBanana_TextGen what the latest video model is and it tells you what it knew at training time, confidently. TextGenSearch removes that wall. It's the same generation node with Google Search grounding wired in as a tool, so Gemini can fetch fresh facts mid-answer - then it returns the answer and a citations_json list of the URLs and titles it actually used.
That's the feature that makes it worth reaching for over plain TextGen: current events, recent product specs, "what's the current price of X," anything where a stale answer is a wrong answer. It's also a nice honesty upgrade - you can see why the model said what it said, which is more than most LLM nodes in ComfyUI ever show you.
How it works
Under the hood it's generate_content with tools=[Tool(google_search=GoogleSearch())] in the config, plus a system instruction if you provide one. After the response comes back, the node walks grounding_metadata on the candidates, pulls each grounding_chunk's web entry, and serializes the results as pretty-printed JSON: [{url, title}, ...]. Gemini is doing real grounding, not pattern-matching - that's why the citations are structured data you can actually use.
The inputs
- api_key, model (default
gemini-2.5-flash- grounding works fine on flash for most questions), custom_model, prompt - the standard set. - system_instruction - useful here: "answer with sources, don't invent dates."
- temperature - default 0.3.
- network - optional proxy route.
Outputs (two STRINGs):
- text - the grounded answer.
- citations_json - the
[{url, title}]list the model used.
citations_json is valid JSON text, so you can feed it to a JSON-parsing node or just dump it to a ShowText next to the answer.
Installing it
One pack, one install: 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, an API key. Nothing else to fetch.
Where people get burned
Grounding is a tool, and tools cost tokens - a search-grounded answer bills for the search turns on top of the generation, so it's pricier per call than plain TextGen. Use it for questions where freshness matters, not for everything. Also, grounding quality still depends on the model: a weak or preview model may return thin citations. And the pack's usual gotcha applies - every run re-executes even with identical inputs, so if you queue a workflow with this node in a batch, each item is a fresh billed search.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| model | COMBO | gemini-2.5-flash | 35 options: gemini-pro-latest, gemini-flash-latest, gemini-flash-lite-latest, gemini-3-pro-preview, gemini-3-flash-preview, gemini-3.1-pro-preview, +29 |
| prompt | STRING | — | |
| custom_modelopt | STRING | — | |
| system_instructionopt | STRING | — | |
| temperatureopt | FLOAT | 0.300–2 | — |
| networkopt | NB_NETWORK | Optional. Wire a NanoBanana - Network Route node here to route this request through that proxy (e.g. US egress). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| citations_json | STRING | — |