Nodes/Comfyui-zhenzhen/zhenzhen-grok-image
ComfyUI Node

zhenzhen-grok-image

Multi-image editing plus a light async path

By T8mars·Created about a year ago·Updated 2 days ago· 740
zhenzhen-grok-image
  • image1
  • image2
  • image3
  • image4
  • image
  • image_urls
  • response
prompt
api_key
modelgrok-4.2-image
aspect_ratio1:1
image_urls
image_wayimage_url
async_modetrue
task_id
poll_interval5
max_poll_attempts180
skip_errorfalse
seed0

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.
  • image1image4 - 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) or base64 for how references travel.
  • async_mode - true by 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.

Categoryzhenzhen/Grok

Inputs (16)

NameTypeDefaultDescription
promptSTRING
api_keyoptSTRING
modeloptCOMBOgrok-4.2-image1 options: grok-4.2-image
aspect_ratiooptSTRING1:1
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
image_urlsoptSTRINGOptional reference image URLs, separated by newline or comma.
image_wayoptCOMBOimage_url2 options: image_url, base64
async_modeoptBOOLEANtrueUse async task submission and poll until the result is ready.
task_idoptSTRINGOptional existing async task id to query instead of submitting a new request.
poll_intervaloptINT52–60
max_poll_attemptsoptINT18010–1200
skip_erroroptBOOLEANfalse开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。
seedoptINT00–18446744073709550000Execution 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)

NameTypeDescription
imageIMAGE
image_urlsSTRING
responseSTRING