Grok Vision Analyze (Image)
Ask Grok what's in your image, without leaving the canvas
- image
- response
- usage
If you've ever wanted to hand an image to Grok and get a sentence back, mid-workflow, without tabbing out to a browser - this is the node. It takes an IMAGE tensor, calls xAI's Grok vision API, and returns a text response you can wire straight into a prompt slot, a caption file, or a text logger. The author calls it "Grok Vision Analyze"; what people actually use it for is auto-captioning a batch, seeding a prompt from a reference image, and quick visual QA ("is the character consistent across these frames?").
What it actually is
An API wrapper, full stop. There's no model to download and nothing runs on your GPU. The node serializes your image tensor to a base64 JPEG (or PNG), POSTs it to https://api.x.ai/v1/chat/completions with your prompt, and prints the model's reply. That means two things before you even install it: you need an xAI API key and a balance, and your image leaves your machine. The privacy trade is the standard one for closed-model API nodes - the community's line is that this is the right tool for a model you can't run locally, and the wrong default for one you can. Grok is very much in the first bucket.
The key goes in as an environment variable - export XAI_API="xai-..." before launching ComfyUI - or pasted into the optional api_key input, which overrides the env var. The node also accepts XAI_API_KEY and GROK_API_KEY if you have those lying around.
Inputs and outputs that matter
- prompt - what you're asking. Defaults to "Describe this image in detail." For captioning you'll want something like "Write a detailed natural-language caption." For prompt-seeding, "Describe this image as a prompt for stable diffusion."
- model - 11 Grok vision models. Default is
grok-4.3-latest. If you're doing high-volume captioning,grok-4-1-fast-reasoningor the non-reasoning variant are the fastest and cheapest; a reasoning model burning tokens mid-graph is usually overkill. - max_tokens (2048 default, up to 100000) and temperature (0.7 default) - the standard knobs. Crank max_tokens if your prompt asks for a long analysis and you're hitting truncation.
- detail -
highby default, which means the API downscales less aggressively and charges more.loworautoif you're captioning a pile of images on a budget. - image_format / jpeg_quality - only the Image variant has these. JPEG at 90 is a good default; switch to PNG only if you're analyzing something like fine text where JPEG artifacts might matter.
Outputs: response (the model's text - feed it into a prompt or Save Text node) and usage (a token count like prompt=1234 completion=567 total=1801, which is how you keep an eye on your bill).
Installing it
This ships in the ComfyUI-DioBrando-Nodes pack. Easiest is ComfyUI Manager → search "ComfyUI-DioBrando-Nodes" → install, then restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/DanielBartolic/ComfyUI-DioBrando-Nodes
cd ComfyUI-DioBrando-Nodes
pip install -r requirements.txt
The requirements are just Pillow, numpy, and torch - all things ComfyUI already has, so there are no heavy deps and no model files. The node shows up under DioBrando/Grok. (The same pack also ships a SCAIL-2 Infinity node; on old ComfyUI builds it's skipped with a warning and the rest of the pack still loads.)
Common issues
- "No xAI API key found" - the env var isn't set and the
api_keyfield is empty. That error message tells you exactly what to do. - HTTP errors - a 401 is a bad key, 429 is rate limiting or a low balance, and the node passes through whatever body xAI returns. Real-world Grok-in-ComfyUI threads show API outages happening now and then, and content-moderation rejections on the API side - if the request dies with a moderation message, that's xAI's filter, not your graph.
- Cost surprises - every run is a metered call, and
detail: highon a big batch adds up fast. Check theusageoutput if something feels expensive.
It's a single-purpose node and it does that one thing cleanly. If you're building captioning or prompt-from-reference pipelines and you're okay with an API bill, it's the simplest way to get Grok in the loop.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | Describe this image in detail. | — |
| model | COMBO | grok-4.3-latest | 11 options: grok-4.3-latest, grok-4.3, grok-4.20-multi-agent-0309, grok-4.20-0309-reasoning, grok-4.20-0309-non-reasoning, grok-4-1-fast-reasoning, +5 |
| max_tokens | INT | 204864–100000 | — |
| temperature | FLOAT | 0.700–2 | — |
| detail | COMBO | high | 3 options: high, low, auto |
| image_format | COMBO | JPEG | 2 options: JPEG, PNG |
| jpeg_quality | INT | 9060–100 | — |
| api_keyopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| usage | STRING | — |