Nodes/ComfyUI_DW_Chat/通义千问VL API多功能视觉分析
ComfyUI Node

通义千问VL API多功能视觉分析

OCR, reasoning, and prompt feedback

By yiwangsimple·Created 2 years ago·Updated about a year ago· 89
通义千问VL API多功能视觉分析
  • image
  • result
prompt分析这张图片并提供详细描述。
modelqwen-vl-max-0809
taskgeneral
temperature0.7
max_tokens1024

The Qwen2VLCaption node (its display name is Chinese: 通义千问VL API多功能视觉分析, "Qwen VL API multifunctional visual analysis") sends whatever image is in your graph to Alibaba's cloud Qwen-VL models and hands the answer back as text. It's one half of the pack's Qwen2VL pair from yiwangsimple/ComfyUI_GroqChat: this is the API variant, and its sibling Qwen2VLLocalCaption runs the open 2B model on your own GPU.

Reach for it when you want the strong model without paying the local VRAM cost. The built-in task presets make it a five-in-one node: describe the image, OCR the text in it, reason about a question, read it in Chinese, or - the interesting one - prompt_generation, which turns an image back into a text-to-image prompt. That last mode is a neat feedback loop for someone trying to reverse-engineer a look.

First, the name is a bit of a lie. Despite "Qwen2VL" in the class name, the dropdown lists the older Qwen-VL API family - qwen-vl-max-0809, qwen-vl-max, qwen-vl-plus, qwen-vl - served through Alibaba's DashScope platform. Same Qwen family, different generation. Don't expect it to be the open Qwen2-VL weights.

How it works

The node base64-encodes your image, builds a chat message with a per-task system prompt, and calls DashScope's MultiModalConversation endpoint. Two details in the code are worth knowing:

  • It retries up to 3 times with exponential backoff (tenacity), so transient failures usually just cost you a few seconds.
  • It temporarily strips HTTP_PROXY/HTTPS_PROXY environment variables before the call. That's great if a broken proxy normally breaks your requests, and it's a problem if a proxy is the only way you reach the internet - the call will fail outright.

Inputs and outputs

  • image - an IMAGE tensor from Load Image or whatever's upstream.
  • prompt - your instruction or question (default is Chinese for "analyze this image and give a detailed description"; it's just text, write whatever language you like).
  • model - pick the tier. qwen-vl-max-0809 (default) is the strongest; qwen-vl-plus is cheaper.
  • task - general, ocr, visual_reasoning, chinese_understanding, or prompt_generation. The task prepends its own instruction, then appends your prompt.
  • temperature (0–1) and max_tokens (default 1024) - self-explanatory.

Output is a single result STRING. Wire it into any text input downstream, or into a Show Text node to read it.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/yiwangsimple/ComfyUI_GroqChat

Restart ComfyUI. Requirements include dashscope, tenacity, and httpx, which Manager will handle. Then the real setup: a DASHSCOPE_API_KEY in api_key.ini (copy api_key.ini.example.ini from the pack folder and fill in the key from Alibaba's Model Studio / DashScope console). It's a paid API - unlike Groq, this one isn't free - so watch your max_tokens on big batches.

Common issues

No key (or a wrong one) returns an error string from the node telling you to check api_key.ini. Outside mainland China the setup friction is real: DashScope is Alibaba's China-focused platform, billing and phone verification can be a hassle, and some regions struggle to reach it at all. If that's you, the local Qwen2VLLocalCaption sibling sidesteps the whole account question - at the cost of GPU memory.

Category🌙DW/Qwen2VL

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
promptSTRING分析这张图片并提供详细描述。
modelCOMBOqwen-vl-max-08094 options: qwen-vl-max-0809, qwen-vl-max, qwen-vl-plus, qwen-vl
taskCOMBOgeneral5 options: general, ocr, visual_reasoning, chinese_understanding, prompt_generation
temperatureFLOAT0.70–1
max_tokensINT10241–2048

Outputs (1)

NameTypeDescription
resultSTRING