Grok Imagine - image to image
One reference image, one sentence, and a filter switch that isn't magic
- image_urls
- image
- url
- all_urls_json
- task_id
- raw_json
- credits_consumed
- credits_left
What it is
The reference-image mode of xAI's original Grok Imagine image model, under KIE Next / Image / xAI / Grok Imagine. One image in, one prompt, one image out - restyled, re-posed, recontextualised, or just nudged. The catalog documents the input as a single reference image URL, so despite the plural socket name you're feeding it one picture, not a mood board.
Its reputation in this ecosystem is specific: Grok-family image generation is the least restrictive of the big consumer models, which is exactly why people reach for it and exactly why you should read the nsfw_checker tooltip carefully rather than treating the node as a permission slip.
How it works
The connected IMAGE is uploaded to KIE's upload endpoint as PNG and the resulting URL is sent with your prompt to the model's create-task endpoint. The node then polls until the task completes, downloads the result, converts it to a ComfyUI IMAGE tensor, and archives a copy under your output folder. No local model, no VRAM - you're renting this one call at a time.
That upload step is worth remembering for two reasons. It means your reference image leaves your machine, and it means the model receives a re-encoded PNG rather than your original file. For most restyling that's invisible; for work where you care about exact pixel provenance, it isn't.
The inputs
Required:
- image_urls - the
IMAGEsocket. Wire aLoadImage, a local generation, or anything that emits an image tensor. - prompt - a description of the result you want, and the docs allow a genuinely enormous string (up to 390,000 characters, which is not a typo). Practically: describe the whole picture, not the delta. "Recreate this movie poster with two anthropomorphic cats in the same pose" is the author's placeholder, and that's the register that works - you're describing the destination, not issuing a repair order.
Optional: nsfw_checker, default false, and timeout_seconds / callback_url (leave the callback empty for normal ComfyUI use).
About nsfw_checker
Read the tooltip in full, because it does the honest thing and undercuts its own promise: set the checker to false and KIE's content filtering is disabled, results come back as the model produced them - and there is no guarantee anything is filtered out, so if you don't like what you get, that's on you. What it is not is a way around the model's own tendencies or xAI's upstream policy. Our KB's read on the closed-model layer holds here: filtering follows the model, not the node, and a reseller can't remove what the vendor enforces. If you need genuinely unrestricted image editing, that's a local checkpoint with a community LoRA, not an API flag.
Outputs
image is the result tensor. url is the primary result URL and all_urls_json is every URL the task returned - raw_json is the full provider response, and credits_consumed / credits_left are floats that also render on the node after a successful run. That little receipt is the most practically useful output in an API pack: it's how you notice a restyling session has cost more than a month of electricity for the local equivalent.
Install
Manager → search KIE.ai Nodes Next, or:
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
requests, Pillow, numpy, PyYAML. No model files, no GPU budget, but you do need a funded KIE.ai account and network access. Restart ComfyUI, then paste your API key once under Settings → KIE.ai Nodes Next → Connection; it's validated before saving, stored backend-side, and KIE_API_KEY covers headless installs. The pack builds its nodes from KIE's live docs index on first launch and re-syncs about daily, reloading the frontend once at the start.
Gotchas
- One reference image. The catalog's own description of this field is "up to 1 URL string" - don't expect a multi-reference identity system here. For actual character consistency, the pack's Character Packs are the intended path, and even they warn that a reference plus a prompt is not a universal identity lock.
- Described edits drift. The model redraws; it doesn't composite. Expect the subject to move slightly even when you asked for a background swap.
- Provider cost per call, and no free tier. KIE being a reseller usually means cheaper and easier billing than going direct to xAI - it doesn't mean cheap.
- Moderation is upstream.
nsfw_checker=falsereduces filtering; it doesn't guarantee a result. - Missing key surfaces as
No KIE API key configured...- the one-time Settings step.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image_urls | IMAGE | 1–5 image URLs. (Use file URLs after upload, not raw file content. Accepted types: image/jpeg, image/png, image/webp. Max size: 10.0MB per image.) In your prompt, reference the uploaded image by typing @image(n) followed by a space (for example: @image1 a sunset over the ocean). | |
| promptopt | STRING | Recreate the Titanic movie poster with two adorable anthropomorphic cats in the same romantic pose at the bow of the ship. The male cat is an orange tabby wearing a vest, standing behind a white long-haired female cat in a lace dress, holding her paws as they stretch forward in the wind. Both cats are photorealistic with detailed fur, wind-swept hair, and dramatic sunset lighting (warm golden highlights, cool blue shadows). Background: the Titanic ship at dusk with four smokestacks, glowing deck lights, calm ocean, and orange-pink sunset sky. Center title: “CATANIC” in the same gold metallic serif style as Titanic, same size and position. | A text description specifying the desired content or style of the generated image. (Max length: 390000 characters) |
| nsfw_checkeropt | BOOLEAN | false | Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model. |
| 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 | — |