Nodes/ComfyUI Griptape Nodes/Griptape Prompt Driver: Grok
ComfyUI Node

Griptape Prompt Driver: Grok

Give your Griptape agent a Grok brain (and where the model list is stale)

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Prompt Driver: Grok
    • DRIVER
    modelgrok-beta
    max_attempts_on_fail2
    temperature0.10
    seed10342349342
    use_native_toolstrue
    max_tokens-1
    min_p0.10
    response_formatdefault
    api_key_env_varGROK_API_KEY

    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 to grok-2-latest unless 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.

    CategoryGriptape/Agent Drivers/Prompt

    Inputs (9)

    NameTypeDefaultDescription
    modeloptCOMBOgrok-beta4 options: grok-beta, grok-vision-beta, grok-2-latest, grok-2-vision-latest
    max_attempts_on_failoptINT21–100Maximum attempts on failure
    temperatureoptFLOAT0.100–1Temperature for sampling
    seedoptINT10342349342Seed for random number generation
    use_native_toolsoptBOOLEANtrueUse native tools for the LLM.
    max_tokensoptINT-1Maximum tokens to generate. If <=0, it will use the default based on the tokenizer.
    min_poptFLOAT0.100–1Minimum probability for sampling. Lower values will be more random.
    response_formatoptCOMBOdefaultFormat of the response
    api_key_env_varoptSTRINGGROK_API_KEYEnter the environment variable name, not the actual API key

    Outputs (1)

    NameTypeDescription
    DRIVERPROMPT_DRIVER