Griptape Prompt Driver: Grok
Give your Griptape agent a Grok brain (and where the model list is stale)
- DRIVER
If you want your Griptape agent to think with xAI's Grok models instead of OpenAI's, this is the node. It's the exact same shape as the OpenAI prompt driver - pick a model, set the dials, get a DRIVER out - but it wraps Griptape's GrokPromptDriver and reads a GROK_API_KEY.
Why would you bother? Two reasons. First, the vision-capable Grok models are genuinely useful for the image-description side of an agent workflow, where you feed an image to the model and ask it to narrate what it sees. Second, if you're already paying for xAI's API, it's a second opinion at zero extra infrastructure - no local server, just a key.
How it works
The node builds a GrokPromptDriver from your inputs, reads the API key from the environment variable named in api_key_env_var (default GROK_API_KEY), and hands you the driver. Wire it into Griptape Agent Config: Custom Structure (or a Grok driver config) and your agent's reasoning goes through Grok.
The source is nearly identical to the OpenAI driver, with one difference worth flagging: where OpenAI pulls its model list from the live SDK types, this one has a hardcoded list - grok-beta, grok-vision-beta, grok-2-latest, grok-2-vision-latest. And it shows. grok-beta was the launch name back in late 2024; the current models are the grok-2 and newer families. If you pick grok-beta expecting the latest, you'll get an old or deprecated model. Reach for grok-2-latest (or the -vision-latest variant if you need it to look at images).
The inputs that matter
- model - the four-option dropdown. Default is
grok-beta; change it togrok-2-latestunless you specifically want an older one. - api_key_env_var - the name of the env var holding your key, not the key itself. Default
GROK_API_KEY. - temperature - default 0.1. Same advice as OpenAI: keep it low for description and summarization work.
- seed - passed through to the driver's
extra_params; set it if you want reproducible agent output. - use_native_tools - on by default; lets Grok call tools natively rather than through Griptape's wrapper.
response_format supports json_object if you need structured output. Output is the single DRIVER (PROMPT_DRIVER) that feeds your agent config.
Install and the key
Same pack, same install - ComfyUI Manager, search "Griptape", or:
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
Then set GROK_API_KEY in Settings → Griptape in ComfyUI, or in your environment. You get the key from console.x.ai - the changelog explicitly calls that out as the source.
Gotchas
Same family as the rest of this pack: griptape[all] drags in a torch that can clash with ComfyUI's on Nvidia (reinstall torch from the cu121 index if you see errors), and the api_key field takes a variable name, never a literal key. The Grok-specific trap is the stale model dropdown - trust the docs, not the default.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| modelopt | COMBO | grok-beta | 4 options: grok-beta, grok-vision-beta, grok-2-latest, grok-2-vision-latest |
| max_attempts_on_failopt | INT | 21–100 | Maximum attempts on failure |
| temperatureopt | FLOAT | 0.100–1 | Temperature for sampling |
| seedopt | INT | 10342349342 | Seed for random number generation |
| use_native_toolsopt | BOOLEAN | true | Use native tools for the LLM. |
| max_tokensopt | INT | -1 | Maximum tokens to generate. If <=0, it will use the default based on the tokenizer. |
| min_popt | FLOAT | 0.100–1 | Minimum probability for sampling. Lower values will be more random. |
| response_formatopt | COMBO | default | Format of the response |
| api_key_env_varopt | STRING | GROK_API_KEY | Enter the environment variable name, not the actual API key |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DRIVER | PROMPT_DRIVER | — |