Nodes/ComfyUI-NanoBanana2/NanoBanana - Ask Uploaded File (PDF / video / audio)
ComfyUI Node

NanoBanana - Ask Uploaded File (PDF / video / audio)

Upload the PDF once, then ask it questions forever

By IxMxAMAR·Created 6 months ago·Updated about a month ago· 4
NanoBanana - Ask Uploaded File (PDF / video / audio)
  • network
  • text
api_key
modelgemini-2.5-flash
file_uri
mime_typeapplication/pdf
promptSummarize this document.
custom_model
temperature0.10
thinking_levelNONE

Some files are too big to stuff into an inline prompt. A 900-page PDF, a long video, an hour of audio - encoding those into every multimodal call is wasteful or outright impossible. NanoBanana2's answer is a two-node split: Files Upload pushes the file to Google's Files API once and returns a reusable URI, and this node, VisionWithFile, takes that URI plus a question and returns an answer. Upload once, ask as many questions as you want.

It handles PDFs up to 1000 pages and video/audio up to 1 GiB - the kind of "summarize this whole document" jobs that inline nodes can't touch. If you're doing PDF QA, document research, or "what did the speaker say in this recording," this is the node that makes it a graph, not a script.

How it works

VisionWithFile doesn't upload anything itself - it expects a file_uri from the Files Upload node (try to run it empty and it raises a clear "upload first" error). It then sends the file as a Part.from_uri alongside your prompt to generate_content, so Gemini reads the document at its full resolution server-side. Two facts to internalize about the Files API: uploaded files live roughly 48 hours before Google deletes them, and the mime_type must match the actual file or the request fails. The thinking_level input exists here because "analyze this 900-page document" is exactly the kind of job where letting the model think before answering pays off.

The inputs

  • api_key, model (default gemini-2.5-flash), custom_model - standard.
  • file_uri - the URI string from NanoBanana Files Upload.
  • mime_type - e.g. application/pdf, video/mp4, audio/wav, image/png.
  • prompt - defaults to "Summarize this document."
  • temperature - default 0.1.
  • thinking_level - NONE default; turn up for complex analysis.
  • network - optional proxy route.

Output: one text STRING.

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

The 48-hour file expiry is the classic gotcha - a workflow saved last week will fail with a dead URI until you re-run the Files Upload node. The other one is mime_type mismatches: saying application/pdf for a video file is a hard error. And because this re-executes on every run, "ask one question" is one billed document read per run - if you're asking five questions, chain five of these nodes off the same file_uri rather than re-uploading.

CategoryNanoBanana2/Files

Inputs (9)

NameTypeDefaultDescription
api_keySTRING
modelCOMBOgemini-2.5-flash35 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
file_uriSTRINGURI from NanoBanana Files Upload.
mime_typeSTRINGapplication/pdfMIME type of the uploaded file (application/pdf, video/mp4, audio/wav, image/png, ...).
promptSTRINGSummarize this document.
custom_modeloptSTRING
temperatureoptFLOAT0.100–2
thinking_leveloptCOMBONONE5 options: NONE, MINIMAL, LOW, MEDIUM, HIGH
networkoptNB_NETWORKOptional. Wire a NanoBanana - Network Route node here to route this request through that proxy (e.g. US egress).

Outputs (1)

NameTypeDescription
textSTRING