Nodes/QwenVL-Mod: Enhanced Vision-Language/๐Ÿง  QwenVL Unified Advanced (HF / GGUF)
ComfyUI Node

๐Ÿง  QwenVL Unified Advanced (HF / GGUF)

Every knob the simple node hides, plus two you should leave alone

By huchukatoยทCreated 8 months agoยทUpdated about 5 hours agoยท 110
๐Ÿง  QwenVL Unified Advanced (HF / GGUF)
  • image
  • image2
  • video
  • RESPONSE
โ—„backendGGUF llama.cppโ–บ
โ—„model_nameHF: Qwen3.5-27B-ultra-uncensored-hereticโ–บ
โ—„preset_prompt๐Ÿ–ผ๏ธ Detailed Descriptionโ–บ
โ—„camera_tagNoneโ–บ
โ—„custom_promptโ–บ
โ—„deviceautoโ–บ
โ—„max_tokens8192โ–บ
โ—„temperature0.60โ–บ
โ—„top_p0.90โ–บ
โ—„repetition_penalty1.00โ–บ
โ—„keep_model_loadedtrueโ–บ
โ—„seed1โ–บ
โ—„keep_last_promptfalseโ–บ
โ—„passthroughfalseโ–บ
โ—„quantizationNone (FP16)โ–บ
โ—„attention_modeautoโ–บ
โ—„use_torch_compilefalseโ–บ
โ—„num_beams1โ–บ
โ—„frame_count16โ–บ
โ—„ctx32768โ–บ
โ—„n_batch512โ–บ
โ—„gpu_layers-1โ–บ
โ—„image_max_tokens4096โ–บ
โ—„top_k20โ–บ
โ—„pool_size4194304โ–บ

Same node, unscrewed

QwenVL_Unified_Advanced is the same unified HF/GGUF vision-language node as its sibling, with the panel opened up. The simple version hardcodes its sampling - temperature 0.6, top_p 0.9, no beam search, full GPU offload, 32K context, FP16 on the HF path. The Advanced version exposes all of that. Same dropdowns, same preset system, same RESPONSE output.

Reach for it when the simple node is nearly right: you want beam search because the node keeps writing something florid, or you need it to actually run on CPU, or you're on a 6 GB card and 4-bit isn't negotiable.

The knobs that matter

device - auto, cpu, mps, plus a cuda:N entry for every GPU ComfyUI can see. auto is right unless you're running a second card or deliberately offloading the VLM so it doesn't fight your diffusion model for VRAM. Note that CPU works but "works" is doing heavy lifting: a 9B VLM on CPU is a coffee break per prompt.

quantization - 4-bit (VRAM-friendly), 8-bit (Balanced), None (FP16), defaulting to FP16. This is the HF path only. The pack removed on-the-fly quantization from regular use after it caused OOM crashes on a 5090, and the house rule since is: HF nodes for quality, GGUF nodes for anything quantized. If you're at 8โ€“16 GB and want quants, stop fighting this widget and pick a GGUF: model instead.

attention_mode - auto, sage, flash_attention_2, sdpa. auto walks Sage โ†’ FlashAttention 2 โ†’ SDPA in that order. On paper Sage is fastest; in practice this pack has added, removed and re-added SageAttention support across several versions, and the tooltip itself says SDPA is stable and recommended. If output gets weird or a run dies in the attention layer, force sdpa and re-test. It costs you some speed and buys back predictability.

ctx - context window, default 32768, up to 262144. GGUF path only. Video presets with long templates plus sampled frames are what eat this; if the model starts truncating or writing incoherent endings, raise it and watch your VRAM.

gpu_layers - -1 offloads everything to the GPU. Lower it when a GGUF model and a diffusion model can't share the card; layers that don't fit go to system RAM and it gets slower but it stops exploding.

image_max_tokens (4096) is the vision-side budget - how many tokens the image itself is allowed to consume - and frame_count (16, up to 64) is how many frames get sampled from the video input. Crank frame_count and you pay in context.

The sampling group (temperature, top_p, repetition_penalty, num_beams) behaves like every other text model: num_beams above 1 disables temperature and top_p and trades speed for steadiness. repetition_penalty defaults to 1 here, i.e. off. use_torch_compile needs a CUDA/torch build that supports it and a warm-up run before it pays off.

The structural gotcha

Every knob is listed whether or not your chosen backend uses it. Look at the label groupings in the source: quantization, attention_mode, use_torch_compile and num_beams are "HF-specific"; ctx, n_batch, gpu_layers, image_max_tokens, top_k and pool_size are "GGUF-specific." The model_name prefix picks the route, and the other side's settings are silently ignored. Set ctx to 131072, run an HF: model, and nothing happens - no warning, no error, just a setting that does nothing. Align backend and the prefix, then only tune the group that applies.

Inputs and outputs

Required: backend, model_name, preset_prompt (27 presets, ๐Ÿ–ผ๏ธ Detailed Description by default), camera_tag, custom_prompt, device, max_tokens, the sampling floats, keep_model_loaded, seed, keep_last_prompt, passthrough, then the backend groups above. Optional: image, image2 (picture 1 and picture 2 for the R2VA presets), and video.

Output is a single RESPONSE string - same as the simple node, so you can swap between them without rewiring.

Install

Same pack, no special steps:

cd ComfyUI/custom_nodes
git clone https://github.com/huchukato/ComfyUI-QwenVL-Mod
cd ComfyUI-QwenVL-Mod && pip install -r requirements.txt

Manager route: search QwenVL-Mod: Enhanced Vision-Language. Restart afterwards. GGUF models need llama-cpp-python with vision support (Qwen3VLChatHandler), which is a separate build you have to install yourself and the most common reason the GGUF half of this node looks broken on a fresh setup.

Troubleshooting

If the node's answers degrade into raw tokens or system text, walk back the exotic settings first - attention_mode to sdpa, use_torch_compile off, num_beams back to 1 - then check your transformers version, which is where this node family's garbled-output reports usually end. If an HF: model is fine on one ComfyUI install and crawling on another after a torch/CUDA upgrade, it's probably not on the GPU at all; verify before tuning.

And keep one expectation straight: this node doesn't generate anything. It writes text upstream of your sampler, and the thing that decides whether your image is good is still the model you're prompting.

CategoryQwenVL-Mod

Inputs (28)

NameTypeDefaultDescription
backendCOMBOGGUF llama.cpp2 options: HF Transformers, GGUF llama.cpp
model_nameCOMBOHF: Qwen3.5-27B-ultra-uncensored-hereticHF models are prefixed with 'HF: ', GGUF models with 'GGUF: '.
preset_promptCOMBO๐Ÿ–ผ๏ธ Detailed DescriptionBuilt-in instruction describing how Qwen-VL should analyze the media input.
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.
custom_promptSTRINGAdditional user input that gets combined with the preset template. Leave empty to use only the template.
deviceCOMBOautoChoose where to run the model: auto, cpu, mps, or cuda:x for multi-GPU systems.
max_tokensINT819264โ€“8192Maximum number of new tokens to decode. Larger values yield longer answers but consume more time and memory.
temperatureFLOAT0.600โ€“2โ€”
top_pFLOAT0.900โ€“1โ€”
repetition_penaltyFLOAT1.000.5โ€“2โ€”
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.
keep_last_promptBOOLEANfalseKeep the last generated prompt instead of creating a new one
passthroughBOOLEANfalseSkip Qwen model loading and return custom_prompt directly.
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 SageAttention โ†’ FlashAttention 2 โ†’ SDPA in order. SDPA is stable and recommended. 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.
num_beamsINT11โ€“8Beam-search width. Values >1 disable temperature/top_p and trade speed for more stable answers.
frame_countINT161โ€“64Number of frames to sample from the video input. Only applies to the video input, NOT to image/image2.
ctxINT327681024โ€“262144โ€”
n_batchINT51264โ€“32768โ€”
gpu_layersINT-1-1โ€“200โ€”
image_max_tokensINT4096256โ€“1024000โ€”
top_kINT200โ€“32768โ€”
pool_sizeINT41943041048576โ€“10485760โ€”
imageoptIMAGEFirst reference image (single image). For R2VA this is Picture 1.
image2optIMAGESecond reference image (single image). For R2VA this is Picture 2.
videooptIMAGEVideo frames input. Use frame_count to control how many frames are sampled.

Outputs (1)

NameTypeDescription
RESPONSESTRINGโ€”