Nodes/Gemini Own Key (Nano Banana Pro)/Gemini Text/Vision (own API key)
ComfyUI Node

Gemini Text/Vision (own API key)

The Gemini Node That Writes Your Prompts Instead of Drawing Them

By haristahir1·Created 21 days ago·Updated 13 days ago· 2
Gemini Text/Vision (own API key)
  • images
  • text
prompt
modelgemini-2.5-flash
system_prompt
api_key
timeout180

The pack this ships in is all about Nano Banana Pro with your own key, so GeminiTextOwnKey is easy to overlook - it doesn't draw anything. It's the plain-text sibling: a straight call to a Gemini language model from inside your graph, returning text you can wire anywhere. Which is exactly what makes it useful, because prompt-rewriting and captioning are the two jobs every serious workflow needs done by a model that's not a diffusion model.

Think of the loop people actually run: rough idea in, Gemini rewrites it into a structured, model-appropriate prompt, and that text feeds your image node's prompt. Chaining a cheap text call into an expensive image call beats hand-tuning prompts every time, and since it shares its API key and config.json with the Nano Banana node in the same pack, adding it costs nothing but a few cents of text tokens.

How it works

Under the hood it's the same plumbing as its sibling: your prompt (and any attached images, converted to PNG base64) gets POSTed to generativelanguage.googleapis.com/v1beta/models/<model>:generateContent with your key, and the model's text comes back on the single output. No seed widget - an LLM isn't seeded that way, so if you want variety you vary the prompt. Notably there's no backend dropdown here: text runs on the plain AI Studio key, not the Vertex path, which is fine because it doesn't need the trial-credit trick - the image node is the expensive half.

Inputs and output

The node is almost embarrassingly thin, which is the right call:

  • prompt - what you're asking. For enhancement, give it your rough idea plus an instruction like "rewrite this as a detailed prompt for an image model."
  • model - defaults to gemini-2.5-flash, and honestly that's usually the one you want. Prompt rewriting wants small and obedient, not a reasoning model that leaks its thinking into your output. Reach for gemini-3-pro-preview or gemini-2.5-pro only when the job is genuinely hard.
  • images - connect this and it becomes a vision node: point it at a loaded image and ask for a caption, a detailed description, or structured tags. Feed it back into your prompt chain and you've got a quick img2img seeder.
  • system_prompt - set the persona or output format, like "reply with JSON only."
  • api_key - leave it blank if your key is in config.json or the GEMINI_API_KEY env var. Fill it in and it wins over both, which is also why the security section below says don't.
  • timeout - 180s default, which is plenty for flash and comfortable for pro.

The one output, text, is a plain STRING. Wire it into any prompt input downstream, or a text-preview/save node to eyeball it before it goes anywhere.

Install and gotchas

Installing is the same as the pack's image node - it's the same repo:

cd ComfyUI/custom_nodes
git clone https://github.com/haristahir1/comfyui-gemini-ownkey

then restart, or search the pack in ComfyUI Manager. No extra dependencies for the text path - it only needs requests. Verify your key free with check_key.py --list-only before you blame the node for a 401.

Two things bite people. First, the key: this is a credential-carrying API node from a brand-new author, so use config.json (gitignored, never saved into workflow JSON) rather than pasting the key into the widget - widget values ride along in every workflow you share or paste into error reports. Second, Google's moderation: this model refuses at the source, the node can't bypass it, and a reseller's "looser" endpoint still hits Google's own filter. If your use case needs something Google won't do, an API wrapper isn't the fix - this node is for the prompt-engineering half of the graph, and it does that job cleanly. A 429 prepayment credits depleted means your AI Studio balance is empty; top up, because text may be cheap but it's not free.

CategoryGemini (own key)

Inputs (6)

NameTypeDefaultDescription
promptSTRING
modelCOMBOgemini-2.5-flash3 options: gemini-3-pro-preview, gemini-2.5-pro, gemini-2.5-flash
imagesoptIMAGE
system_promptoptSTRING
api_keyoptSTRING
timeoutoptINT18015–1800

Outputs (1)

NameTypeDescription
textSTRING