Nodes/ComfyUI-QwenVL/QwenVL (Advanced)
ComfyUI Node

QwenVL (Advanced)

The same vision model with the sampling knobs unlocked

By 1038lab·Created about a year ago·Updated 23 days ago· 824
QwenVL (Advanced)
  • image
  • video
  • RESPONSE
model_nameQwen3-VL-2B-Instruct
quantizationNone (FP16)
attention_modeauto
use_torch_compilefalse
deviceauto
preset_prompt🖼️ Detailed Description
custom_prompt
max_tokens512
temperature0.60
top_p0.90
num_beams1
repetition_penalty1.20
frame_count16
keep_model_loadedtrue
seed1

Same Qwen-VL engine as the standard node, same models, same image-in-text-out job - but with the generation dials exposed. If the plain QwenVL node is giving you captions that are too samey, too rambling, or you're feeding it video and want control over how many frames it looks at, this is the one to reach for. If you just want "describe this image" and don't care about the mechanics, stick with the standard node; the extra parameters here are rope you don't need for basic captioning.

Why the extra knobs matter

A vision-language model generates its answer token by token, and how it picks each token is a sampling choice. The standard node makes that choice for you. The Advanced node hands it over - which matters when you're doing this at scale (say, captioning a training set) and the default output isn't quite the register you want. Want tighter, more deterministic descriptions? Lower the temperature. Want it to stop repeating itself? Nudge the repetition penalty. Want the single most-likely reading instead of a sampled one? Switch to beam search. It's the difference between accepting the model's default voice and directing it.

The inputs that matter

Everything from the standard node carries over - model_name (the full Qwen3-VL / Qwen2.5-VL lineup), quantization, attention_mode, preset_prompt, custom_prompt, max_tokens, keep_model_loaded, seed, plus the image / video inputs and the RESPONSE output. The additions worth knowing:

  • temperature (0.1–1.0, default 0.6) - randomness. Low = focused, repeatable, factual captions. Higher = more varied phrasing. For captioning you usually want it down, around 0.3–0.6, so descriptions stay literal.
  • num_beams (1–8, default 1) - beam search. Anything above 1 makes the model explore several candidate continuations and keep the best overall, which trades speed for a more considered answer - and it disables temperature/top_p sampling while it's on. Leave it at 1 unless you specifically want that.
  • repetition_penalty (0.5–2.0, default 1.2) - discourages the model from looping the same phrase. If your captions keep restating themselves, raise it a touch.
  • frame_count (1–64, default 16) - for the video input, how many frames get sampled and fed to the model. More frames = more temporal detail but more VRAM and time. This is the lever for video summaries.

Two more: device (auto / cpu / mps) lets you pin execution - auto picks your GPU, mps is for Apple Silicon, cpu is the slow last resort. use_torch_compile (off by default) compiles the model for faster repeat inference; it adds a one-time compile cost up front, so it only pays off across many runs.

How to install it

It ships in the same pack as every other QwenVL node. ComfyUI Manager: search ComfyUI-QwenVL and install. Manual:

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

Restart ComfyUI. Models auto-download from HuggingFace to ComfyUI/models/LLM/Qwen-VL/ on first use, so budget for that first slow run.

Common issues

The advanced knobs give you a couple of new ways to shoot yourself in the foot. Beam search plus a big model plus lots of max_tokens multiplies memory and time - if the node crawls or OOMs, drop num_beams back to 1 first. On video, frame_count is a VRAM multiplier: 64 frames of a large model will blow past a consumer card that handles single images fine, so scale it down if things freeze. And the general Qwen-VL rule still holds - a real 4080 Super report had the 4B FP8 model working but anything larger locking up, so if you're stalling, the model is probably too big for your card before any of these settings are the problem. Cold first run erroring on a 401? That's a stale HuggingFace token, not the node - clear it and retry. And if flash_attention_2 throws, fall back to sdpa.

Category🧪AILab/QwenVL

Inputs (17)

NameTypeDefaultDescription
model_nameCOMBOQwen3-VL-2B-InstructPick 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.
preset_promptCOMBO🖼️ Detailed DescriptionBuilt-in instruction describing how Qwen-VL should analyze the media input.
custom_promptSTRINGOptional override—when filled it completely replaces the preset template.
max_tokensINT51264–4096Maximum number of new tokens to decode. Larger values yield longer answers but consume more time and memory.
temperatureFLOAT0.600.1–1Sampling randomness when num_beams == 1. 0.2–0.4 is focused, 0.7+ is creative.
top_pFLOAT0.900–1Nucleus sampling cutoff when num_beams == 1. Lower values keep only top tokens; 0.9–0.95 allows more variety.
num_beamsINT11–8Beam-search width. Values >1 disable temperature/top_p and trade speed for more stable answers.
repetition_penaltyFLOAT1.200.5–2Values >1 (e.g., 1.1–1.3) penalize repeated phrases; 1.0 leaves logits untouched.
frame_countINT161–64Number of frames extracted from video inputs before prompting Qwen-VL. More frames provide context but cost time.
keep_model_loadedBOOLEANtrueKeeps the model resident in VRAM/RAM after the run so the next prompt skips loading.
seedINT11–4294967295Seed controlling sampling and frame picking; reuse it to reproduce results.
imageoptIMAGE
videooptIMAGE

Outputs (1)

NameTypeDescription
RESPONSESTRING