💬 GRSAI LLM (纯文本对话)
A Gemini chat node with a fixed/random mode that actually means something
- response_text
- error_msg
A plain text-chat node: you type a prompt, it calls a Gemini model over the Grsai channel, and you get the reply as a STRING. In the ComfyUI graph that's not as trivial as it sounds - a string in, string out LLM node is exactly the building block the LLM-in-the-graph pattern is made of: prompt enhancement, caption drafting, seed text for a batch CSV, any place a model writes text another node consumes.
It's the pure-text member of the pack's LLM/VLM pair (GRSAIVLMNode is the vision one). Both sit on the Grsai channel, which resells Gemini 2.5/3.x through an OpenAI-compatible /v1/chat/completions endpoint - so if you've used an OpenAI-style chat node, this will feel familiar under the hood.
The inputs that matter
model-gemini-2.5-flash(default),gemini-2.5-flash-lite,gemini-3-flash,gemini-3-pro,gemini-3.1-pro. Flash is the cheap default; pro is the quality tier.prompt(multiline) - your instruction. This is a chat prompt, so "Rewrite this: …" works better than one-word asks.random_mode-固定(fixed, default) or随机(random). And this one is a real mechanism, not decoration: in random mode the node appends a zero-width character to the prompt so the API's response cache can't collapse repeat calls into one identical answer. Fixed mode is for reproducible runs; random mode is for variation-hunting.api_key(optional) - Grsai key fallback.
Outputs: response_text (STRING) and error_msg (STRING) - the answer and, when something fails, the error side-by-side. Wiring both to a text display is the standard setup.
How it works
Readable source. It resolves the key, builds a single user message, POSTs to https://grsai.dakka.com.cn/v1/chat/completions with stream: false, and returns choices[0].message.content. Timeouts and HTTP errors land in error_msg rather than crashing the graph - useful for scripting retries. The random_mode zero-width-char trick is the same cache-busting idiom the pack uses across its async image tasks.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx
restart (or ComfyUI Manager, "ComfyUI-nkxx"). Auto-installs requests, pandas, openpyxl, yt-dlp, opencv-python, aiohttp. Grsai key from nkxx.grsai.ai.
Common issues
error_msgis populated: check network/credits first. The node surfaces HTTP codes and timeouts in that output rather than throwing, so an emptyresponse_textwith a fillederror_msgis the diagnostic moment.- Repeated identical answers in "fixed" mode: that's the feature - flip to
随机for variety. - It's metered per call: Gemini flash is cheap but not free; a loop that re-runs this node thousands of times is a real bill. Keep prompt enhancement passes short.
- Security posture: this is an API-wrapper pack that sends your prompts to a reseller - a single author's channel, Wujiai-side code shipped obfuscated. Nothing sensitive belongs in the prompt you send.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | gemini-2.5-flash | 5 options: gemini-3.1-pro, gemini-3-flash, gemini-3-pro, gemini-2.5-flash, gemini-2.5-flash-lite |
| prompt | STRING | Hello! You are a helpful assistant. | — |
| random_mode | COMBO | 固定 | 2 options: 固定, 随机 |
| api_keyopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| response_text | STRING | — |
| error_msg | STRING | — |