zhenzhen-grok-image
Multi-image editing plus a light async path
- image1
- image2
- image3
- image4
- image
- image_urls
- response
xAI's image model - grok-4.2-image, aka Grok Imagine - wrapped for ComfyUI, with a light async mode and multi-image editing. Comfly_grok_image takes a prompt plus up to four reference images (or image URLs, if your references are already hosted) and generates or edits. It's the image sibling to the Grok video nodes, and it's the quiet utility player in the pack: not the flashiest model on the roster, but fast, cheap-ish, and reliable when you need a Grok-flavored result in your graph.
The mechanism is the standard relay pattern: upload your images to the file endpoint, submit the job (async by default via async_mode), poll until it's done, download, and return an IMAGE tensor. The async default matters because image jobs on Grok can take a while, and async means ComfyUI keeps breathing while it renders.
The inputs that matter
- prompt - the generation or edit instruction.
- model -
grok-4.2-image, fixed for now (the changelog mentions grok-imagine-2 as work-in-progress; when it lands, it'll presumably be a dropdown choice). - aspect_ratio - a free STRING, default
1:1. Type what you need (16:9,9:16,4:3...). Unlike the dropdown-driven nodes, this one trusts you to type a valid value. - image1–image4 - reference images for editing, or image_urls - a text field with URLs separated by newlines or commas. The tooltip is explicit about the format.
- image_way -
image_url(default) orbase64for how references travel. - async_mode -
trueby default; with task_id you can also query an existing async job instead of submitting a new one. - poll_interval and max_poll_attempts - the wait loop (default 180 × 5s = 15 minutes).
Outputs: image (IMAGE tensor), image_urls (hosted results), and response (JSON).
Install and key
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-zhenzhen
Restart, or ComfyUI Manager → "Comfyui-zhenzhen". Key from ai.t8star.org into api_key.
Notes
If you're feeding image_urls, use real, stable URLs - signed, time-limited links will expire mid-job and cost you a retry. When you mix local images and URLs, the node handles both, but keep one image_way consistent for your reference transport. The usual pack caveats apply: transient 500s re-run clean, async means the task_id is your handle into the site's job list, and your images and prompt leave the machine. It's a workhorse node - nothing exotic, just Grok image generation done without a fuss.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_keyopt | STRING | — | |
| modelopt | COMBO | grok-4.2-image | 1 options: grok-4.2-image |
| aspect_ratioopt | STRING | 1:1 | — |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image_urlsopt | STRING | Optional reference image URLs, separated by newline or comma. | |
| image_wayopt | COMBO | image_url | 2 options: image_url, base64 |
| async_modeopt | BOOLEAN | true | Use async task submission and poll until the result is ready. |
| task_idopt | STRING | Optional existing async task id to query instead of submitting a new request. | |
| poll_intervalopt | INT | 52–60 | — |
| max_poll_attemptsopt | INT | 18010–1200 | — |
| skip_erroropt | BOOLEAN | false | 开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。 |
| seedopt | INT | 00–18446744073709550000 | Execution seed for ComfyUI cache control. Fixed reuses the cached result; randomize/increment/decrement requests a new run. This compatibility seed is not sent to APIs that do not expose a native seed parameter. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_urls | STRING | — |
| response | STRING | — |