Nodes/ComfyUI-My-Nodes/AI图片理解
ComfyUI Node

AI图片理解

Reverse-prompt any image straight from the canvas

By Tagbliton·Created 2 years ago·Updated about a year ago· 11
AI图片理解
  • image
  • text
api_key
base_urlhttps://dashscope.aliyuncs.com/compatible-mode/v1
model
seed0
mode
out_language
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 from qwen-vl-max (best quality, slower) down to the qwen2.5-vl-* instruct sizes and qvq-72b-preview. Start with qwen-vl-max-latest; drop to qwen-vl-plus if 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_key and base_url - the key, and the DashScope endpoint, which is pre-filled as https://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.

Category我的节点

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
api_keySTRING
base_urlSTRINGhttps://dashscope.aliyuncs.com/compatible-mode/v1
modelCOMBO9 options: qwen-vl-max, qwen-vl-max-latest, qwen-vl-plus, qwen-vl-plus-latest, qwen2-vl-7b-instruct, qwen2-vl-72b-instruct, +3
seedINT00–2147483647
modeCOMBO3 options: 默认, 简短, 详细
out_languageCOMBO输出语言
textSTRING图中描绘的是什么景象?提示词反推,直接描述,无需引导句

Outputs (1)

NameTypeDescription
textSTRING