ComfyUI Node
Qwen LM
Runs a Qwen chat model (Qwen3.5-4B / 9B, Qwen3.8-27B, Qwen3-VL-8B Instruct, and abliterated builds of Qwen3.5-9B and Qwen3-VL-8B) through ComfyUI core: system, user and an optional assistant prefill go in as the official chat template renders them, with images from the image input. text is the answer (prefill included), thinking the reasoning when thinking is on. Sampling is the model's official defaults unless an LM Config node changes fields. The model file is found in models/Qwen-LM or models/text_encoders, or downloaded on first use; one LoRA from models/Qwen-LM/loras can be applied.
Qwen LM
- image
- config
- text
- thinking
◄modelQwen3.5-9B►
◄precisionINT8 ConvRot►
◄loraNone►
◄lora_strength1.00►
◄thinkingfalse►
◄max_new_tokens32768►
◄seed0►
◄keep_model_loadedtrue►
◄system►
◄user►
◄assistant►
CategoryBCNodes/lm
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | Qwen3.5-9B | The chat model (the built-in ones all see images): the built-in list plus the models.yaml in models/Qwen-LM. The file is looked for by name in models/Qwen-LM (subfolders too), then anywhere under models/text_encoders, and downloaded into models/Qwen-LM when missing. |
| precision | COMBO | INT8 ConvRot | The model file's weights: BF16 (full), INT8 ConvRot (8-bit, about half the size), W4A8 (4-bit, Qwen3.8-27B only). Only the selected model's precisions are shown; another one is an error. |
| lora | COMBO | None | A LoRA from models/Qwen-LM/loras: a .safetensors file (PEFT or ComfyUI key names) or a PEFT folder (adapter_config.json + adapter_model.safetensors). Its alpha is read from the file, its metadata or its config file (a file in ComfyUI's names without one: alpha = rank, core's convention); a LoRA trained on another base model is refused. |
| lora_strength | FLOAT | 1.00-100–100 | How strongly the LoRA changes the model: strength x alpha / rank x B @ A, core's LoRA math. 0 runs the model without it. |
| thinking | BOOLEAN | false | The model reasons before it answers: the reasoning comes out on thinking, the answer on text, and sampling takes the model's thinking-on defaults. Only on models with a thinking mode (not Qwen3-VL), and not with an assistant prefill. Qwen3.8-27B thinks at its official default effort, xhigh. |
| max_new_tokens | INT | 327681–262144 | The most tokens the model writes (reasoning and answer); it stops earlier at its end token. 32768 is the official length for most queries. Core reserves the KV cache for prompt + max_new_tokens before the first token: at 32768, about 1 GiB of VRAM for Qwen3.5-4B / 9B, 2 GiB for Qwen3.8-27B and 4.5 GiB for Qwen3-VL-8B (bf16), in proportion to the value. |
| seed | INT | 00–18446744073709550000 | The sampling seed, used when do_sample is on (the model defaults have it on). Its control starts at fixed, so queueing again gives the cached answer instead of a new run; set it to randomize for a new answer each time. |
| keep_model_loaded | BOOLEAN | true | On: the model (with its LoRA) stays loaded for the next run; one model file is held at a time, another one replaces it. Off: it is unloaded when the run ends, after an error too, except an unusable models.yaml or an unknown model name (raised before the model is known). |
| system | STRING | The system message. Empty: no system turn (Qwen3.8-27B with thinking on still has one, holding its reasoning-effort line). Qwen3.5 / 3.8 strip the whitespace around it, Qwen3-VL takes it as written. | |
| user | STRING | The user message, the prompt. Empty only when an image is connected; the images come before this text. | |
| assistant | STRING | Prefill: the answer starts with this text, and text includes it (a prefill of { gives complete JSON). Empty: none. Not with thinking on. | |
| imageopt | IMAGE | Images the model sees, one per frame of the batch, before the user text. Each is resized as the official Qwen processor does (sides multiples of 32, 65536 to 16777216 pixels, bicubic); core caps an image at 12845056 pixels. MTP does not run with images. | |
| configopt | BC_LM_CONFIG | Sampling from an LM Config node: the fields edited there, or fed by a link, replace the model's defaults for the mode (thinking on / off); the others keep them. Not connected: the model's official defaults. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| thinking | STRING | — |