Nodes/ComfyUI_Simple_Qwen3-VL-gguf/Qwen-VL Model Config
ComfyUI Node

Qwen-VL Model Config

The LLM Model Config node

By KLL535Β·Created 9 months agoΒ·Updated a day agoΒ· 85
Qwen-VL Model Config
    • config
    β—„model_pathβ–Ί
    β—„mmproj_pathβ–Ί
    β—„n_ctx8192β–Ί
    β—„n_batch2048β–Ί
    β—„n_ubatch512β–Ί
    β—„n_gpu_layers-1β–Ί
    β—„n_cpu_moe0β–Ί
    β—„n_threads8β–Ί
    β—„use_mmapfalseβ–Ί
    β—„use_mlockfalseβ–Ί
    β—„offload_kqvtrueβ–Ί
    β—„chat_handlernoneβ–Ί
    β—„chat_formatnoneβ–Ί
    β—„force_mmprojtrueβ–Ί
    β—„enable_thinkingfalseβ–Ί
    β—„verbosefalseβ–Ί
    β—„debugtrueβ–Ί
    β—„type_kF16β–Ί
    β—„type_vF16β–Ί
    β—„config_overrideβ€”β–Ί

    The main Qwen node takes its entire model configuration as a wall of JSON in config_override. That works, but it's hostile to beginners - one stray comma, one typo in mmproj_path, and you're debugging text you can't see. LLM Model Config is the pack's attempt to give you the same settings as real widgets instead. It's the "model half" of a two-node configurator (the sampling half is LLM Sampling Config).

    The mechanism is refreshingly simple: this node has no inputs of consequence except one optional config_override for stacking extra fields, and it outputs a single config string. You wire that string into the main Qwen node's config_override input, exactly as if you'd typed the JSON yourself - because that's literally what it produces. Later values win when you stack, so you can chain a model config node plus a sampling config node plus a raw override and the pieces merge in order.

    The inputs that matter

    • model_path - path to your GGUF model file, relative to the custom_nodes dir (or absolute).
    • mmproj_path - path to the multimodal projector file. Required for vision. This is the single most-forgotten field in the whole pack; leave it empty and the model has no idea how to look at images.
    • n_ctx - context size. The tooltip gives the rule: image_tokens + input_tokens + output_tokens <= n_ctx. Bump it for multi-image or video work; every token costs VRAM.
    • n_gpu_layers - layers offloaded to GPU. -1 = all. If you're OOMing or crawling, walk it down (40 β†’ 35 β†’ 30); the README notes this can even speed things up by avoiding VRAM overflow.
    • n_batch / n_ubatch - prompt-processing batch and micro-batch. Lower saves VRAM, n_batch = n_ctx can speed up processing.
    • n_cpu_moe - for MoE models that don't fit in VRAM: moves that many expert layers to RAM/CPU. Roughly twice as fast as the old n_gpu_layers partial offload for big routers.
    • chat_handler - the chat template for multimodal models: qwen3, qwen35, gemma4, llava16, minicpmv45 and more. Get this wrong and you get garbage templates and garbled prompts.
    • chat_format - for text-only models (llama-3, qwen, chatml…).
    • enable_thinking - turns on reasoning for Qwen3.5/Gemma4. Costs output tokens; budget for it.
    • use_mmap / use_mlock / offload_kqv - memory behavior. The README's observation: on Windows, use_mmap off is often better; offload_kqv off is the "safe VRAM" fallback.
    • type_k / type_v - KV-cache quantization level. F16 default; lower types shrink the cache at some quality cost.
    • verbose / debug - logging toggles; debug prints per-stage timing to the console, useful when you're diagnosing slow runs.

    Install

    It's part of KLL535/ComfyUI_Simple_Qwen3-VL-gguf, so it arrives with the main node:

    cd ComfyUI/custom_nodes
    git clone https://github.com/KLL535/ComfyUI_Simple_Qwen3-VL-gguf
    

    or ComfyUI Manager (search ComfyUI_Simple_Qwen3-VL-gguf), restart, F5.

    Honest take: if you're already comfortable writing config_override JSON, this node is a slightly slower way to do the same thing - the widgets don't cover every llama.cpp parameter, and config_override on the main node still accepts the full dictionary. But if JSON is where your confidence dies, or you're teaching someone, the sliders and dropdowns make the difference between "I'll try it" and "nope, closing ComfyUI." Worth having on the canvas for exactly that.

    Category🌐 SimpleQwenVL

    Inputs (20)

    NameTypeDefaultDescription
    model_pathSTRINGPath to GGUF model file (relative to custom_nodes dir)
    mmproj_pathSTRINGPath to multimodal projector (required for vision)
    n_ctxINT8192512–1048576Context size: image_tokens + input_tokens + output_tokens <= n_ctx
    n_batchINT204832–8192Prompt processing batch. Lower = less VRAM, higher = faster.
    n_ubatchINT51232–8192Micro-batch size for advanced memory management
    n_gpu_layersINT-1-1–256Layers to GPU: -1=all, 0=CPU only. Reduce if OOM.
    n_cpu_moeINT00–128MoE experts on CPU (VRAM saver). 0 = all on GPU.
    n_threadsINT81–64CPU threads for inference. Match physical cores.
    use_mmapBOOLEANfalseMemory mapping. set True if faster model loading.
    use_mlockBOOLEANfalseLock model in RAM (prevent swap). Uses more RAM.
    offload_kqvBOOLEANtrueOffload KV Cache to GPU. Turn OFF to save VRAM (will be slower).
    chat_handlerCOMBOnoneChat template for multimodal models.
    chat_formatCOMBOnoneChat format for text-only models.
    force_mmprojBOOLEANtrueForce load mmproj even without images (preserves template for enable_thinking).
    enable_thinkingBOOLEANfalseEnable thinking/reasoning process (for Gemma, Qwen, MiniCPM, GLM, etc.)
    verboseBOOLEANfalseVerbose llama.cpp logging
    debugBOOLEANtrueOutput timing info to console
    type_kCOMBOF1634 options: F32, F16, Q4_0, Q4_1, Q5_0, Q5_1, +28
    type_vCOMBOF1634 options: F32, F16, Q4_0, Q4_1, Q5_0, Q5_1, +28
    config_overrideoptSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    configSTRINGβ€”