API Qwen Text Gen
Eight Alibaba models in one ComfyUI node
- text
API Qwen Text Gen is the Swiss Army text node of this pack: one node, one key, and a dropdown that spans essentially the whole Alibaba Cloud Qwen line-up - plus DeepSeek V3, funnily enough. If you want an API LLM inside your workflow and you already have a DashScope key, this is probably the only text-generation node you need to install.
The job is the standard LLM-in-the-graph one: you feed it a rough idea and it writes you a structured prompt, or a caption, or dialogue for a video - anything text-shaped that you'd rather not hand-write. Because it's an API call it needs no VRAM and no local model download, and the qwen-turbo-latest end of the dropdown is cheap enough to run on every batch. The Qwen models are also notably good at following a strict format instruction, which is what you want when the output has to look like a prompt and not a chat message (that whole failure mode is covered in llm-in-comfyui.md).
How it works
It talks to DashScope's OpenAI-compatible endpoint (https://dashscope.aliyuncs.com/compatible-mode/v1) using the openai SDK. The model dropdown is the real deal here - unlike the DeepSeek nodes, the model name actually gets sent to the API. Your choices include qwen-max-latest (the flagship, default), qwen-plus-latest, qwen-turbo-latest (fast/cheap), the long-context qwen2.5-7b-instruct-1m / 14b (1M-token context!), the newer qwen3-30b-a3b and qwen3-235b-a22b MoE models, and even deepseek-v3. The API key comes from the DASHSCOPE_API_KEY environment variable or the api_key field, in that order.
The inputs that matter
prompt(multiline) - your request. This is the one you'll be editing.system_prompt(multiline) - set the persona and output format here. For prompt generation, something like "You are a prompt engineer. Output only the prompt, no commentary." saves you a lot of post-processing.model- pick your cost/quality tradeoff. Start withqwen-plus-latestorqwen-turbo-latest; escalate toqwen-max-latestif the output feels dumb.api_key- blank if the env var is set. Pasted keys live in your workflow JSON, so don't share that file.seed- accepted but never sent to the API. Decorative.
Output is a single text STRING, ready to wire into a prompt text box, a text viewer, or a concat node.
Installing it
Part of ComfyUI_Prompt-All-In-One by billwuhao. ComfyUI Manager → search Prompt-All-In-One, or clone manually:
cd ComfyUI/custom_nodes
git clone https://github.com/billwuhao/ComfyUI_Prompt-All-In-One.git
cd ComfyUI_Prompt-All-In-One
pip install -r requirements.txt
Restart, find it under 🎤MW/MW-Prompt-All-In-One.
Where people get burned
The key again: apply for one at Alibaba Cloud Bailian, set DASHSCOPE_API_KEY, and on Windows reboot once so the env var registers. The API Key is not set error means both the env var and the field are empty. Two gotchas worth knowing beyond that. First, the same DashScope key works for every Qwen node in the pack - including the _R reasoning one, the image/video/audio captions and deepseek-r1 through DashScope - so one key covers a lot of graph. Second, model names are aliases that change over time; -latest suffixes track Alibaba's rolling releases, so pinning a dated name (qwen3-30b-a3b) gives reproducible behavior while -latest gives you updates for free. The -1m models are the sleeper feature: a million tokens of context means you can stuff an entire script or lore document into the prompt and have it summarized into a prompt style you actually want.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| system_prompt | STRING | — | |
| prompt | STRING | — | |
| model | COMBO | qwen-max-latest | 8 options: qwen-max-latest, qwen2.5-7b-instruct-1m, qwen2.5-14b-instruct-1m, deepseek-v3, qwen-plus-latest, qwen-turbo-latest, +2 |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |