ComfyUI_Qwen_chat_models Introduction
ComfyUI_Qwen_chat_models adds Qwen chat nodes to ComfyUI workflows. You can use them to generate text from a prompt or to ask a model about an image. The response is a STRING output that you can connect to other compatible nodes in your workflow.
The extension offers two types of node:
- Qwen handles text-only conversations. It accepts a system prompt and a user prompt.
- QwenVL handles a text prompt with an optional image, so you can ask questions about visual content as well as generate text.
The extension also gives you control over how models use memory. You can choose a quantized model load to reduce memory requirements, keep a frequently used model loaded for faster repeat runs, or unload a model after use to free VRAM.
How ComfyUI_Qwen_chat_models Works
Think of a node as a step in your creative workflow. You give the Qwen node instructions, it runs the selected model, and it passes the model’s written response to the next step.
For a text-only task, use the Qwen node. Its system field sets the general role or behavior, while its prompt field contains the specific request. For example, you might set the system instruction to “Write concise image descriptions” and then ask for a description of a scene.
For an image-related task, use QwenVL. Enter a question in its text field and connect an image to its optional image input. The node sends both to the selected vision-language model and returns a text response. You can also use QwenVL without an image.
The first time you select a model, the extension downloads it from Hugging Face into ComfyUI/models/LLM/<model_name>/. If the model is already stored there, the extension can load that local copy instead. A model must then be loaded into memory before it can respond. The cache settings determine whether it stays loaded for another run or is unloaded afterward.
ComfyUI_Qwen_chat_models Features
Text and image conversations
- Qwen node: Takes a multiline system instruction and a multiline prompt. Use it when your task needs only text.
- QwenVL node: Takes a multiline text prompt and can also take a ComfyUI
IMAGE. Use it when you want the response to consider an image.
Both nodes return the model’s response as text. The QwenVL node also displays a video_path input, but it is reserved and is not currently used by the implementation. Supplying a path there will not enable video analysis.
Response controls
Both nodes offer these settings:
| Setting | What it controls | Practical effect |
|---|---|---|
| model | Which Qwen checkpoint produces the response | Choose a text model for the Qwen node or a vision-language model for QwenVL. |
| temperature | Variation in generated responses | Adjust it when you want to change how predictable or varied a response is. |
| max_new_tokens | The maximum length of the generated response, measured in tokens | Lower it for shorter responses; raise it when you need more room for detail. Tokens are pieces of text, not necessarily whole words. |
| seed | The random seed used during generation | Set a value when you want to control the random starting point. -1 means the node does not set a seed. |
| quantization | How the model is loaded into memory: none, 4bit, or 8bit | 4bit and 8bit can reduce memory use, but require a working bitsandbytes setup. Use none if quantization is unavailable. |
A seed helps you control one source of variation, but it should not be treated as a guarantee of identical responses under every setup.
Model cache and VRAM controls
Loading a model takes time and memory. The extension’s shared model cache lets later node runs reuse a model that is already loaded.
- model_loaded_permanently: Pins the selected model in the cache so the cache’s least-recently-used eviction process will not remove it. This is useful when you repeatedly run the same model.
- offload_after_used: Unloads the model and attempts to clear VRAM after a run. This is useful when memory is limited or you need room for another model.
- Cache limit:
QWEN_MAX_LOADED_MODELSsets how many models can be loaded at once. Its default is2. If the limit is reached, the cache can evict the least-recently-used model that is not pinned.
Pinning favors faster repeat use; offloading favors freeing memory after use. Choose the behavior that fits your workflow rather than relying on both settings to achieve the same goal. The cache limit counts model entries, not the associated processor or tokenizer, which remain cached separately.
You can see the basic nodes and cache controls in the author’s sample workflows:
- Basic workflow
Basic Qwen node workflow - Advanced cache-management workflow
Workflow demonstrating advanced cache management
The advanced example demonstrates why keeping a model loaded can make a later call to the same node significantly faster.
ComfyUI_Qwen_chat_models Models
The node’s model dropdown determines which checkpoint runs your request. Model names containing VL belong to the QwenVL node and can work with image input. The other listed models belong to the text-only Qwen node.
The number followed by B indicates a model’s approximate size class. As a general guide, a larger model can require more memory; a smaller option is a sensible place to start when resources are limited. Instruct and Thinking are distinct checkpoint variants. The extension lists them as choices, but the provided documentation does not specify task-by-task performance differences between those variants.
Vision-language models for QwenVL
| Model | When to consider it |
|---|---|
Qwen2.5-VL-3B-Instruct | A smaller Qwen2.5-VL option for text-and-image requests. |
Qwen2.5-VL-7B-Instruct | A larger Qwen2.5-VL option if your system has more available memory. |
Qwen3-VL-2B-Instruct | The smallest listed Qwen3-VL Instruct option. |
Qwen3-VL-2B-Thinking | The 2B Qwen3-VL Thinking variant. |
Qwen3-VL-4B-Instruct | A 4B Qwen3-VL Instruct option. |
Qwen3-VL-4B-Thinking | The 4B Qwen3-VL Thinking variant. |
Qwen3-VL-8B-Instruct | An 8B Qwen3-VL Instruct option. |
Qwen3-VL-8B-Thinking | The 8B Qwen3-VL Thinking variant. |
Qwen3-VL-32B-Instruct | The largest listed Qwen3-VL Instruct option; consider memory availability before selecting it. |
Qwen3-VL-32B-Thinking | The largest listed Qwen3-VL Thinking option; consider memory availability before selecting it. |
Text-only models for Qwen
| Model | When to consider it |
|---|---|
Qwen2.5-3B-Instruct | A smaller text-only Qwen2.5 option. |
Qwen2.5-7B-Instruct | A 7B text-only Qwen2.5 option. |
Qwen2.5-14B-Instruct | A larger text-only Qwen2.5 option. |
Qwen2.5-32B-Instruct | The largest listed text-only Qwen2.5 option. |
Qwen3-8B-Instruct | An 8B Qwen3 text-only Instruct option. |
Qwen3-4B-Instruct-2507 | A 4B Qwen3 text-only Instruct variant. |
Qwen3-4B-Thinking-2507 | A 4B Qwen3 text-only Thinking variant. |
If a selected model does not fit in available VRAM, try a smaller listed model or an available quantization setting.
Troubleshooting ComfyUI_Qwen_chat_models
“Cannot load pinned model”
This means the number of pinned models has exceeded the cache’s loaded-model limit.
- Find nodes with model_loaded_permanently enabled.
- Turn it off for models you do not need to keep loaded.
- Run the workflow again. If you need more pinned models at once, the
QWEN_MAX_LOADED_MODELSenvironment variable can raise the limit from its default of2, provided your system has enough memory.
A 4bit or 8bit option causes a bitsandbytes error
Quantized loading depends on bitsandbytes and a compatible CUDA environment.
- Set quantization to
noneand try the node again. - If that works, the issue is likely with the quantized-loading setup rather than your prompt.
- To use
4bitor8bit, check thatbitsandbytesis installed correctly for your CUDA environment.
A CUDA out-of-memory error appears, or VRAM remains occupied
- Try a smaller model from the relevant node’s dropdown.
- Reduce max_new_tokens if you do not need a long response.
- Try
4bitor8bitquantization if it works in your environment. - Enable offload_after_used to unload the model and attempt VRAM cleanup after each run.
- Avoid pinning models you do not need to reuse immediately.
Frequently asked questions
Can I use an image with the regular Qwen node?
No. Use QwenVL and connect the image to its optional IMAGE input. The regular Qwen node is for text-only requests.
Do I have to download a model before using a node?
No. The extension downloads a selected model from Hugging Face on first use. The author recommends having models in ComfyUI/models/LLM/ beforehand if you want to avoid waiting during that first run.
Why is a repeat run faster after I pin a model?
Pinning keeps the loaded model available in the cache, so a later run can reuse it rather than loading it again.
Does video_path let QwenVL analyze a video?
No. That input is reserved and is not used by the current implementation.
What does a seed of -1 mean?
It means the node does not set a random seed for the run.
Learn More about ComfyUI_Qwen_chat_models
Start with the basic sample workflow to see how the nodes fit into ComfyUI. When you are comfortable with that flow, explore the advanced cache-management workflow to see how pinning a model changes repeat-run behavior.
For the author’s alternate-language documentation, see the Chinese README.
