Google AI - Text Generator
The most flexible node in this pack
- image_1
- image_2
- image_3
- image_4
- image_5
- text
If you only install one cloud-AI node from this pack, this is it. GoogleAI_TextNode sends a prompt - and optionally up to five images or even a YouTube URL - to Google's Gemini models and returns the answer as a STRING. Text generation, image analysis, captioning, prompt rewriting, you name it, it's here in one node. It's effectively the Swiss-army Gemini client, and because the output is plain text it plugs into anything that accepts a string.
What it's for
ComfyUI is full of text fields that want filling: prompts, negative prompts, captions, parameter descriptions. This node fills them from a hosted model instead of from your brain. Generate a detailed positive prompt from a vague idea, expand a style note into a full description, ask Gemini to analyze an image you just made and turn its verdict into conditioning. The youtube_url input is a nice extra - paste a video link and Gemini will work from its content, which is odd but occasionally exactly what you need for a scene description.
How it works
Pure REST against Google's generativelanguage.googleapis.com - no SDKs, just requests. Your prompt (plus any images, base64'd, or the YouTube link) goes to a Gemini model and the reply text comes back as a STRING. Key resolution follows the pack's standard order: node's api_key field, then the GEMINI_API_KEY env var, then the .env file in the pack folder. Errors don't crash the graph - they come back as ❌ Error: … text you can read in a preview node. And it's a paid hosted call; the node is free, the Gemini API is not, which this pack's author has had to clarify more than once on Reddit.
Inputs and outputs that matter
- prompt (STRING, multiline) - the actual ask. Default is a Spanish "describe this image" - replace it.
- model (COMBO, default
gemini-3.1-pro-preview) - the Gemini model. The combo lists current preview and stable IDs. - thinking_budget (COMBO: Off/Low/Medium/High) - the reasoning level. On Gemini 3+ this maps to
thinkingLevel; on 2.5 models it maps tothinkingBudget. Off is faster and cheaper; Higher gives better reasoning on hard prompts at a cost. - image_1 … image_5 (IMAGE) - optional images for multimodal analysis. Feed a generated frame and ask what's in it.
- system_prompt, max_tokens (default 4096), temperature (default 0.7) - the standard dials.
- text (STRING) - the model's reply. Wire it anywhere.
Installing it
One of the 15 Google AI nodes in COMFYUI_PROMPTMODELS (PromptModels Studio in Manager):
cd ComfyUI/custom_nodes
git clone https://github.com/cdanielp/COMFYUI_PROMPTMODELS
Put GEMINI_API_KEY=AI... in the pack's .env, restart. Needs ComfyUI 0.26.0+. No models to download; everything runs at Google's end.
Common issues
The big one is the key. Pasted into the node field, it travels in your workflow JSON and PNG metadata - use .env instead, which the README is explicit about. Watch max_tokens: the default 4096 can truncate long answers, so raise it if your text cuts off mid-sentence. And be realistic about cost - Gemini 3 Pro with thinking on is a metered API, and a loop that calls this node per batch iteration is a bill that adds up. For cheap iteration, the default flash-class models exist for a reason.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Describe esta imagen en detalle. | — |
| model | COMBO | gemini-3.1-pro-preview | 4 options: gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash |
| thinking_budget | COMBO | Off | Gemini 3+: thinkingLevel. Gemini 2.5: thinkingBudget. |
| api_keyopt | STRING | — | |
| system_promptopt | STRING | — | |
| image_1opt | IMAGE | Imagen 1 para análisis multimodal. | |
| image_2opt | IMAGE | Imagen 2 (opcional). | |
| image_3opt | IMAGE | Imagen 3 (opcional). | |
| image_4opt | IMAGE | Imagen 4 (opcional). | |
| image_5opt | IMAGE | Imagen 5 (opcional). | |
| youtube_urlopt | STRING | — | |
| max_tokensopt | INT | 409664–65536 | — |
| temperatureopt | FLOAT | 0.700–2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |