โ๐ป QwenVL Unified Prompt Enhancer (HF / GGUF)
QwenVL's Local Enhancer Turns Your Half-Idea Into Prose
- ENHANCED_OUTPUT
What it is, and why you'd bother
You type "girl in a cafe, rainy, cinematic" into the prompt box. A model built on a language-model encoder - Qwen-Image, Krea, Z-Image, anything Flux-shaped - would much rather have three sentences of actual description. That's the gap this node fills: a small local LLM sits in your graph, reads your rough text, hands back a finished prompt paragraph. No API key, no per-call cost, and no filter deciding your scene is against the rules - which is the whole reason to run this locally instead of asking ChatGPT.
Worth knowing: this is huchukato's fork of 1038lab's original ComfyUI-QwenVL, with video presets (MiniMax H3, WAN 2.2, LTX 2.3), unified HF/GGUF nodes and a chat sidebar bolted on. It also leans hard into the NSFW corner of the hobby - if you're prompting anything explicit, this is the version that won't sulk at you.
How it works
The node is text-only - no image input, unlike its QwenVL vision siblings. It does template assembly, then generation, then cleanup.
Your enhancement_style picks an instruction out of the pack's presets/*.json, concatenated after your prompt_text and fed as one user turn, so your text comes first and the style shapes it. Leave prompt_text blank and you get the instruction alone.
Two details matter more than they look. Set camera_tag or style_tag and the tag is injected as a [TAG] at the top and restated at the bottom inside a "FINAL STYLE DIRECTIVE (HIGHEST PRIORITY)" block - recency bias, because a model mid-paragraph otherwise forgets the camera move you asked for. Second, the output runs through a cleaner. Qwen3.x chat models leak thinking blocks and planning tics; the code spots output that looks like planning ("Okay,", "First,", "I shouldโฆ") and either strips everything before </think> or fires one constrained retry at temperature 0.4 asking for the bare paragraph. That's the difference between an enhancer and a node that hands your sampler the model's scratch work.
The inputs that actually matter
model_name - that HF: / GGUF: prefix is the real backend switch: HF runs through Transformers, GGUF through llama-cpp-python. All three shipped choices are DavidAU "Heretic" finetunes (HF: Qwen3.5-9B-Defiant-Fable-Heretic, HF: Qwen3.5-4B-Deckard-Heretic-Thinking, HF: Qwen3.6-27B-Fable-Fusion-711-Heretic). Abliterated, none vanilla Qwen Instruct. Drop a Hugging Face model folder into ComfyUI/models/LLM/Qwen-VL/ and it appears in the list automatically.
prompt_text - your mess, multiline. It also expands __wildcard__ tokens, so randomiser setups keep working.
enhancement_style - 18 entries. The generic six (Enhance, Refine, Creative Rewrite, Detailed Visual, Artistic Style, Technical Specs) each produce a 130โ300 word photography-style paragraph. PonyโNatural converts booru tag soup into clean prose - the one you want when migrating off Pony/Illustrious. The MiniMax, Wan22 and LTX styles are video-prompt specialists, and there duration (5s/10s/15s/20s) picks a clip-length variant. Generic styles ignore duration.
The memory defaults deserve a warning. keep_model_loaded is False, so the model unloads after every run and reloads next time - on while iterating, off when queuing a long video pipeline. quantization defaults to None (FP16), an ~18GB ask for the 9B default; on 16GB set 8-bit (Balanced), on 8GB 4-bit (VRAM-friendly).
Two flags are quietly excellent. passthrough skips loading and returns prompt_text verbatim - perfect when the chat sidebar already wrote the final prompt. keep_last_prompt returns the previous output instead of generating; it's module-level, so it's empty after a restart until you generate once.
Output is one thing: ENHANCED_OUTPUT, a STRING. Wire it into a CLIPTextEncode positive, another text-encode node, or the prompt input of your video sampler.
Install
ComfyUI Manager โ search "QwenVL-Mod", or:
cd ComfyUI/custom_nodes
git clone https://github.com/huchukato/ComfyUI-QwenVL-Mod
cd ComfyUI-QwenVL-Mod
pip install -r requirements.txt
Restart. The load-bearing pin is transformers>=5.2.0 (Qwen3.5's hybrid attention needs it), alongside torch, bitsandbytes, accelerate and opencv. First run downloads weights into models/LLM/Qwen-VL/, which for 9B FP16 is not small.
GGUF is deliberately not installed by requirements.txt - the line is commented out, because a failed source build would break the whole Manager install. Want GGUF? Install a vision-capable llama-cpp-python wheel yourself first.
Where people get burned
No GGUF: entries in the dropdown. Not a bug: the tooltip reads "(GGUF models hidden - llama-cpp-python not installed)". Force a stale GGUF: value and you get an ImportError saying the same.
OOM on first run. Nine billion parameters at the default FP16. Drop to 8-bit before blaming the node.
The abliterated models write weird. That's the tradeoff this whole corner runs on - the community read on Qwen-VL was blunt: "It's too censored, but abliterated versions seem sort of brain damaged." Heretic finetunes are dramatic and compliant, and they'll invent narrative you never asked for. Tighten the style, lower temperature, or drop to the 4B when the 9B goes off on one.
Nothing comes out. Check passthrough is off, max_tokens isn't tiny, and - if keep_last_prompt is on - that you've generated once since the last restart. Then read the console; it logs loading, prompt saves and failures. A local enhancer cures the blank page, not bad taste: if the output's wrong, narrow the style rather than upsizing the model.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | HF: Qwen3.5-9B-Defiant-Fable-Heretic | HF models are prefixed with 'HF: ', GGUF models with 'GGUF: '. The prefix selects the backend. (GGUF models hidden โ llama-cpp-python not installed) |
| prompt_text | STRING | Prompt text to enhance. Leave blank to just emit the preset instruction. | |
| enhancement_style | COMBO | Enhance | 18 options: MiniMax โบ NSFW T2V, MiniMax โบ NSFW R2VA T2V, MiniMax โบ NSFW FL2VA T2V, Wan22 โบ NSFW T2V, Wan22 โบ NSFW T2V Long, LTX โบ NSFW T2V, +12 |
| camera_tag | COMBO | None | Camera movement override for video presets (MiniMax H3, WAN, etc). 'None' lets the preset decide. Any other value is injected as a [TAG] and reinforced at the end of the prompt so Qwen respects it. |
| style_tag | COMBO | None | Visual style override for video presets (MiniMax H3, LTX 2.3, WAN, etc). 'None' lets the preset decide. Any other value is injected as a [TAG] and reinforced at the end of the prompt so Qwen respects it. For image-reference modes, identity and composition remain anchored to the references. |
| max_tokens | INT | 819232โ16384 | โ |
| temperature | FLOAT | 0.700.1โ1 | โ |
| top_p | FLOAT | 0.900โ1 | โ |
| repetition_penalty | FLOAT | 1.100.5โ2 | โ |
| english_output | BOOLEAN | false | Force final output in English using translation prompt (GGUF backend only). |
| device | COMBO | auto | Choose where to run the model: auto, cpu, mps, or cuda:x for multi-GPU systems. |
| quantization | COMBO | None (FP16) | Precision vs VRAM. FP16 gives the best quality if memory allows; 8-bit suits 8โ16 GB GPUs; 4-bit fits 6 GB or lower but is slower. (HF backend only) |
| attention_mode | COMBO | auto | auto tries FlashAttention 2 โ SDPA in order. SDPA is stable and recommended. Only override when debugging attention backends. (HF backend only) |
| use_torch_compile | BOOLEAN | false | Enable torch.compile('reduce-overhead') on supported CUDA/Torch 2.1+ builds for extra throughput after the first compile. (HF backend only) |
| keep_model_loaded | BOOLEAN | false | Keep model loaded in memory for faster repeated inference (uses more VRAM). |
| seed | INT | 11โ4294967295 | โ |
| keep_last_prompt | BOOLEAN | false | Keep the last generated prompt instead of creating a new one |
| passthrough | BOOLEAN | false | Skip Qwen model loading and return prompt_text directly. Use when the chat already generated the final prompt โ saves VRAM and inference time. |
| duration | COMBO | 5s | Clip length for duration-aware styles (MiniMax/LTX/Wan). Ignored by generic styles. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ENHANCED_OUTPUT | STRING | โ |