Nodes/ComfyUI Qwen2.5-VL Object Detection Node/Download and Load Qwen2.5-VL Model
ComfyUI Node

Download and Load Qwen2.5-VL Model

The first run downloads a vision LLM into ComfyUI/models — yes, that's the point

By TTPlanetPig·Created about a year ago·Updated 9 months ago· 149
Download and Load Qwen2.5-VL Model
    • qwen_model
    model_name
    device
    precision
    attention

    This is the model loader for the Qwen2.5-VL object detection pack, and the name is literal. The first time you run Download and Load Qwen2.5-VL Model, ComfyUI pulls a Qwen2.5-VL checkpoint down from HuggingFace into your ComfyUI/models/Qwen folder, loads it along with its processor, and hands the whole thing out as a single qwen_model output. Nothing else in the pack works without it, so it's the least glamorous and most load-bearing node here.

    Qwen2.5-VL is a vision-language model - an LLM that can see. You point it at an image and ask a question in plain English, and it answers. Here it's the brain for the pack's object detection; this loader is just the front door. The author, TTPlanetPig, is a well-known ComfyUI dev - their TTP_Toolset alone has over a thousand stars - so this isn't a sketchy weekend project, and it shows in small ways: the download resumes if interrupted, and if the checkpoint lands corrupted, the loader catches the load error and forces a clean re-download.

    Model choice is the decision that matters. The dropdown offers four Instruct checkpoints: 3B, 7B, 32B and 72B. The honest sizing for most people is 3B if you're on a 6–8GB card, 7B if you have real VRAM headroom, and the two big ones are for serious hardware and real patience. The 3B is genuinely good at "find the cat"; accuracy scales up with size, but so do download time, RAM, and the chance you run out of memory.

    The other three inputs are set-and-forget once you understand them:

    • device - auto, explicit cuda:0/cuda:1, or cpu. Auto is right for a single GPU. The explicit CUDA options exist for multi-GPU rigs where you want the VLM parked on card #2 so it doesn't fight your diffusion model. cpu works but is slow - the escape hatch for when you're out of VRAM.
    • precision - INT4, INT8, BF16, FP16 or FP32. INT4/INT8 use bitsandbytes quantization to squeeze the model into less VRAM (that's where the bitsandbytes dependency comes from); BF16/FP16 are the normal efficient floats; FP32 is a memory hog you almost never want. If in doubt: INT8 when tight on VRAM, BF16 when you're not.
    • attention - flash_attention_2 or sdpa. This is the one that bites people. FlashAttention is faster, but the flash-attn package is not a dependency of this pack, so picking it usually errors on first run unless you built it yourself. Leave it on sdpa, which just works. And if you select FP32, the node silently switches you to SDPA anyway, because FlashAttention doesn't support FP32.

    You get exactly one output: qwen_model of type QWEN_MODEL, which wires straight into the Qwen2.5-VL Object Detection node. This isn't an output node; it exists purely to feed the detector.

    Install is the standard song and dance. ComfyUI Manager → search "ComfyUI Qwen2.5-VL Object Detection Node" → install and restart, or clone it yourself:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TTPlanetPig/Comfyui_Object_Detect_QWen_VL
    pip install -r requirements.txt   # transformers, huggingface_hub, pillow, bitsandbytes
    

    Then restart ComfyUI. Budget for the first run: it downloads the full checkpoint (a handful of gigabytes even for the 3B) into a models/Qwen/Qwen_Qwen2.5-VL-7B-Instruct-style folder - slashes in the repo id become underscores. If the node sits on "downloading" for ten minutes, that's normal, not a hang.

    Troubleshooting in one breath: flash-attn errors → switch attention to sdpa. bitsandbytes complaints on INT4/INT8 → that platform's bitsandbytes is unhappy, drop to BF16. Anything else tends to be VRAM → fall back to the 3B at INT8.

    CategoryQwen2.5-VL

    Inputs (4)

    NameTypeDefaultDescription
    model_nameCOMBO4 options: Qwen/Qwen2.5-VL-3B-Instruct, Qwen/Qwen2.5-VL-7B-Instruct, Qwen/Qwen2.5-VL-32B-Instruct, Qwen/Qwen2.5-VL-72B-Instruct
    deviceCOMBO4 options: auto, cuda:0, cuda:1, cpu
    precisionCOMBO5 options: INT4, INT8, BF16, FP16, FP32
    attentionCOMBO2 options: flash_attention_2, sdpa

    Outputs (1)

    NameTypeDescription
    qwen_modelQWEN_MODEL