Nodes/ComfyUI-PromptsO/💀Text with Gemini
ComfyUI Node

💀Text with Gemini

Gemini text inside ComfyUI — free-tier LLM calls with optional vision

By S4MUEL-404·Created 11 months ago·Updated 10 months ago· 3
💀Text with Gemini
  • images
  • text
system_prompt
user_prompt
api_key
modelgemini-2.5-flash
max_tokens2048
temperature0.7
top_p0.95
seed0

Here's the honest pitch for 💀Text with Gemini: Google hands out a free-tier API key that's genuinely usable for this, and the node defaults to gemini-2.5-flash, which is fast, cheap, and more than capable of writing, rewriting, or captioning prompts. If you want an LLM inside your ComfyUI graph and don't want to spend on it, this is the least-friction option in the pack - and it's the one API node that also takes images, so you get a vision model without hosting one.

How it works

It's a plain REST call to Google's generativelanguage.googleapis.com endpoint - no Google SDK required, just requests. You give it a system prompt, a user prompt, and a key; it returns a STRING named text.

One mechanism worth knowing: Gemini has no separate system role in the way this node talks to it, so the code just concatenates your system prompt onto the front of the user prompt. Fine in practice - just don't expect strict role separation if you're used to chat-format APIs.

Inputs that matter:

  • api_key - your Google AI Studio key. There's a free tier; that's the whole draw.
  • model - the list ships with gemini-2.5-pro-preview-05-06, gemini-2.5-flash-preview-04-17, gemini-2.5-pro, and gemini-2.5-flash (default). The preview names are dated snapshots - if a preview model errors out with a not-found response, switch to the non-preview gemini-2.5-flash/gemini-2.5-pro names. The stable names are the ones Google actually keeps serving.
  • images (optional) - an IMAGE input that gives the node vision. Your image is resized and base64-encoded as JPEG, sent as inline_data, and Gemini describes what it sees alongside your prompt. This is your free cloud version of the Janus-Pro node in this same pack - worse for privacy, better if you want the 2.5-flash quality without a local model download.
  • max_tokens (2048), temperature (0.7), top_p (0.95), seed - standard. Seed is 32-bit capped per the tooltip and only sent when above zero.

Gotchas

The same two that hit every node in this trio, so internalize them once:

The response cache ignores your API key. Results are cached keyed on model, prompts, and the sampling params plus seed - not the key. Fix a bad key, re-run with the same seed, and you'll get the stale cached text. Change the seed to force a fresh call.

The key lives in the workflow. An API key typed into a widget gets embedded in the workflow JSON and rides along in any shared PNG. ComfyUI workflows are transmitted with the image by default, so treat a workflow with a key in it like a password - redact or rotate before sharing.

Also worth knowing: this is a synchronous call with a two-minute timeout, so a long max_tokens response blocks the graph for a bit. That's normal, not a hang.

Install

Standard pack install, no models, no extra SDKs:

# ComfyUI Manager: search "PromptsO", install, restart.

cd ComfyUI/custom_nodes
git clone https://github.com/S4MUEL-404/ComfyUI-PromptsO.git
pip install -r ComfyUI-PromptsO/requirements.txt

Grab a key from Google AI Studio, drop it in, and you've got a prompt-generating LLM - with vision - inside the graph for free. For iterating on prompt variations that's the pragmatic reach-for, even if it means sending your prompts to Google. Local purists have Janus-Pro for that.

Category💀PromptsO

Inputs (9)

NameTypeDefaultDescription
system_promptSTRINGSystem instruction for the AI
user_promptSTRINGUser prompt for Gemini
api_keySTRINGYour Google Gemini API Key
modelCOMBOgemini-2.5-flashChoose Gemini model
max_tokensINT20481–32768Maximum number of tokens to generate
temperatureFLOAT0.70–2Sampling temperature (0.0 = deterministic, 2.0 = very random)
top_pFLOAT0.950–1Top-p sampling threshold
seedINT00–2147483647Random seed for reproducible results (32-bit limit for Gemini API)
imagesoptIMAGEOptional reference images

Outputs (1)

NameTypeDescription
textSTRING