OpenGL dependencies not available in ComfyUI
修复 ComfyUI 报 OpenGL dependencies not available 的问题,恢复内置 GLSL 节点需要的 PyOpenGL 和 glfw。
如果 ComfyUI 日志里出现 OpenGL dependencies not available,说明内置 GLSL shader 节点的导入时依赖检查没有通过。
这次真实实验里,它没有把整个 server 打死。ComfyUI 还是能打开,但 nodes_glsl.py 直到 PyOpenGL 和 glfw 都装进同一个 Python 环境后才恢复。
快速处理
对 GitHub Windows 便携包:
.\python_embeded\python.exe -s -m pip show PyOpenGL glfw
.\python_embeded\python.exe -s -m pip install PyOpenGL
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build如果重启后同样的错误还在,再装另一半:
.\python_embeded\python.exe -s -m pip install glfw真实日志长什么样
这次实验里,关键日志是:
RuntimeError: OpenGL dependencies not available.
Cannot import ...\ComfyUI\comfy_extras\nodes_glsl.py module for custom nodes: OpenGL dependencies not available.nodes_glsl.py 这段内置代码会检查两个 Python 包:
glfw- 来自
PyOpenGL的OpenGL
只要缺一个,GLSL 节点就不会回来。
快速判断
| 你看到什么 | 代表什么 | 第一动作 |
|---|---|---|
OpenGL dependencies not available,而且来自 nodes_glsl.py | 内置 GLSL 节点依赖检查失败 | 在当前 ComfyUI Python 里安装 PyOpenGL 和 glfw |
日志里已经出现 Starting server | 核心 server 没死 | 这是“部分节点不可用”的问题 |
装了 PyOpenGL 还是报一样的错 | glfw 还没装 | 再装 glfw |
| 在无显示的 Linux 上出现这个错误 | 也可能是 headless display/backend 问题 | 需要额外检查 display/EGL/OSMesa |
| 第二个包装完后节点数上升 | GLSL 节点恢复了 | 这是很好的确认信号 |
第 1 步:先看本地 requirements
实验环境里的 ComfyUI\requirements.txt 包含:
PyOpenGL
glfw你自己的环境先查:
Get-Content ComfyUI\requirements.txt | Select-String "PyOpenGL|glfw"第 2 步:一个包一次修
Windows 便携包:
.\python_embeded\python.exe -s -m pip install PyOpenGL然后重启一次看日志。真实实验里,这一步还不够,OpenGL 错误还在,所以接着装了:
.\python_embeded\python.exe -s -m pip install glfw这也是这篇单独拆出来的价值:只看到错误字符串还不够,你还得知道它背后实际上是“两件套”,缺任意一半都不行。
第 3 步:重启,验证 GLSL 节点回来
重新启动:
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build这次实验里:
- 只装
PyOpenGL后,OpenGL 错误还在 - 再装
glfw后,错误才消失 /object_info节点数从 687 增加到 688
最后这个节点数变化,是很直接的恢复信号。
第 4 步:理解它到底影响多大
这个错误通常意味着:
- 服务本身还能启动
- 其他节点可能还能工作
- 但 GLSL shader 节点不可用
所以它是真问题,但不是 torch、sqlalchemy 那种“服务根本起不来”的问题。
如果你的工作流需要 GLSL 节点,那它依然很急;如果不需要,那你可以把它当作“内置 extra 节点修复”,而不是“整个 ComfyUI 全挂了”。
不要做这些事
- 不要以为装了
PyOpenGL一定就修好 - 不要把包装到系统 Python,而 ComfyUI 其实跑在
python_embeded或 venv - 不要把 Windows 上缺包的情况和 Linux 无显示环境的问题混为一谈
- 不要只看浏览器能打开,就忽略 GLSL 节点其实还没恢复
Wonderful Launcher 能帮什么
这又是一个“ComfyUI 能打开不等于节点面完整”的例子。Wonderful Launcher 更适合这种情况,因为它能帮助你验证:修复之后,预期节点是不是真的回来了,而不只是网页能不能访问。
相关指南
- ComfyUI 便携版依赖损坏后,按一个报错一个包修启动
- ModuleNotFoundError: No module named 'kornia' in ComfyUI
- ComfyUI No module named 警告:什么时候可以忽略
- ComfyUI Startup Failed
- ComfyUI 依赖冲突
来源与实测
- 2026-05-18 Windows 便携版实验:
OpenGL dependencies not available让ComfyUI\comfy_extras\nodes_glsl.py导入失败 - 同一实验
ComfyUI\requirements.txt:包含PyOpenGL和glfw - 同一实验验证:只装
PyOpenGL还不够,补上glfw后 GLSL 节点恢复,/object_info节点数从 687 增加到 688
你可以手动修复,也可以下载 Windows 版 Wonderful Launcher 自动诊断插件报错、依赖缺失和环境损坏,不用盲目重装。
免费下载 Windows 版Did this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.