Environment: RTX 4090, Python 3.12 (cp312), torch 2.9.1+cu130, triton-windows 3.2.0.post21
The standard llama-cpp-python on PyPI doesn't include the vision chat handlers. You need JamePeng's fork as a pre-built wheel.
My python was in D:\comfyui_run\ComfyUI\.venv\Scripts\python.exe
# Install (use --no-deps to avoid clobbering pillow/numpy)
python.exe -m pip install --force-reinstall --no-deps .\llama_cpp_python-0.4.5+cu130-cp312-cp312-win_amd64.whl
# Pin the deps it needs, at versions compatible with the rest of your env
python.exe -m pip install "numpy<2.3" "pillow<13" diskcache jinja2 typing-extensions
# Verify
python.exe -c "from llama_cpp.llama_chat_format import Qwen3VLChatHandler, Qwen25VLChatHandler; print('handlers OK')"Wheel source: JamePeng/llama-cpp-python/releases — match cu130 + cp312 + win_amd64.
# Prerequisite (already installed)
python.exe -m pip install "triton-windows<3.3"
# Install the correct wheel (ABI3 = works across Python versions)
python.exe -m pip install --no-deps .\sageattention-2.2.0+cu130torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
# Verify
python.exe -c "from sageattention import sageattn; print('sage OK')"Wheel source: woct0rdho/SageAttention/releases — pick the torch2.9.0andhigher + cp39-abi3 + cu130 variant.
pip install flash-attn doesn't work on Windows (no PyPI wheel, source build fails). Grab a pre-built .whl:
# NOTE: HuggingFace URL-encodes + as %2B — rename the file after downloading
Rename-Item .\flash_attn-2.8.3%2Bcu130torch2.9.1cxx11abiTRUE-cp312-cp312-win_amd64.whl .\flash_attn-2.8.3+cu130torch2.9.1cxx11abiTRUE-cp312-cp312-win_amd64.whl
python.exe -m pip install --no-deps .\flash_attn-2.8.3+cu130torch2.9.1cxx11abiTRUE-cp312-cp312-win_amd64.whl
# Verify
python.exe -c "import flash_attn; print('flash OK')"Wheel source: ussoewwin/Flash-Attention-2_for_Windows or Wildminder/AI-windows-whl — match your exact torch version + cu130 + cp312.
| Rule | Why |
|---|---|
Always use --no-deps for manual wheels |
Prevents pip from upgrading shared deps (pillow, numpy) and breaking other nodes |
| Pin deps manually after | You control the exact versions that coexist |
Match torch version exactly (or use andhigher/ABI3) |
CUDA extensions have hardcoded symbol references — wrong torch = DLL load failure |
| Use the venv's python, not system python | D:\comfyui_run\ComfyUI\.venv\Scripts\python.exe |
%2B in filenames from HuggingFace = literal + |
Rename before pip install |