FL Gemini Text API
Call Google Gemini for text right inside your workflow
- response
Sometimes you want an LLM in the loop before the image ever gets made. Expand a one-line idea into a full descriptive prompt. Rewrite a caption in a different style. Turn a messy user request into clean, structured text a diffusion model can chew on. FL_GeminiTextAPI does that by calling Google's Gemini models and handing you back plain text you can wire straight into a CLIP Text Encode or any other string input.
Unlike a lot of the "GPT" nodes floating around, this one is honest about what it is: it hits Google's Gemini API over the network, so you need an API key and a connection. There's no local model here. If you want the offline route, the pack has an Ollama node for that - this is the cloud one, and the tradeoff is you get frontier-model quality without hosting anything.
How it works
You write a prompt, pick a Gemini model, and the node sends the request to Google and returns the raw text response - no wrapping, no reformatting, just the model's output as a string. You can steer it with a system instruction, the usual sampling knobs, and on the 2.5-series models a thinking_level that trades latency for more reasoning before the answer.
The inputs and outputs that matter
Required:
prompt(STRING, multiline) - what you're asking. The main event.api_key(STRING) - your Google AI Studio / Gemini key. Nothing works without it.model(enum) - which Gemini to call. Defaults togemini-2.5-flash, with everything fromgemini-3-pro-previewandgemini-2.5-prodown to the older1.5variants in the list. Flash is the sane default: fast, cheap, plenty for prompt work.temperature(FLOAT, 0–1, default 0.7) - creativity. Note the ceiling is 1, not 2; turn it down toward 0 for deterministic, on-rails output.max_output_tokensandseedround out the required set.
The ones worth knowing in the optionals: system_instructions (multiline STRING) to set a persistent role ("you are a Stable Diffusion prompt engineer, output only the prompt"), and thinking_level (default / low / high) for the 2.5 reasoning models. top_p and top_k are there if you want them.
Output is a single response (STRING).
When you'd reach for it
Prompt expansion and cleanup, batch caption rewriting, generating varied prompt lists to feed a selector, or any spot where you'd otherwise alt-tab to a chatbot and paste the result back. Keeping it in the graph means it re-runs with your workflow.
Installing it
ComfyUI Manager → ComfyUI_Fill-Nodes → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
then restart. This node needs Google's genai client library, which the pack installs - Fill-Nodes is a large pack and pulls a fair few dependencies on first launch, this being one of them.
Common issues & troubleshooting
No key, no output. Get a key from Google AI Studio and paste it into api_key. Free-tier keys work but have rate limits; heavy batch use may need billing enabled.
A model name errors or 404s. The list includes preview and dated snapshot names (gemini-2.5-pro-preview-06-05, etc.). Google retires those on their own schedule - if a preview model stops responding, switch to a stable one like gemini-2.5-flash or gemini-2.5-pro.
Empty or truncated response. Usually a safety block on the prompt, or max_output_tokens set too low for what you asked. Rephrase, or raise the token cap.
Use system instructions to stop the chattiness. By default the model may wrap answers in explanation. Put "output only the prompt, no preamble" in system_instructions and it'll behave.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_key | STRING | — | |
| model | COMBO | gemini-2.5-flash | 10 options: gemini-3-pro-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite, +4 |
| temperature | FLOAT | 0.700–1 | — |
| max_output_tokens | INT | 6553664–65536 | — |
| seed | INT | 00–16777215 | — |
| system_instructionsopt | STRING | — | |
| top_popt | FLOAT | 0.950–1 | — |
| top_kopt | INT | 641–100 | — |
| thinking_levelopt | COMBO | default | 3 options: default, low, high |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |