Gemini 1.5 文本
Gemini 1.5 Flash as a free-ish cloud brain for your workflows
- response
Gemini 1.5 Text is the pack's plain-vanilla chat call against Google's gemini-1.5-flash model. No personality roles, no country-polishing pipeline, no local model - just you, a prompt box, and Google's fastest small model. If you already have a Gemini API key from other projects, it's the least-fuss way to get a cloud LLM into a ComfyUI graph for the tasks the pack's other nodes don't cover.
The mechanism is a thin wrapper over google.generativeai with a tenacity retry (3 attempts, exponential backoff) and a nice detail: it temporarily strips HTTP_PROXY/HTTPS_PROXY env vars around the call. That one line saves you from the classic corporate-proxy-meets-Google-API failure, which tells you the author hit that wall themselves.
The inputs are about as simple as a chat node gets: prompt (multiline, default is a Chinese greeting - you'll replace it), temperature (0–1, default 0.7), and max_tokens (default 1024, up to 2048). Output is a STRING named response, ready to feed a text preview or the pack's Prompt Extractor.
Installing and keys
cd ComfyUI/custom_nodes
git clone https://github.com/yiwangsimple/ComfyUI_GroqChat
restart, then copy api_key.ini.example → api_key.ini and set GEMINI_API_KEY from aistudio.google.com. Get the free tier key - it's more than enough for occasional prompting.
The gotcha that will bite you
Here's the one real trap with the Gemini nodes in this pack: google-generativeai is not in requirements.txt. The pack's requirements list transformers, groq, openai, httpx, and friends, but the Gemini files import google.generativeai at the top. If you install the pack and don't have that package already, ComfyUI will either fail to load the pack or throw import errors the moment it touches these nodes. Fix it in one line:
pip install google-generativeai
then restart ComfyUI. Same story applies to every Gemini node in this pack (text, vision, and Flux prompt). Once that's handled, the node is reliable - the retry wrapper swallows most transient 429s. For pure speed of answer, Groq still wins; but Gemini Flash is a very capable general-purpose model with a generous free tier, so it's a reasonable default for brainstorming-in-the-graph workflows.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | 你好,请问有什么可以帮助你的吗? | — |
| temperature | FLOAT | 0.70–1 | — |
| max_tokens | INT | 10241–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |