Nodes/ComfyUI-QwenVL/QwenVL Prompt Enhancer
ComfyUI Node

QwenVL Prompt Enhancer

Turn a lazy prompt into a rich one with a local Qwen3 LLM

By 1038lab·Created about a year ago·Updated 27 days ago· 827
QwenVL Prompt Enhancer
    • ENHANCED_OUTPUT
    model_nameQwen3-0.6B
    quantizationNone (FP16)
    attention_modeauto
    use_torch_compilefalse
    deviceauto
    prompt_text
    enhancement_style📝 Enhance
    custom_system_prompt
    max_tokens256
    temperature0.70
    top_p0.90
    repetition_penalty1.10
    keep_model_loadedtrue
    seed1

    You type "a cat on a beach," and this node hands back a paragraph with lighting, composition, camera, and mood spelled out - the kind of dense prompt modern models actually respond to. It's a text-only node: no image input, no vision. Just a local Qwen3 language model rewriting your prompt into something richer before it hits your sampler. Despite living in a "QwenVL" pack, this one never looks at a picture.

    Here's the detail that makes it click: the LLMs doing the enhancing are the same family that encodes prompts for today's models. Z-Image runs on a Qwen3-4B text encoder. Flux 2 Klein uses Qwen3. Anima uses Qwen3-0.6B. So when this node expands your prompt with a Qwen3 model, you're essentially pre-writing in the encoder's native dialect. That's a nicer story than piping your prompt through some unrelated chatbot API - it's local, keyless, and shaped by the same model lineage that's going to read the result.

    How it works

    It's a plain instruction-following LLM with a system prompt bolted on. You give it your rough prompt and pick a style - the style selects a hidden system instruction ("expand this," "make it cinematic," "add technical camera specs") and the model rewrites accordingly. No magic, just a well-prompted small language model running on your GPU instead of behind a paywall.

    The inputs that matter

    • prompt_text - your input prompt, the thing to be enhanced. Multiline.
    • enhancement_style - six presets: Enhance, Refine, Creative Rewrite, Detailed Visual, Artistic Style, Technical Specs. "Enhance" is the sensible default (flesh it out); "Refine" is lighter-touch; "Creative Rewrite" takes the most liberty. Match the style to how far you want it to stray from your original.
    • model_name - 21 options. The pure text models are the ones to start with: Qwen3-0.6B (tiny and fast, fine for basic expansion), Qwen3-4B-Instruct-2507 (the stronger general pick), and qwen3-4b-Z-Image-Engineer, a community fine-tune aimed specifically at writing Z-Image prompts. The Qwen-VL models are also listed and run here in text-only mode.

    If the presets don't fit, custom_system_prompt lets you write your own instruction and take full control of the rewrite. The sampling trio - temperature (default 0.7), top_p, repetition_penalty - controls how wild the rewrite gets; turn temperature down if it's inventing details you don't want. The single output is ENHANCED_OUTPUT (a STRING); wire it straight into your CLIP/text encoder in place of the raw prompt. keep_model_loaded and seed behave as everywhere else in the pack.

    How to install it

    Same pack as the rest. ComfyUI Manager: search ComfyUI-QwenVL, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/1038lab/ComfyUI-QwenVL.git
    cd ComfyUI-QwenVL
    pip install -r requirements.txt
    

    Restart ComfyUI. The text models download from HuggingFace on first use - Qwen3-0.6B is small, but the 4B models are a few GB, so the first run pauses to fetch them.

    Common issues

    The honest caveat: this is an LLM, so it will confidently invent. Ask for "more detail" and it may add a red scarf, golden-hour light, and a Leica that were never in your idea - great when you want inspiration, annoying when you had a specific image in mind. Lower the temperature and lean on "Refine" over "Creative Rewrite" if it's drifting, and always read the output before trusting it. Longer isn't automatically better; a bloated prompt can dilute the tokens that mattered. Beyond that, the usual pack notes apply: a 401 on first download is a stale HuggingFace token (clear it, these are public models), and if you're short on VRAM, the 0.6B model runs almost anywhere while the 4B and larger picks need real headroom.

    Category🧪AILab/QwenVL

    Inputs (14)

    NameTypeDefaultDescription
    model_nameCOMBOQwen3-0.6BPick the Qwen-VL checkpoint. First run downloads weights into models/LLM/Qwen-VL, so leave disk space.
    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.
    attention_modeCOMBOautoauto tries flash-attn v2 when installed and falls back to SDPA. Only override when debugging attention backends.
    use_torch_compileBOOLEANfalseEnable torch.compile('reduce-overhead') on supported CUDA/Torch 2.1+ builds for extra throughput after the first compile.
    deviceCOMBOautoChoose where to run the model: auto, cpu, mps, or cuda:x for multi-GPU systems.
    prompt_textSTRINGPrompt text to enhance. Leave blank to just emit the preset instruction.
    enhancement_styleCOMBO📝 Enhance6 options: 📝 Enhance, 📝 Refine, 📝 Creative Rewrite, 📝 Detailed Visual, 📝 Artistic Style, 📝 Technical Specs
    custom_system_promptSTRING
    max_tokensINT25632–1024
    temperatureFLOAT0.700.1–1
    top_pFLOAT0.900–1
    repetition_penaltyFLOAT1.100.5–2
    keep_model_loadedBOOLEANtrue
    seedINT11–4294967295

    Outputs (1)

    NameTypeDescription
    ENHANCED_OUTPUTSTRING