Qwen 2.1 Prompt Enhancer Loader
Three dropdowns, and one of them is 19 GB
- QWEN_PE_MODEL
The Loader is the node you'll click past, and it's the one that decides whether the pack works on your machine. Three dropdowns, no generation, no visible output - but it's loading a 9.4 billion parameter vision-language model onto your GPU, whole and in bf16. Get the model pick or the dtype wrong and nothing downstream saves you.
What it actually is
It's the "local LLM as a tool node" pattern, and it fits this job especially well: Qwen-Image's condition encoder is itself a Qwen vision-language model, so having a second LLM write the instruction is a translation between two things that already speak the same language. You prompt that family like an instruction, not a keyword list - (word:1.4) weighting is inert.
The pack ships two nodes. This one loads weights and hands you a QWEN_PE_MODEL handle (a dict of model, processor and device); the Rewrite node does the generating. Queue a graph with only the Loader wired and you get a model on your card and nothing else - expected, not a bug.
The models it can load
Two of the three auto-download entries are Qwen's own prompt-rewriting models: fine-tuned Qwen3.5-VL 9B checkpoints at 9.4B parameters, BF16, about 18.8 GB across four safetensors shards. Qwen-Image-2.1-PE-T2I expands a short text request; Qwen-Image-2.1-PE-I2I rewrites an edit instruction from one or more input images. The third, base11231/Qwen-Image-2.1-PE-I2I-Abliterated, is a community re-tune of the I2I model with the refusal direction removed - same size, and the one you want if the official model's safety training is what's flattening your prompts. Uncensored and offline is the usual reason people run a local enhancer at all.
Worth knowing: the official PE weights are under the Qwen Research licence, not the Apache 2.0 the rest of the family carries.
The inputs, and what they cost you
model_path is the enum, and it has two flavours. (Auto Download) entries pass the HuggingFace repo id straight into transformers, which downloads into your HF cache (~/.cache/huggingface) - not into ComfyUI/models/LLM. So your LLM folder can stay empty and it still works, but budget disk: two of these is ~38 GB. (on disk) entries come from scanning your models/LLM folders for subdirectories containing a config.json, so a half-finished download silently doesn't appear in the list.
dtype defaults to bfloat16 and the author's tooltip says to keep it there - the models ship BF16, and bf16 is ~2 bytes per parameter, so ~19 GB of weights before anything else loads. float16 is about the same size; float32 doubles it to ~38 GB and isn't fitting a consumer card. This is your main lever, because there's no quantisation option in this node at all.
device is cuda or cpu. cuda puts the whole thing on your default GPU with no offload and no unload. cpu runs it out of system RAM - genuinely works, dramatically slower, and the right answer if your card can't hold the model and your diffusion model at once. That's the 2026 budgeting rule: the second model is a second VRAM budget, and this one isn't small.
Install
ComfyUI Manager, search the pack title, or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/kana112233/ComfyUI-kaola-qwen-image2.1-prompt-rewrite.git
cd ComfyUI-kaola-qwen-image2.1-prompt-rewrite
pip install -r requirements.txt
Restart ComfyUI afterwards. Watch what's in that requirements file: it installs transformers from GitHub main, not PyPI, because the qwen3_5 architecture is new enough that released builds didn't know it (the model cards ask for transformers>=5.4.0). That's the one genuinely disruptive step here - it can pull your environment's pinned transformers out from under other custom nodes. Note what you had before, or do it in a venv you can throw away.
Where people get burned
"Model type qwen3_5 not recognised." Your transformers is too old. Same cause as TypeError: from_pretrained() got an unexpected keyword argument 'dtype' - the node calls dtype=, which only newer transformers accepts. Both are fixed by actually running the pip install git+https://github.com/huggingface/transformers.git step rather than trusting your copy.
Nothing in the model_path dropdown but the three downloads. Your models/LLM/<folder> is missing its config.json, or you put the folder somewhere else. The scan looks at whatever folder_paths calls LLM.
Download stalls or fails offline. Auto Download needs HuggingFace reachable. Pull the full repo yourself into ComfyUI/models/LLM/Qwen-Image-2.1-PE-I2I and use the (on disk) entry instead - the README is explicit that this is a directory of files, not a single .safetensors.
Everything feels slow. There's no cross-run cache here. Every queue re-instantiates the model from disk before generating, and the weights stay resident in between - so keep the enhancer in its own small graph.
One last thing, and it's the KB's standing rule for this category rather than a knock on this pack: an LLM node that reaches the network and loads weights for you is exactly the shape that shipped malware in the LLMVISION case. Read before you run.
Wire QWEN_PE_MODEL into the Rewrite node and you're done here.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_path | COMBO | Select model. '(Auto Download)' downloads from HuggingFace. '(on disk)' scans models/LLM directory. | |
| dtype | COMBO | bfloat16 | Model precision. bfloat16 is highly recommended for Qwen. |
| device | COMBO | cuda | Compute device (cuda for GPU, cpu for CPU RAM). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| QWEN_PE_MODEL | QWEN_PE_MODEL | — |