Skip to content

Instantly share code, notes, and snippets.

@fancellu
Created October 30, 2026 17:52
Show Gist options
  • Select an option

  • Save fancellu/d74dd041c62f1b49f980634c7d6a775f to your computer and use it in GitHub Desktop.

Select an option

Save fancellu/d74dd041c62f1b49f980634c7d6a775f to your computer and use it in GitHub Desktop.
Getting QwenVL working with Comfyui desktop and flash/sage attention backends

ComfyUI Desktop (0.43.0) — QwenVL GGUF + Attention Backends on Windows 11

Environment: RTX 4090, Python 3.12 (cp312), torch 2.9.1+cu130, triton-windows 3.2.0.post21

1. QwenVL GGUF (llama-cpp-python fork)

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.

2. SageAttention

# 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.

3. Flash-Attention 2

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.

Key Rules

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment