Grok Imagine
Three Reference Images and No Lecture
- images
- provider
- image
- images
- text
- thought
Grok Imagine is the image model people try after the third time GPT Image refuses something that isn't even spicy. It's not diffusion - xAI's image stack is autoregressive, predicting visual tokens, which is part of why it looks different from a Flux-family render rather than merely being a different seed of the same thing. It's also, by the KB's own tabulation, the least restrictive of the closed image models, with a "Spicy Mode" on the consumer side.
It shows up in 98 threads in the corpus alongside ComfyUI, so this isn't obscure - people want it in a graph rather than in a chat window. Worth knowing: xAI's models are also on the official ComfyUI API-node roster, so if you'd rather buy credits through Comfy than hold an xAI key, that path exists. This node is the bring-your-own-key route, and it's the one that gives you the provider system.
The model dropdown
model is a dynamic combo over the Grok Imagine line - the 2.0 entry, a Quality variant, a Pro variant, and the base model. Versions differ in what they'll accept, and the inputs below the dropdown change accordingly.
The one difference you'll notice fast: reference image limits. The standard versions take up to 3 reference images; Pro takes 1. So "connect three references and pick Pro" is a run-ending mismatch, not a warning you can ignore.
Other inputs
- prompt - the generation prompt, or the edit instruction when references are attached.
- n - 1 to 10 images per call, priced per image.
- seed -
0lets the provider choose; changing a non-zero value forces a re-run. - images - autogrow reference input, batches expanded, capped per model as above.
- extra - JSON merged into the request body, for parameters the pack hasn't surfaced.
- system_prompt - accepted, though how much an image model does with it varies by version.
- retry_count - total attempts, ~3s apart. Keep at 1 while you're testing.
Outputs: image (the whole batch as one tensor - provided the sizes match, otherwise you get only the first), images (the honest list output), text and thought (some routes return narration alongside the pixels).
Install
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Manager install works - search "YogurtNodes"; on canvas the display name gets a " (Yogurt Nodes)" suffix. Without a provider wired, the node falls back to official xAI, keyed from custom_nodes/ComfyUI-YogurtNodes/yogurt_nodes/llm/api_key.json (xai, or grok) and then XAI_API_KEY / GROK_API_KEY.
{ "xai": "xai-..." }
Add a Provider: xAI node if you want the endpoint visible in the graph or you're routing through a proxy. A relay that carries Grok Imagine works too, as long as the model version you picked is one it serves - otherwise the error tells you who does.
What to expect from the output
Different, and that's the point. If you're used to Flux-family skin and lighting, Grok's renders land somewhere else: flatter, more graphic, occasionally strange in the way autoregressive image models are strange. Plenty of people use it exactly for that reason and treat the model as a style rather than a replacement.
The other thing to expect is the boundary. "Least restrictive" is comparative. There is no way to patch a closed endpoint, the vendor's policy is enforced server-side, and no provider setting changes what the model will generate (the KB's external-api-nodes.md is unsentimental about this). If the endpoint says no, the local path is the only remaining answer - and that means a different node entirely.
Bruises
Over-length reference counts. Three slots connected, Pro selected, run dies. Read the tooltip: "Up to 3" means this version's limit, and switching versions can silently drop that number.
The batch collapse. image gives you one image unless all generated images share dimensions. Use images if you're varying anything at all.
Legacy node smell. There's an older YogurtGrokGenerateImage under YogurtNodes/LLM/Legacy. It has its own key handling and no provider socket. If you're following an older tutorial, that's the node you'll find; for anything new, use this one.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Prompt sent to the model. | |
| model | COMBO | Model version; the inputs below change with the selected model. | |
| n | INT | 11–10 | Number of images to generate. |
| seed | INT | 00–2147483647 | Sent to the API when the model supports it; changing it also forces a re-run. 0 lets the API pick a random seed. |
| extra | STRING | Optional JSON object merged into the request (for parameters not exposed as inputs). | |
| images | COMFY_AUTOGROW_V3 | Optional reference image(s); batches are expanded. Up to 3. | |
| retry_count | INT | 11–10 | Total attempts on failure. |
| system_promptopt | STRING | System instruction sent with the request. | |
| provideropt | YOGURT_LLM_PROVIDER | Provider node. When unconnected, the official API is used with keys from api_key.json or environment variables. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | All images as one batch (first image only if sizes differ). |
| images | IMAGE | — |
| text | STRING | — |
| thought | STRING | — |