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

QwenVL (Advanced)

A ComfyUI node in QwenVL-Utils with 29 inputs and 1 output.

By AkihaTatsu·Created 6 months ago·Updated 5 months ago· 0
QwenVL (Advanced)
  • image
  • video
  • source_path
  • RESPONSE
model_nameQwen3.5-0.8B
enable_thinkingfalse
quantizationNone (FP16)
attention_modeauto
use_torch_compilefalse
deviceauto
preset_prompt🖼️ Detailed Description
custom_prompt
max_tokens512
temperature0.6
top_p0.90
num_beams1
repetition_penalty1.2
frame_count16
keep_model_loadedfalse
seed1
min_pixels200704
max_pixels1003520
ctx8192
n_batch512
gpu_layers-1
image_max_tokens4096
top_k0
min_p0.00
top_k_sampling0
pool_size4194304
CategoryQwenVL-Utils

Inputs (29)

NameTypeDefaultDescription
model_nameCOMBOQwen3.5-0.8BSelect the vision-language model. HuggingFace models offer full-precision inference; [GGUF] models use quantized llama.cpp backend for lower VRAM. First run downloads weights automatically.
enable_thinkingBOOLEANfalse[Qwen3.5+ models only] Enable Thinking mode for Qwen3.5 unified models. When ON (Thinking mode), the model reasons step-by-step inside <think>…</think> blocks before producing the final answer — best for complex reasoning, math, and coding tasks. When OFF (Instruct mode), the model responds directly without internal reasoning — faster and more concise for straightforward queries. Only affects Qwen3.5 models; ignored for other model families.
quantizationCOMBONone (FP16)[HF models only] Precision vs VRAM trade-off. FP16 gives the best quality; 8-bit suits 8-16 GB GPUs; 4-bit fits 6 GB or lower but is slower.
attention_modeCOMBOauto[HF models only] Attention backend selection. • auto: Auto-select best available (recommended) • flash_attention_2: External flash-attn package (best performance, needs separate installation) • sdpa_flash: PyTorch SDPA Flash backend (excellent performance, best compatibility) • sage_attention: SageAttention wrapper (experimental, memory efficient) • sdpa_math: PyTorch SDPA math backend (stable fallback) • eager: Standard PyTorch attention (slowest, always works) • sdpa: Legacy option, auto-selects Flash or math
use_torch_compileBOOLEANfalse[HF models only] Enable torch.compile() optimization. Provides ~20-30% speedup after first compilation pass. Requires CUDA and PyTorch 2.1+.
deviceCOMBOautoTarget device for inference. 'auto' selects the best available device. Use 'cpu' for CPU-only, 'cuda:0'/'cuda:1' for specific GPUs.
preset_promptCOMBO🖼️ Detailed DescriptionBuilt-in instruction template describing how the model should analyze the media. Selecting '❌ None' sends no system instruction (use custom_prompt instead).
custom_promptSTRINGWhen filled, completely replaces the preset prompt template. Leave empty to use the selected preset_prompt.
max_tokensINT51264–256000Maximum number of new tokens the model may generate. Larger values produce longer answers but take more time and memory. Both HF and GGUF backends respect this limit.
temperatureFLOAT0.60–2Controls sampling randomness. Lower values (0.1-0.3) produce focused, deterministic outputs; higher values (0.7+) produce more creative, varied outputs. Values below 0.01 trigger greedy decoding (no randomness). Used by both HF (when num_beams=1) and GGUF backends.
top_pFLOAT0.900–1Nucleus sampling: only tokens whose cumulative probability exceeds this threshold are considered. Lower values (0.5) restrict to high-confidence tokens; higher values (0.9-0.95) allow more variety. Used by both HF (when num_beams=1) and GGUF backends.
num_beamsINT11–8[HF models only] Beam search width. Values >1 disable temperature/top_p sampling and use beam search instead, which produces more stable but less creative outputs.
repetition_penaltyFLOAT1.20.5–2Penalizes repeated tokens. Values >1.0 (e.g. 1.1-1.3) reduce repetition; 1.0 applies no penalty. Used by both HF and GGUF backends.
frame_countINT161–64Number of frames uniformly sampled from video inputs. More frames provide richer temporal context but increase processing time and memory usage.
keep_model_loadedBOOLEANfalseKeep the model loaded in VRAM/RAM after inference so subsequent runs skip the loading step. Disable to free memory after each run.
seedINT11–4294967295Random seed for sampling reproducibility and video frame selection. Reuse the same seed to reproduce identical results.
imageoptIMAGE
videooptIMAGE
source_pathoptPATH
min_pixelsoptINT2007043136–12845056[HF models only] Minimum pixel count for image preprocessing. Controls the lower bound of image resolution. Default: 256×28×28 = 200,704.
max_pixelsoptINT10035203136–12845056[HF models only] Maximum pixel count for image preprocessing. Controls the upper bound of image resolution. Higher values give better detail but use more memory. Default: 1280×28×28 = 1,003,520.
ctxoptINT81921024–262144[GGUF models only] Context window size in tokens. Determines total prompt + response capacity. Higher values allow longer conversations but use more memory. Default: 8192.
n_batchoptINT51264–32768[GGUF models only] Prompt processing batch size. Higher values can improve prompt ingestion throughput at the cost of memory. Default: 512.
gpu_layersoptINT-1-1–200[GGUF models only] Number of model layers offloaded to GPU. -1 offloads all layers (recommended for VRAM-sufficient GPUs). 0 runs entirely on CPU.
image_max_tokensoptINT4096256–1024000[GGUF models only] Maximum tokens allocated for image encoding. Higher values preserve more image detail but consume more context window. Default: 4096.
top_koptINT00–32768[GGUF models only] Top-K parameter for llama.cpp model constructor. Controls constructor-level top-K setting passed to Llama(). 0 = disabled. See also top_k_sampling for generation-time top-K.
min_poptFLOAT0.000–1[GGUF models only] Minimum probability sampling threshold. Filters out tokens with probability below min_p × max_token_probability. Default 0.0 (disabled) matches HF behavior. Higher values (e.g. 0.05) aggressively narrow candidates, which may reduce output length.
top_k_samplingoptINT00–1000[GGUF models only] Top-K sampling during generation. Restricts each token choice to the K most probable candidates. Default 0 (disabled) matches HF behavior. Non-zero values (e.g. 40) reduce variety and may shorten output.
pool_sizeoptINT41943041048576–10485760[GGUF models only] Memory pool size for GGUF vision processing. Controls internal buffer allocation. Default: 4,194,304 (4 MB).

Outputs (1)

NameTypeDescription
RESPONSESTRING