Nodes/ComfyUI-Gemini/📄Gemini_File_Zho
ComfyUI Node

📄Gemini_File_Zho

Read audio, PDFs and files with Gemini 1.5 Pro

By ZHO-ZHO-ZHO·Created 3 years ago·Updated 2 years ago· 789
📄Gemini_File_Zho
  • file
  • text
promptListen carefully to the following audio file. Provide a brief summary.
model_name
streamfalse

Gemini_File_Zho is the reader side of the pack's file support, and it's one of the more impressive things ComfyUI-Gemini does: point it at a file that's already been uploaded and 1.5 Pro will summarize an audio track, answer questions about a PDF, or work through text documents - then hand you a string that plugs straight back into your graph. The default prompt is "Listen carefully to the following audio file. Provide a brief summary," which tells you what the author had in mind.

The name in the menu is 📄Gemini_File_Zho, and it's implicit-key, so your key lives in config.json. It's strictly a Gemini 1.5 Pro node - the model choice is fixed to gemini-1.5-pro-latest - because file understanding is a 1.5 Pro capability. That model's whole selling point is multimodal context: text, image, audio, video in one request, with a context window the README claims up to ~1,048,576 tokens.

How it works - and the "file" in the middle

The catch that confuses people: this node doesn't take a file path. Its file input is of type FILE, and the only thing that produces that in this pack is 📄Gemini_FileUpload_Zho. The flow is two nodes wired together - FileUpload uploads your local file to Google's file API and outputs a handle; Gemini_File_Zho takes that handle plus your prompt and calls generate_content([prompt, file]). If you try to wire a plain path or a string into it, it won't connect, because there's nothing else in the pack emitting a FILE.

Worth saying plainly: the file was uploaded to Google's servers by the FileUpload node, so this isn't local processing. The transcription happens on Google's side.

Inputs

  • file - the FILE handle from Gemini_FileUpload_Zho.
  • prompt - what to do with it (summarize, extract, transcribe).
  • model_name - locked to 1.5 Pro.
  • stream - off by default.

The text output is your answer, ready for DisplayText_Zho or further nodes.

Install and gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-Gemini.git
cd ComfyUI-Gemini
pip install -r requirements.txt

Put your key in config.json and restart. Then remember the two-step flow: upload first, then read. Large files take time to process on Google's side before the answer returns, and the free tier's rate limits (roughly 2 RPM at launch) apply here too. And because the content lives on Google's servers, don't feed this node anything you wouldn't be fine with a third party seeing - that privacy note applies to the whole file pair.

CategoryZho模块组/✨Gemini

Inputs (4)

NameTypeDefaultDescription
fileFILE
promptSTRINGListen carefully to the following audio file. Provide a brief summary.
model_nameCOMBO1 options: gemini-1.5-pro-latest
streamBOOLEANfalse

Outputs (1)

NameTypeDescription
textSTRING