Nodes/ComfyUI_Fill-Nodes/FL Gemini Text API
ComfyUI Node

FL Gemini Text API

Call Google Gemini for text right inside your workflow

By filliptm·Created 3 years ago·Updated about 11 hours ago· 628
FL Gemini Text API
    • response
    prompt
    api_key
    modelgemini-2.5-flash
    temperature0.70
    max_output_tokens65536
    seed0
    system_instructions
    top_p0.95
    top_k64
    thinking_leveldefault

    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 to gemini-2.5-flash, with everything from gemini-3-pro-preview and gemini-2.5-pro down to the older 1.5 variants 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_tokens and seed round 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 ManagerComfyUI_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.

    Category🏵️Fill Nodes/AI

    Inputs (10)

    NameTypeDefaultDescription
    promptSTRING
    api_keySTRING
    modelCOMBOgemini-2.5-flash10 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
    temperatureFLOAT0.700–1
    max_output_tokensINT6553664–65536
    seedINT00–16777215
    system_instructionsoptSTRING
    top_poptFLOAT0.950–1
    top_koptINT641–100
    thinking_leveloptCOMBOdefault3 options: default, low, high

    Outputs (1)

    NameTypeDescription
    responseSTRING