Nodes/Sagado Nodes for ComfyUI/Get Llama VL Chat Handler
ComfyUI Node

Get Llama VL Chat Handler

The Missing Piece That Lets Your GGUF LLM Actually See

By 5agado·Created 12 months ago·Updated 18 days ago· 1
Get Llama VL Chat Handler
    • chat_handler
    clip_model_name
    models_dir_path
    handler_typeQwen3VL
    image_min_tokens2048

    A plain GGUF language model is blind. If you want your local LLM to look at an image - caption it, describe a render, critique a composition - you need a vision model, and in llama.cpp-land that means a chat handler that pairs the text model with a CLIP vision tower. That's what this node produces. It's not a model loader itself; it's the accessory that makes the loader's output multimodal.

    How it works

    The node imports two handler classes from llama_cpp.llama_chat_format - Qwen3VLChatHandler and Qwen25VLChatHandler - and constructs one based on the handler_type you pick. The handler gets two things:

    • the CLIP model file at models_dir_path / clip_model_name (this is a separate GGUF vision-encoder file, not the text model), and
    • an image_min_tokens budget (default 2048) controlling how many tokens the vision tower is allowed to spend on an image.

    The resulting handler is returned as a MODEL object and plugs into the chat_handler input of the pack's Get LlamaCPP Model node. There, it's injected into the Llama() call - so the text model loads with vision attached.

    Inputs and output

    • clip_model_name (STRING) - the CLIP GGUF filename, e.g. a Qwen2-VL vision encoder.
    • models_dir_path (STRING) - folder holding the CLIP file.
    • handler_type (dropdown: Qwen3VL / Qwen25VL) - matches the vision-model family you're running.
    • image_min_tokens (INT, default 2048, range up to 12000) - token budget per image.
    • Output: chat_handler (MODEL) → into Get LlamaCPP Model's chat_handler socket.

    Install and the usual gotchas

    The same rules as its siblings: the pack itself installs via ComfyUI Manager or

    cd ComfyUI/custom_nodes
    git clone https://github.com/5agado/ComfyUI-Sagado-Nodes
    pip install -r ComfyUI-Sagado-Nodes/requirements.txt
    

    but llama-cpp-python is not in that requirements file, and this node does from llama_cpp.llama_chat_format import ... - so install it yourself (pip install llama-cpp-python) or you'll get a ModuleNotFoundError the moment this node runs.

    The failure mode to expect: Chat-handler not found at: <path> means your clip_model_name / models_dir_path combination is wrong - it checks the file exists before building the handler. And getting the pairing right is on you: a Qwen3VL handler needs a Qwen3 VL text model, and mismatching handler family to model family produces garbage or errors rather than a polite warning. There are no bundled model downloads - you supply both the text GGUF and the CLIP GGUF yourself. Once it's wired, image + prompt through Get LLM Response and your local LLM can finally look at the thing you generated.

    CategorySagado-Nodes

    Inputs (4)

    NameTypeDefaultDescription
    clip_model_nameSTRING
    models_dir_pathSTRING
    handler_typeCOMBOQwen3VL2 options: Qwen3VL, Qwen25VL
    image_min_tokensINT2048-1–12000

    Outputs (1)

    NameTypeDescription
    chat_handlerMODEL