Grok Image Understand
A vision model that reads your images and feeds the answer back in
- image
- image1
- image2
- image3
- image4
- history
- text
- history
- payload
Grok Image Understand is the vision side of the pack's Grok trio: you hand it an image, it asks xAI's vision model what's going on, and hands the description back as a STRING - which you can then feed into a prompt, a caption field, or a classification branch in your workflow. It turns "what does this image contain" into a graph question instead of a manual look-and-type step.
The practical uses stack up fast. Auto-captioning a batch before you re-prompt or re-inpaint. Turning a reference image into a written description you can feed to a different generator. Or the meta workflow: generate an image, have Grok describe it, then use that description to refine the next generation. If you've ever written "describe this image" prompts by hand, this automates the loop. And because it's an API call, it doesn't care about your GPU - a 6GB card that can barely run a sampler can still caption 4K images all day.
How it works
It sends your image(s) to the xAI vision model (default grok-4) as part of a chat request built from system_prompt, prompt, and the chat_template. Up to five images go in: the main image input plus image1–image4, useful for comparing variations or asking "what's different between these two?" It supports history for follow-up questions ("and what color is the car in the first one?") and extra JSON for new API fields. Two details worth knowing: image_send_mode chooses between the standard OpenAI-style image_url object and xAI's base64 url field (switch it if the API rejects your images), and image_detail controls vision resolution - high for detailed scrutiny, low/auto for speed and fewer tokens.
The inputs that matter
api_key- your xAI key; blank falls back toXAI_API_KEY/GROK_API_KEYenv vars or the pack'sapi_key.json.prompt- the question. "Describe this image in detail" is the classic, but specific questions get better, more useful answers.system_prompt- role and style for the reply, e.g. "you are a terse booru-style tagger."image- the image to analyze (plusimage1–image4for multi-image queries).
Three outputs: text (the answer), history, and payload (raw response for debugging).
Installing it
It's part of ComfyUI-YogurtNodes. Install via ComfyUI Manager (search "ComfyUI-YogurtNodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Restart ComfyUI; it's under "Yogurt Nodes". You'll need an xAI API key (console.x.ai) - the vision models are paid.
Where people get burned
The two knobs that cause silent trouble are image_send_mode and image_detail. If images fail to send or the API complains about the image field, flip image_send_mode from "openai" to "base64" (and back if you switch providers). Keep image_detail at high for anything you actually need described precisely - the cheaper settings save tokens but miss details, and the whole point of this node is catching what you'd miss by eye. Also be honest about cost: vision calls bill per image per question, so a batch of 500 frames is a real line item. And if answers come back stale or templated, check the chat_template - same trap as the other Grok nodes.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | API key for accessing xAI API | |
| base_url | STRING | Base URL for xAI API (leave blank for official API) | |
| model_name | STRING | grok-4 | xAI vision model name |
| system_prompt | STRING | System-level prompt that affects the overall conversation style | |
| prompt | STRING | Question or instruction about the image | |
| temperature | FLOAT | 1.000–2 | Sampling temperature, higher values produce more random outputs |
| top_p | FLOAT | 0.000–1 | Sampling probability threshold, controls output diversity |
| max_tokens | INT | 40960–32768 | Maximum number of tokens in the generated text |
| frequency_penalty | FLOAT | 0.00-2–2 | Frequency penalty to reduce repetition |
| presence_penalty | FLOAT | 0.00-2–2 | Presence penalty to encourage new topics |
| retry_count | INT | 11–10 | Number of retry attempts if the request fails |
| chat_template | STRING | <-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user-> | Content template for the generated text |
| proxy_url | STRING | 代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h | |
| seed | INT | -1-1–2147483647 | Random seed for generation (-1 for random) |
| timeout | INT | 00–2147483647 | Timeout for the request in seconds, 0 means no timeout |
| imageopt | IMAGE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| historyopt | HISTORY | — | |
| extraopt | STRING | {} | Extra parameters for the request, in JSON format |
| image_send_modeopt | COMBO | openai | 图片发送方式: openai(标准image_url对象), base64(x.ai兼容url字段) |
| image_detailopt | COMBO | high | Image detail level for vision understanding |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| history | HISTORY | — |
| payload | * | — |