AI图片理解
Reverse-prompt any image straight from the canvas
- image
- text
You've got an image you like and you want to know what to type to get something like it. Drag it into ComfyUI, plug it into this node, hit run, and a few seconds later the text output holds a description ready to feed your sampler. It's image captioning / prompt reversal done through the Qwen-VL family via Alibaba's DashScope API - no local VLM, no VRAM, no model files.
What makes it worth having over the more general multimodal assistant in the same pack is that it's focused. It takes an IMAGE tensor directly, so it slots into a graph the way a Load Image or a preview does, and its entire job is reading the picture. That focus is also why it's the README's recommended workaround when the multimodal assistant throws the 'NoneType' object has no attribute 'is_cuda' error in image mode - this node simply doesn't have that bug.
Under the hood it converts the tensor to a PIL image, drops it as a temp PNG, base64-encodes it, and sends it to the DashScope OpenAI-compatible endpoint as a data URI. The seed input is passed along so you can make the descriptions repeatable, and the text box holds your instruction - the default is essentially "describe what's in this picture, reverse the prompt, no preamble." It's the same captioning job llm-in-comfyui.md tracks as the community default for seeding img2img and training datasets, just on a metered API instead of a local model.
Inputs that matter:
image- the IMAGE tensor to describe. Required.model- pick fromqwen-vl-max(best quality, slower) down to theqwen2.5-vl-*instruct sizes andqvq-72b-preview. Start withqwen-vl-max-latest; drop toqwen-vl-plusif you want speed or your use case is casual.mode-默认,简短, or详细, which just tells the model how verbose to be.out_language- English or Chinese output. If you're feeding the text back into a Flux or SD prompt, English is what the models were trained on.api_keyandbase_url- the key, and the DashScope endpoint, which is pre-filled ashttps://dashscope.aliyuncs.com/compatible-mode/v1.
The single output, text, wires into any text input - a CLIP Text Encode, a prompt box, or the pack's own Flux assistant.
Install: ComfyUI Manager → search "ComfyUI-My-Nodes", or cd ComfyUI/custom_nodes && git clone https://github.com/Tagbliton/ComfyUI-My-Nodes then restart. The pack's requirements.txt pulls in dashscope, openai, requests, soundfile, numpy, and pins urllib3==1.26.20 (don't "fix" that pin - newer urllib3 breaks ComfyUI itself, per the README).
Gotchas. First: no key, no output - and getting a DashScope key requires a real-name-verified mainland China account, which genuinely blocks people outside China; you'll see Invalid Api-Key provided and it won't be your fault. Second: Connection error in the README's terms is network or proxy trouble. And a practical tip - if you're building a training dataset, note this is a metered API, so costs add up fast on thousands of images; for bulk captioning you'd still want a local Qwen-VL or JoyCaption instead.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| api_key | STRING | — | |
| base_url | STRING | https://dashscope.aliyuncs.com/compatible-mode/v1 | — |
| model | COMBO | 9 options: qwen-vl-max, qwen-vl-max-latest, qwen-vl-plus, qwen-vl-plus-latest, qwen2-vl-7b-instruct, qwen2-vl-72b-instruct, +3 | |
| seed | INT | 00–2147483647 | — |
| mode | COMBO | 3 options: 默认, 简短, 详细 | |
| out_language | COMBO | 输出语言 | |
| text | STRING | 图中描绘的是什么景象?提示词反推,直接描述,无需引导句 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |