Nodes/QwenVL-Mod: Enhanced Vision-Language/โœ๐Ÿป QwenVL Unified Prompt Enhancer (HF / GGUF)
ComfyUI Node

โœ๐Ÿป QwenVL Unified Prompt Enhancer (HF / GGUF)

QwenVL's Local Enhancer Turns Your Half-Idea Into Prose

By huchukatoยทCreated 9 months agoยทUpdated about 14 hours agoยท 126
โœ๐Ÿป QwenVL Unified Prompt Enhancer (HF / GGUF)
    • ENHANCED_OUTPUT
    โ—„model_nameHF: Qwen3.5-9B-Defiant-Fable-Hereticโ–บ
    โ—„prompt_textโ–บ
    โ—„enhancement_styleEnhanceโ–บ
    โ—„camera_tagNoneโ–บ
    โ—„style_tagNoneโ–บ
    โ—„max_tokens8192โ–บ
    โ—„temperature0.70โ–บ
    โ—„top_p0.90โ–บ
    โ—„repetition_penalty1.10โ–บ
    โ—„english_outputfalseโ–บ
    โ—„deviceautoโ–บ
    โ—„quantizationNone (FP16)โ–บ
    โ—„attention_modeautoโ–บ
    โ—„use_torch_compilefalseโ–บ
    โ—„keep_model_loadedfalseโ–บ
    โ—„seed1โ–บ
    โ—„keep_last_promptfalseโ–บ
    โ—„passthroughfalseโ–บ
    โ—„duration5sโ–บ

    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.

    Category๐Ÿ”ฎ QwenVL-Mod

    Inputs (19)

    NameTypeDefaultDescription
    model_nameCOMBOHF: Qwen3.5-9B-Defiant-Fable-HereticHF models are prefixed with 'HF: ', GGUF models with 'GGUF: '. The prefix selects the backend. (GGUF models hidden โ€” llama-cpp-python not installed)
    prompt_textSTRINGPrompt text to enhance. Leave blank to just emit the preset instruction.
    enhancement_styleCOMBOEnhance18 options: MiniMax โ€บ NSFW T2V, MiniMax โ€บ NSFW R2VA T2V, MiniMax โ€บ NSFW FL2VA T2V, Wan22 โ€บ NSFW T2V, Wan22 โ€บ NSFW T2V Long, LTX โ€บ NSFW T2V, +12
    camera_tagCOMBONoneCamera 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_tagCOMBONoneVisual 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_tokensINT819232โ€“16384โ€”
    temperatureFLOAT0.700.1โ€“1โ€”
    top_pFLOAT0.900โ€“1โ€”
    repetition_penaltyFLOAT1.100.5โ€“2โ€”
    english_outputBOOLEANfalseForce final output in English using translation prompt (GGUF backend only).
    deviceCOMBOautoChoose where to run the model: auto, cpu, mps, or cuda:x for multi-GPU systems.
    quantizationCOMBONone (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_modeCOMBOautoauto tries FlashAttention 2 โ†’ SDPA in order. SDPA is stable and recommended. Only override when debugging attention backends. (HF backend only)
    use_torch_compileBOOLEANfalseEnable torch.compile('reduce-overhead') on supported CUDA/Torch 2.1+ builds for extra throughput after the first compile. (HF backend only)
    keep_model_loadedBOOLEANfalseKeep model loaded in memory for faster repeated inference (uses more VRAM).
    seedINT11โ€“4294967295โ€”
    keep_last_promptBOOLEANfalseKeep the last generated prompt instead of creating a new one
    passthroughBOOLEANfalseSkip Qwen model loading and return prompt_text directly. Use when the chat already generated the final prompt โ€” saves VRAM and inference time.
    durationCOMBO5sClip length for duration-aware styles (MiniMax/LTX/Wan). Ignored by generic styles.

    Outputs (1)

    NameTypeDescription
    ENHANCED_OUTPUTSTRINGโ€”