Gemini Generate Text
Gemini 2.5 in your graph — with chat history and the thinking shown
- history
- text
- history
- thought
If you've been gluing LLM calls into ComfyUI with a requests node, this is the upgrade. Yogurt Gemini Generate Text is a real Gemini client inside the graph: it calls Google's Gemini API, keeps conversation history alive across executions, and even hands you the model's chain-of-thought as a separate output. No image generation here - the pack has a sibling node for that - this one is text in, text out, history for free.
What it is and why you'd reach for it
The Yogurt Nodes pack is a kitchen-sink collection, and this is its flagship LLM node. You wire it anywhere you'd otherwise put a hand-rolled HTTP call: rewriting a prompt for a second pass, generating captions to feed a captioning workflow, classifying an image description before it goes to a text-to-image node, or just asking questions mid-graph. Because it outputs a HISTORY type, it slots into the pack's other LLM nodes too - the same history object feeds its Image Understand siblings, so you can build a genuinely multi-turn pipeline without storing state yourself.
The inputs that matter
The list is long, but you mostly touch a handful:
- api_key - paste a Gemini key here, or leave it blank and let the node pick it up from config (see install).
- model_name - defaults to
gemini-2.5-flash, which is the right call for most workflow use. Swap inprowhen you need more reasoning. - system_prompt and prompt - the system prompt sets the overall style; the prompt is your actual request. Both are multiline.
- temperature - higher = more random. Start at 1, dial down for deterministic labeling tasks.
- thinking_budget - this one's interesting:
-1means no cap on thinking,0disables thinking entirely. Pair it with the thought output below. - seed -
-1for random, or pin a number to get reproducible-ish output. Handy when you're iterating on a prompt template. - chat_template - the default is a
{{system_instruction}}/{{prompt}}template with<‑system->markers. If you use the history input, this is how each turn gets formatted, so it's the first place to look when a multi-turn conversation comes back garbled.
Also on the schema: top_p, top_k, max_output_tokens, retry_count, safety_level, disable_safety_settings, vertex (route through Vertex AI), base_url, proxy_url, timeout, and an extra JSON field for anything the client doesn't expose.
The outputs and what they wire into
- text - the model's reply (STRING). This is the one you save or feed forward.
- history - the updated conversation, ready to loop back into the same node's history input for the next turn.
- thought - the model's chain-of-thought as a separate string, when thinking is enabled. Great for debugging why a generation went sideways; don't ship it to a prompt that wants only the answer.
Install
The pack installs like any custom node. Fastest path is ComfyUI Manager - search "ComfyUI-YogurtNodes" and hit install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Then restart ComfyUI. The LLM nodes need google-genai, which the requirements file pulls in.
For the key, the README gives you three options in priority order: paste one directly in the node's api_key field, drop it in custom_nodes/ComfyUI-YogurtNodes/yogurt_nodes/llm/api_key.json as {"gemini": "YOUR_API_KEY"}, or set GEMINI_API_KEY as an environment variable. Get a key from Google AI Studio. The file/env approach is better than hardcoding a key into every workflow - the key travels inside the workflow JSON otherwise, which is a bad habit to start.
Gotchas
Two things bite people. First, api_key is a required field, and if the file/env var isn't set, the node fails with an auth error - the README's priority order (node field > json file > env var) decides which key wins, so a blank field is fine only if the file or env var is configured. Second, remember this is a paid API: with max_output_tokens defaulting to 65,535 and thinking enabled, a long chain of workflow runs can quietly burn tokens. Set a sane token cap and a timeout so a hung request doesn't stall your whole batch.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | API key for accessing Gemini API | |
| vertex | BOOLEAN | false | Use Vertex AI for Gemini API |
| base_url | STRING | Base URL for Gemini API | |
| model_name | STRING | gemini-2.5-flash | Gemini model name, default is gemini-2.5-flash |
| system_prompt | STRING | System-level prompt that affects the overall conversation style | |
| prompt | STRING | Main prompt content input by the user | |
| temperature | FLOAT | 1.00 | Sampling temperature, higher values produce more random outputs |
| top_p | FLOAT | 0.000–1 | Sampling probability threshold, controls output diversity |
| top_k | INT | 0 | Number of highest probability tokens to consider during sampling |
| max_output_tokens | INT | 655350–2147483647 | Maximum number of tokens in the generated text |
| retry_count | INT | 1 | Number of retries when request fails |
| disable_safety_settings | BOOLEAN | false | Whether to disable safety settings, if true, the safety settings will not be set |
| disable_system_prompt | BOOLEAN | false | Whether to disable the system prompt, if true, the system prompt will sent as a user prompt |
| safety_level | COMBO | BLOCK_NONE | Safety level for the generated text |
| thinking_budget | INT | 0-1–2147483647 | Thinking budget for the model, if set to -1, the model will not limit thinking budget, if set to 0, the model will disable thinking |
| chat_template | STRING | <-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user-> | Content template for the generated text |
| proxy_url | STRING | 代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h | |
| seed | INT | -1-1–2147483647 | 随机种子,设置为-1时随机种子 |
| thinking_level | COMBO | OFF | Thinking level for the model, if thinking budget is not 0, this parameter will be ignored |
| timeout | INT | 00–2147483647 | Timeout for the request in seconds, 0 means no timeout |
| historyopt | HISTORY | — | |
| extraopt | STRING | {} | Extra parameters for the request, in JSON format |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| history | HISTORY | — |
| thought | STRING | — |