简介
ComfyUI_VLM_nodes 这个项目地址:https://github.com/gokayfem/ComfyUI_VLM_nodes
使用的是 ComfyUI_windows_portable ,cu128 , python 3.12
问题描述
我碰到情况是 VLM_nodes 在安装的时候需要使用 llama-cpp-agent ,其会拉上 llama-cpp-python,这会现场尝试编译,但大概率失败。所以无法启动。
解决方法
abetlen 官方的 CUDA wheel 索引目前只列到 cu125 ,所以只能尝试使用社区编译的 wheel 。
我选择的是这个 https://github.com/boneylizard/llama-cpp-python-cu128-gemma3/releases
这里要注意你的 CUDA 版本和 python 版本,我下载的是 llama_cpp_python-0.3.9-cp312-cp312-win_amd64-qwen3_cuda124.whl 对。。他文件上写的是 cu124 ,但是他说明里面写的是用 cu128 编译的。。。。
This release provides a custom-built .whl file for llama-cpp-python with CUDA acceleration, compiled to bring modern model support to Python 3.12 environments on Windows (x64) with NVIDIA CUDA 12.8.
It was created to address the gap left by slow or inactive official releases, especially for users who need support for recent Python versions and new GGUF models like Qwen3.
下载下来之后,推荐放在 ComfyUI_windows_portable 目录下,打开你的 shell 工具,进入到你的 ComfyUI_windows_portable 目录下,这里注意你全程都要使用 ComfyUI_windows_portable\python_embeded\python.exe 目录下的 python 而不是你自己电脑里的 python !
先升级一下,
.\python_embeded\python.exe -s -m pip install -U pip wheel
.\python_embeded\python.exe -s -m pip install "setuptools<81"
清理旧的 llama 相关包(避免版本打架)
.\python_embeded\python.exe -s -m pip uninstall -y llama-cpp-python llama-cpp-agent
开始安装 wheel
.\python_embeded\python.exe -s -m pip install .\llama_cpp_python-0.3.9-cp312-cp312-win_amd64-qwen3_cuda124.whl
如果你收到报错,
ERROR: Invalid build number: cp312 in 'llama_cpp_python-0.3.9-cp312-cp312-win_amd64-qwen3_cuda124'
则是因为 pip 25+ 开始的严格校验行为,文件的名字格式必须如下,你需要给文件进行一个重命名。
{distribution}-{version}-{python tag}-{abi tag}-{platform tag}.whl
将文件重命名为 llama_cpp_python-0.3.9+qwen3_cuda124-cp312-cp312-win_amd64.whl,(你要用的其他版本记得自己修改名字别照抄)再次运行安装。
安装成功后,测试一下
.\python_embeded\python.exe -s -c "import llama_cpp; print('llama_cpp OK, version:', getattr(llama_cpp, '__version__', 'unknown'))"
看到打印 llama_cpp OK 和版本号即算成功。
然后再次运行 comfyui ,正常来说插件会自动帮你把后面的内容补齐。