APNext Gemini Text Only
Text-to-prompt with Gemini and reusable templates
- output
- clip_l
This is the no-image Gemini node: pure text in, prompt out. It's for when you don't have a reference picture, just an idea or a template you want Gemini to expand into a full image prompt. Think of it as the cheap, fast prompt-writer of dagthomas's LLM lineup - Gemini Flash is quick and inexpensive, and pointing it at a well-written template gives you consistent, structured prompts without a chat tab.
Having an LLM write your prompt is the modern default, not a gimmick - on 2026 models whose text encoder is itself an LLM (Flux 2, Z-Image, Qwen), you're translating your idea into an instruction the image model reads natively. GeminiTextOnly is the lightweight way to do that in-graph, and its dynamic-template support makes it especially handy for churning out LoRA-caption-style prompts at volume.
How it works
It fills any dynamic tokens into your prompt and sends it to Gemini, returning the generated text. There's no image input - everything comes from custom_prompt (plus additive_prompt). Turn on dynamic_prompt and ##TAG##, ##SEX##, ##WORDS##, ##PRONOUNS## get substituted from the matching inputs, so one template produces consistent captions across many subjects. seed and randomize_each_run give you fresh variations per run.
The inputs and outputs that matter
custom_prompt- your instruction or template. The whole node runs on this; pair it withCustomPromptLoaderto pull a saved one.additive_prompt- extra text appended to the instruction.gemini_model- the dropdown (2.5 Pro down to Flash-Lite). Flash is the cheap, fast default.dynamic_prompt+tag/sex/words/pronouns- template substitution for repeatable captions.seed+randomize_each_run- batch variety.
Two outputs: output (the generated text) and clip_l (a trimmed variant sized for a CLIP-L text slot).
How to install it
ComfyUI Manager: search comfyui_dagthomas, install, restart. Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas && pip install -r requirements.txt
then restart. Needs google-generativeai (in requirements.txt) and a GEMINI_API_KEY set in the environment before launching ComfyUI.
Where people get burned
- Key set after launch, or missing. Export
GEMINI_API_KEYbefore you start ComfyUI. Read at startup, nowhere else. - Hosted ComfyUI blocks it. Outbound API calls aren't available on most serverless instances; this is a local-install node.
- Empty template, empty value. With no
custom_promptthere's nothing for Gemini to expand. Start from aCustomPromptLoadertemplate if you're unsure. - Watch the length. Gemini will write a lot if you let it; the KB's attention-cap point (models drift past ~75–100 effective tokens) applies. Ask for concise output in the template, or you're feeding the encoder an essay.
- Model name drift. The dropdown can list a variant your key can't call; that errors at runtime. Edit
data/gemini_models.jsonto match your access.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| custom_prompt | STRING | — | |
| additive_prompt | STRING | — | |
| dynamic_prompt | BOOLEAN | false | — |
| tag | STRING | ohwx man | — |
| sex | STRING | male | — |
| words | STRING | 100 | — |
| pronouns | STRING | him, his | — |
| gemini_model | COMBO | 5 options: gemini-2.5-pro, gemini-flash-latest, gemini-2.5-flash, gemini-flash-lite-latest, gemini-2.5-flash-lite | |
| seed | INT | -1-1–18446744073709550000 | — |
| randomize_each_run | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |
| clip_l | STRING | — |