Nodes/ERPK Collection/Grok Text Generation
ComfyUI Node

Grok Text Generation

Drop an LLM into the middle of your ComfyUI graph

By eRepublik-Labs·Created 11 months ago·Updated 20 days ago· 1
Grok Text Generation
  • client
  • response
prompt
modelgrok-4.5
temperature0.70
max_tokens4096

Grok Text Generation is a one-shot text node: you give it a prompt, it calls xAI's Grok API, and a STRING comes out the other side. That sounds almost too simple to need an article, but the useful part is where you put it. Because it's just a node in the graph, its output can drive anything else that takes a STRING - a prompt enhancer feeding an image model, a title generator for a video, a description writer that pipes straight into a Save Text node.

It's the same "paid cloud service, zero VRAM" pattern as the rest of the ERPK pack. There's no local model, no GGUF to download, no context-window management on your end. You type, it thinks on xAI's servers, the answer lands back in your workflow.

How it works

The node wraps the xAI SDK's completion call. Give it a prompt, it returns response as a plain STRING. The default model is grok-4.5, with grok-3, grok-3-mini, and grok-2 also selectable. Because it's a single call rather than a threaded chat, there's no session state to manage - every execution is fresh, which is usually exactly what you want in a node graph.

The inputs that matter

  • prompt - the actual text you're sending. Multiline, so whole paragraphs are fine.
  • temperature - 0.0 (focused) to 2.0 (very creative), default 0.7. This is the one you'll actually tune: a prompt-enhancement job likes a touch more heat, an extraction job wants it near zero.
  • max_tokens - 256 to 16384, default 4096. Bigger budgets for long-form text, smaller for structured one-liners.

The client input is optional and unconnected by default - the API key resolves from ComfyUI Settings (right-click canvas → ERPK Settings) or grok/config.ini. Connect a Grok API Client node only if you want per-node overrides like streaming.

Installing it

This node lives in the ERPK Collection (eRepublik-Labs/comfyui-nodes-erpk), which bundles Grok, WaveSpeed, Claude, Gemini, and OpenAI nodes in one install. In ComfyUI Manager, search erpk and install ERPK Custom Nodes, then restart.

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk
pip install -r requirements.txt

The Grok subpackage needs xai-sdk>=1.14.0 and an xAI API key (Settings → ERPK → API Keys). That's it - no model files.

Common issues

  • "No API key found" - the key isn't in Settings, config.ini, or a connected client node. Add it once under ERPK Settings and it applies pack-wide.
  • Output seems short/truncated - your max_tokens budget is too small for what you asked for. Crank it toward 8192+ for long-form.
  • Responses are too repetitive - lower the temperature; 0.7 is chatty, and for deterministic outputs like tag lists you'll want 0.2–0.4.
  • It costs money - it's a paid API. If you're feeding it thousands of prompts for batch captioning, watch the bill; a local GGUF model might be the smarter tool for that volume.
CategoryERPK/Grok

Inputs (5)

NameTypeDefaultDescription
promptSTRINGText prompt to send to Grok.
clientoptGROK_API_CLIENTGrok API client from Grok API Client node. If not connected, resolves from ComfyUI Settings or environment.
modeloptCOMBOgrok-4.5Grok model to use for generation.
temperatureoptFLOAT0.700–2Creativity level (0.0 = focused, 2.0 = very creative).
max_tokensoptINT4096256–16384Maximum number of tokens in the response.

Outputs (1)

NameTypeDescription
responseSTRING