Vision Chat Once
Hand your generation to a VLM and get a caption back
- endpoint
- image
- text
- response_json
- finish_reason
- usage_json
This is the "what did I just generate?" node. It takes an image straight from your ComfyUI graph, sends it - along with a text prompt - to a vision-capable LLM on a local OpenAI-compatible server, and hands you back the model's answer as a string. Auto-captioning for a dataset, tagging, an LLM-as-judge critique of your own output, "describe this for a prompt": all of it becomes a node in your graph instead of a round trip to some website.
It's the sibling of Chat Once in the same pack - same outputs, same one-shot philosophy, same zero-extra-dependency approach - but with an image input bolted on and a stricter requirement: the model on your server actually has to see images. Most local LLMs don't, so this is the node where the model choice matters most.
How it works
It takes the first image of whatever IMAGE batch you feed it (yes, only the first frame - a deliberate v1 limitation, not a bug) and encodes it to a PNG data URL using only Python's standard library - struct, zlib, base64, hand-rolled PNG chunks. No PIL, no torchvision, no extra package that could go stale or, worse, be compromised. It then builds the OpenAI-compatible image_url message format and POSTs to {base_url}/chat/completions, exactly like Chat Once but with a picture in the user message.
You must still supply the endpoint from Compatible Endpoint - that's where the model name comes from, and that's where you'll pick a vision model.
The inputs and outputs that matter
endpoint- fromCompatible Endpoint; the model on it must support images.image- the IMAGE tensor; first frame only.system_prompt/user_prompt- prompt it to describe, tag, or judge.max_tokens(10240),seed,timeout_seconds(60) - same asChat Once.extra_body_toml- addtemperatureorresponse_formathere.strict_finish_reason(true) /strip_think_tags(false) - same semantics as the text node.
Outputs: text (the reply), response_json (raw response - useful when a VLM says something weird and you want to see what it actually returned), finish_reason, usage_json.
Install
Part of ComfyUi_zaknak_nodes - ComfyUI Manager, or git clone https://github.com/zaknak/ComfyUi_zaknak_nodes into ComfyUI/custom_nodes, then restart. No model downloads on the ComfyUI side; the vision model lives in your server. LM Studio, Ollama, llama.cpp server, and vLLM all expose OpenAI-compatible vision endpoints if you load a vision model in them.
Troubleshooting
- Text-only model on the server: it'll usually error, sometimes confusingly (empty content, odd finish reasons). The fix isn't the node - load a real VLM like a Qwen-VL or Llama 3.2 Vision build in your server.
- "image input is empty": the
IMAGEtensor had zero frames. Check what's upstream. - Only the first image got sent: yes, that's by design - multi-image input is explicitly out of scope for v1.
finish_reason must be 'stop', got: 'length': truncation again; raisemax_tokensor relaxstrict_finish_reason.- Struggling with output format: use
extra_body_tomlwith aresponse_formatfor structured answers, or a Prompt Preset template with tight instructions.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| endpoint | COMPATIBLE_ENDPOINT | — | |
| image | IMAGE | — | |
| system_prompt | STRING | — | |
| user_prompt | STRING | — | |
| max_tokens | INT | 102400–65535 | — |
| seed | INT | 00–2147483647 | — |
| extra_body_toml | STRING | — | |
| strict_finish_reason | BOOLEAN | true | — |
| strip_think_tags | BOOLEAN | false | — |
| timeout_seconds | FLOAT | 60.00.1–300 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| response_json | STRING | — |
| finish_reason | STRING | — |
| usage_json | STRING | — |