Nodes/ComfyUI-y277an-Gemini/Gemini Text (y277an)
ComfyUI Node

Gemini Text (y277an)

A frontier LLM that drops text into your workflow

By y277an·Created 2 months ago·Updated 2 months ago· 0
Gemini Text (y277an)
  • image
  • image2
  • text
promptExpand this into a detailed image-generation prompt: a blue cat running, happy
model
system_prompt
api_key
temperature1.00
use_cachetrue

A language model in the graph is now routine, not a party trick - prompt enhancement went from curiosity to default in this ecosystem (the LLM-in-the-graph pattern). Gemini Text (y277an) is the API version of that pattern: it drops a Google Gemini text model into your canvas, reads a rough idea (or an image), and hands back a plain STRING you can feed anywhere text goes. You don't need a GPU for it, and you don't need to babysit an Ollama server. You need an AI Studio key and a willingness to let your prompt leave the machine.

Why you'd reach for it

Two jobs, one node. No image attached and it's a text generator: type "expand this into a detailed image prompt: a blue cat running, happy" and get a richer, structured prompt out. Attach an image (or image2) and it becomes a vision node - caption, describe, or analyze what's in the frame.

Where it shines is the chained workflow: a Gemini-class model genuinely understands that it's writing a prompt for another model, not talking to a human. The community's own good pattern is exactly this - one model describes a reference image, a second model rewrites that into a prompt shaped for the generation model, then you generate (the LLM-in-the-graph pattern). This node is the second half of that, and it plugs straight into the pack's own Gemini Image or Veo nodes.

How it works

The node calls generate_content on whichever text model you pick - the dropdown lists live Gemini models (gemini-2.5-flash, gemini-3-flash-preview, gemini-3.1-pro-preview, gemini-2.5-pro, gemini-flash-latest), filtered to exclude image/tts/video models. The model list is cached to disk so ComfyUI doesn't do a blocking network call at load; it refreshes once a day in the background.

Same house rules as the rest of the pack: key resolution is node field → config.json → env, retries on transient errors, and an output cache keyed on the exact request. One difference that matters: the output is raw model text. Whatever Gemini says comes back verbatim as the STRING, and if it errors, the error text is the string. No preamble stripping, no JSON cleanup.

The inputs that matter

Required: prompt and model. That's it for a text-generation node - everything else is optional:

  • image / image2 - attach either to switch to vision mode.
  • system_prompt - style or constraint instruction, sent only if non-empty.
  • temperature - 0 to 2, default 1; crank down for deterministic prompt output.
  • use_cache - on by default; identical requests return the cached text instantly.

Output is a single STRING named text. Wire it into a CLIPTextEncode prompt, into this pack's Gemini Image / Veo nodes, or anywhere else that takes text.

Install

Shared with the whole pack, one install gets all four nodes:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/y277an/ComfyUI-y277an-Gemini.git
/path/to/ComfyUI/python -m pip install google-genai pillow numpy
cd ComfyUI-y277an-Gemini
cp config.json.example config.json   # paste your Google AI Studio key

Restart ComfyUI. No model files to download - the model lives on Google's servers.

Gotchas

  • The API path filters. If your prompt-enhancement job runs into content the model refuses, that's the model, and there's no local bypass. For uncensored enhancement, the local abliterated-LLM route is the answer - this node is the "I want frontier quality and don't care about local" option.
  • Raw text is a feature and a trap. Model preamble like "Here is your enhanced prompt:" flows straight into your conditioning if Gemini decides to write it. Read the output before wiring it into an encoder, and keep the job narrowly scoped - a tight instruction drifts less than an open-ended one.
  • An error string looks like a result. Missing key, missing dependency, or a failed call all come back as a string starting ERROR:. If your encoded prompt is suddenly garbage, check this node's output first.
  • Cache surprise. It's on by default. Rerun with no changes and you get the same text for free - which is what you want when you're iterating, and the thing that confuses you when you think you changed the input.

For a cheap, strong prompt/vision assistant that lives entirely in the graph, this is the node in the pack most people end up leaving wired in permanently.

Categoryy277an/Gemini

Inputs (8)

NameTypeDefaultDescription
promptSTRINGExpand this into a detailed image-generation prompt: a blue cat running, happy
modelCOMBO5 options: gemini-2.5-flash, gemini-3-flash-preview, gemini-3.1-pro-preview, gemini-2.5-pro, gemini-flash-latest
imageoptIMAGE
image2optIMAGE
system_promptoptSTRING
api_keyoptSTRING
temperatureoptFLOAT1.000–2
use_cacheoptBOOLEANtrue

Outputs (1)

NameTypeDescription
textSTRING