Dashscope Model Caller
The node that actually talks to Qwen
- image
- STRING
This is the workhorse of the ComfyUI-Dashscope pack. Where the two "Loader" nodes just hand you a model ID string, the Dashscope Model Caller is the one that sends your prompts to Alibaba's DashScope API and gets an answer back. Give it a system prompt, a user prompt, and a model ID, and it returns the model's reply as text you can pipe anywhere in your graph.
The genuinely nice design decision: it's one node for two jobs. Connect only text and it calls a plain LLM. Connect an image too and it silently switches to a vision-language model that can see the picture. Same node, same output, mode chosen by what you plug in.
How it works
The node checks whether an image is attached. No image → it calls Generation (text-only Qwen) with your system and user messages. Image attached → it calls MultiModalConversation (the VLM path), saving a copy of your image to ComfyUI's output folder and passing it to the DashScope SDK, which handles getting it to Alibaba's servers. Either way it pulls the text out of the first response choice and returns it as a STRING, and because the node is marked as an output node, the reply renders right on the node in the UI.
Inputs and output
- model_version (STRING, no default) - the model ID. Wire it from DashscopeLLMLoader or DashscopeVLMLoader, or just type
qwen-max/qwen-vl-maxyourself. Only a vision model will accept the image path. - system_prompt (STRING) - the instruction that sets the model's role. Keep it tight: "You are a prompt writer for a photorealistic model."
- user_prompt (STRING) - your actual request.
- image (IMAGE, optional) - connect one to switch into vision mode. Must be a VLM model ID, or the API will reject it.
The single STRING output carries the model's reply. The most popular thing to do with it is feed it into your text encoder - this is the classic "LLM-assisted prompting" move the ComfyUI community converged on: have an LLM translate your rough idea into a well-structured prompt, then let the image model encode it. On today's LLM-encoded models (Z-Image, Flux 2, Anima) that fits the architecture rather than fighting it, because your prompt is being read as a message by an LLM anyway. You can also wire the output to a save node, or just read it on the node.
Troubleshooting
- "DASHSCOPE_API_KEY environment variable is not set" - the classic. The node reads the key from your environment at call time, so set it in your shell before launching ComfyUI (or in OS environment variables) and restart. There's no UI box for it. Get the key at the Bailian console (Alibaba Cloud Model Studio).
- Model/picture mismatch - a text-only model (
qwen-max) with an image attached, or a vision model with no image, both fail at the API. Match the mode to the model. - Empty prompts - the node raises on missing system or user prompt. If you're only using a system prompt, put a period in the other box rather than nothing.
- Keep the SDK current - the pack depends on
dashscope; if you get odd upload or auth errors,pip install -U dashscopefirst.
Install
In ComfyUI Manager, search ComfyUI-Dashscope. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/neverbiasu/ComfyUI-Dashscope
pip install -r requirements.txt
Restart, set DASHSCOPE_API_KEY, and remember this is a paid cloud API - every call bills against your Alibaba account. One practical note from the community: getting a Dashscope key is smooth if you're already an Alibaba Cloud user, but some models and regions want mainland-China verification, so budget a little time for account setup on your first try. And since this node sends your prompts and images to Alibaba's servers, treat it like any API node: don't wire in data you'd be embarrassed to send off-machine.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_version | STRING | — | |
| system_prompt | STRING | — | |
| user_prompt | STRING | — | |
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |