Grok Imagine - Text to Image
6 images per call, one node, and two switches that matter
- image
- url
- all_urls_json
- task_id
- raw_json
- credits_consumed
- credits_left
What it is
xAI's Grok Imagine image model, text-to-image, as a node under KIE Next / Image / xAI / Grok Imagine. It's the same model family that powers image generation inside Grok on X - the one our KB's closed-model page flags as the least restrictive of the big consumer image models, and which the community has suspected for years of being Flux-derived under the hood.
Why reach for it over a local checkpoint? Mostly two reasons: it's fast and it's cheap per image, and its taste is different from your fine-tunes. For concepting - throwing eight variations at an idea before you commit to a local render - a closed API node in the graph is a perfectly sensible use of a metered credit. For anything you'd iterate on fifty times, stay local.
How it works
The node submits your prompt to KIE's create-task endpoint, polls until the task reports results, downloads them, converts the first result into a ComfyUI IMAGE tensor and archives the file under your ComfyUI output folder. All the ordinary pack plumbing - the same submit-and-wait behaviour as every model node in this collection, with timeout_seconds guarding the wait.
One detail worth knowing before you spend anything: this endpoint returns multiple images per task. Grok's image tasks are documented elsewhere in the pack as producing six images per task, and the node's companion behaviour in Image-to-Video - where you pick index 0–5 from a previous task - confirms it. Here you get the first result on the image socket and every URL in all_urls_json, which you can fan out with the pack's Download Image utility if you want all six in the graph.
The inputs
Required: prompt (up to 5000 characters, English is what it's tuned for - describe composition, lighting, mood).
Optional:
- aspect_ratio -
3:2(default),2:3,1:1,16:9,9:16. - enable_pro - off is speed mode, on is quality mode. That's the author's tooltip and it's the most consequential switch on the node: when your text matters or the composition is fiddly, turn it on; when you're fishing for concepts, leave it off.
- nsfw_checker - defaults to
false, and the tooltip spells out what that means: with the checker off, KIE's filtering is disabled and whatever the model produces gets returned. That is not a promise of anything. Our KB's read stands: the provider's own moderation still applies somewhere upstream, Grok's filter is lighter than its peers, and "no guarantee that everything can be filtered out" is the vendor's own wording. - timeout_seconds and callback_url - plumbing; leave the callback empty for normal ComfyUI use.
Outputs
image (IMAGE), url (primary result URL), all_urls_json (every result URL), task_id, raw_json, credits_consumed, credits_left. Wire image into SaveImage, an upscaler, or the pack's Grok Imagine - image to image node if you want to iterate on the result. Keep task_id around - the video nodes in this pack take a previous image task_id as an input, which is how you animate a still you just generated.
Install
Manager → KIE.ai Nodes Next, or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
python -m pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
Requirements are requests, Pillow, numpy, PyYAML - no models to download, because the model lives on KIE's servers. Restart, then paste your KIE.ai key once under Settings → KIE.ai Nodes Next → Connection.
The pack builds its node list from KIE's docs index on launch and re-syncs about daily, occasionally reloading the frontend on the first run. If the Grok Imagine folder looks emptier than this article, force a catalog refresh rather than reinstalling.
Gotchas
- You're paying per call, and each call may return six images. Budget accordingly; KIE is a reseller between you and xAI, which usually means cheaper and easier to pay for than going direct, but it's still metered.
enable_prochanges the model's behaviour, not a post-process. Don't expect the same composition at a different quality; expect a different composition.- Six images, one socket. If you wanted the other five, read
all_urls_json- theimageoutput is just the first. - No key, no runs. The error string is
No KIE API key configured.It's the one-time Settings step, not your graph. - Provider moderation still exists. Turning the checker off reduces filtering; it doesn't remove the vendor's policy or the model's own tendencies.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Cinematic portrait of a woman sitting by a vinyl record player, retro living room background, soft ambient lighting, warm earthy tones, nostalgic 1970s wardrobe, reflective mood, gentle film grain texture, shallow depth of field, vintage editorial photography style. | Text prompt describing the desired image. Required field. - Should be detailed and specific about the desired visual elements - Describe composition, style, lighting, mood, and other visual details - Maximum length: 5000 characters - Supports English language prompts |
| aspect_ratioopt | COMBO | 3:2 | Specifies the width-to-height ratio of the generated image. Controls the aspect ratio of the output. - **2:3**: Portrait orientation (vertical) - **3:2**: Landscape orientation (horizontal) - **1:1**: Square format - **16:9**: Wide screen format - **9:16**: Tall screen format Default: 1:1 |
| nsfw_checkeropt | BOOLEAN | false | Defaults to false. You can set it to false based on your needs. If set to false, our content filtering will be disabled, and all results will be returned directly by the model itself. Note: There is no guarantee that everything can be filtered out; if you are not satisfied with the results, you will need to make your own arrangements. |
| enable_proopt | BOOLEAN | false | Controls the request processing strategy. - `false`: Corresponds to **speed mode**. The system prioritizes response time and throughput, suitable for latency-sensitive scenarios. - `true`: Corresponds to **quality mode**. The system prioritizes processing quality and precision, suitable for scenarios requiring higher accuracy. |
| timeout_secondsopt | INT | 120030–7200 | — |
| callback_urlopt | STRING | Optional KIE callback URL. Leave empty for normal ComfyUI use. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| url | STRING | — |
| all_urls_json | STRING | — |
| task_id | STRING | — |
| raw_json | STRING | — |
| credits_consumed | FLOAT | — |
| credits_left | FLOAT | — |