ComfyUI Node
QwenVL (Advanced)
A ComfyUI node in QwenVL-Utils with 29 inputs and 1 output.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | Qwen3.5-0.8B | Select 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_thinking | BOOLEAN | false | [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. |
| quantization | COMBO | None (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_mode | COMBO | auto | [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_compile | BOOLEAN | false | [HF models only] Enable torch.compile() optimization. Provides ~20-30% speedup after first compilation pass. Requires CUDA and PyTorch 2.1+. |
| device | COMBO | auto | Target device for inference. 'auto' selects the best available device. Use 'cpu' for CPU-only, 'cuda:0'/'cuda:1' for specific GPUs. |
| preset_prompt | COMBO | 🖼️ Detailed Description | Built-in instruction template describing how the model should analyze the media. Selecting '❌ None' sends no system instruction (use custom_prompt instead). |
| custom_prompt | STRING | When filled, completely replaces the preset prompt template. Leave empty to use the selected preset_prompt. | |
| max_tokens | INT | 51264–256000 | Maximum 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. |
| temperature | FLOAT | 0.60–2 | Controls 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_p | FLOAT | 0.900–1 | Nucleus 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_beams | INT | 11–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_penalty | FLOAT | 1.20.5–2 | Penalizes 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_count | INT | 161–64 | Number of frames uniformly sampled from video inputs. More frames provide richer temporal context but increase processing time and memory usage. |
| keep_model_loaded | BOOLEAN | false | Keep the model loaded in VRAM/RAM after inference so subsequent runs skip the loading step. Disable to free memory after each run. |
| seed | INT | 11–4294967295 | Random seed for sampling reproducibility and video frame selection. Reuse the same seed to reproduce identical results. |
| imageopt | IMAGE | — | |
| videoopt | IMAGE | — | |
| source_pathopt | PATH | — | |
| min_pixelsopt | INT | 2007043136–12845056 | [HF models only] Minimum pixel count for image preprocessing. Controls the lower bound of image resolution. Default: 256×28×28 = 200,704. |
| max_pixelsopt | INT | 10035203136–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. |
| ctxopt | INT | 81921024–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_batchopt | INT | 51264–32768 | [GGUF models only] Prompt processing batch size. Higher values can improve prompt ingestion throughput at the cost of memory. Default: 512. |
| gpu_layersopt | INT | -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_tokensopt | INT | 4096256–1024000 | [GGUF models only] Maximum tokens allocated for image encoding. Higher values preserve more image detail but consume more context window. Default: 4096. |
| top_kopt | INT | 00–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_popt | FLOAT | 0.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_samplingopt | INT | 00–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_sizeopt | INT | 41943041048576–10485760 | [GGUF models only] Memory pool size for GGUF vision processing. Controls internal buffer allocation. Default: 4,194,304 (4 MB). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| RESPONSE | STRING | — |