Nodes/SDXL Auto Prompter/APNext Grok Vision Analyzer
ComfyUI Node

APNext Grok Vision Analyzer

Caption an image into a prompt using Grok vision

By dagthomas·Created 3 years ago·Updated 13 days ago· 283
APNext Grok Vision Analyzer
  • images
  • STRING
happy_talktrue
compressfalse
compression_level
posterfalse
grok_modelgrok-2-vision-1212
custom_base_prompt
custom_title
override

Point it at an image, get a text prompt describing it. GrokVisionNode (APNext Grok Vision Analyzer) is the xAI vision equivalent of this pack's GPT and Groq vision nodes - it sends your images to Grok's multimodal API and returns a description you can feed straight into a generation. Reach for it if you're already in the xAI ecosystem, or if you want a second opinion when GPT's caption isn't landing.

It's the vision side of the same idea running through the whole pack: modern image models read prose, so a good caption is a good prompt, and a multimodal LLM writes that caption faster than you can. dagthomas built one vision node per provider so you can use whichever key you've got.

How it works

API call, nothing local. Your image goes up, Grok describes it, text comes back - so it needs a key and it bills per image. The grok_model dropdown lists Grok's vision-capable models (the grok-2-vision line plus the grok-4 variants). Vision calls are pricier than text, so model choice matters here more than on the text node.

The controls are the pack's shared style set, identical to the text nodes:

  • happy_talk (on) - enthusiastic vs. plain description.
  • compress + compression_level (soft / medium / hard) - trim the caption. Useful; a rambling description makes a worse prompt than a tight one.
  • poster - poster-style formatting, off by default.

Optional custom_base_prompt and override swap out the built-in analysis instruction when you want to steer what it describes. One STRING output - wire it into your positive text encode.

Note the shape difference from GptVisionCloner: this node has no fade_percentage and no faded_image output. It's a straight one-image-to-caption node, not a multi-reference blender.

Installing it

ComfyUI Manager: search comfyui_dagthomas, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas
pip install -r requirements.txt

The install drags in the whole multi-provider dependency tree, not just the HTTP client this node needs. Then set XAI_API_KEY (or GROK_API_KEY) as an environment variable before starting ComfyUI.

Common issues

No output. Check the key first - XAI_API_KEY has to be exported in the shell that launched ComfyUI. And confirm you picked an actual vision model; a text-only Grok model will refuse an image.

Model 404s. The Grok lineup changes often, and vision models get renamed or retired. If the dropdown model errors, pick a current one, or edit data/grok_models.json in the pack and restart.

Costs creep up. Vision tokens aren't cheap, and reasoning-tier models make it worse for no captioning benefit. If you're batch-captioning, use the lightest vision model that gives you a usable description, and don't run it per video frame unless that's genuinely the goal.

Categorycomfyui_dagthomas/LLM

Inputs (9)

NameTypeDefaultDescription
imagesIMAGE
happy_talkBOOLEANtrue
compressBOOLEANfalse
compression_levelCOMBO3 options: soft, medium, hard
posterBOOLEANfalse
grok_modelCOMBOgrok-2-vision-12124 options: grok-2-vision-1212, grok-4-0709, grok-4-fast-reasoning, grok-4-fast-non-reasoning
custom_base_promptoptSTRING
custom_titleoptSTRING
overrideoptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING