ComfyUI 缺失节点包修复教程:插件已安装但仍提示 Missing Nodes、红色节点、UNKNOWN 的解决方法

本文整理 Windows 版 ComfyUI Desktop 中常见的缺失节点包问题:插件明明已经安装但仍提示 Missing Nodes、节点变红、节点显示 UNKNOWN、ComfyUI Manager 显示已安装但工作流仍无法运行。通过清理错误插件目录、确认真实数据目录、重新 git clone 插件并使用正确的 .venv 环境安装依赖,可以彻底解决 LayerStyle、KJNodes、Comfyroll、Workflow Encrypt 等插件加载失败问题。


一、问题现象:插件明明安装了,为什么还是提示缺失节点?

在 Windows 版 ComfyUI Desktop 中,很多用户会遇到类似问题:

  • 打开工作流后,右侧提示“缺失节点包”。
  • ComfyUI Manager 显示插件“已安装”,但节点仍然是红色。
  • 节点上显示 UNKNOWN。
  • 工作流提示 Missing Nodes。
  • 节点名称显示正常,但运行时仍然报错。
  • 重新安装插件后,问题还是存在。
  • git pull 报错:fatal: not a git repository。
  • git clone 报错:destination path already exists and is not an empty directory。
  • GitHub 下载插件时报错:Connection was reset 或 Couldn’t connect to server。

这些问题表面看起来不一样,但很多时候本质是同一个原因:插件目录安装错了、插件目录残缺、插件不是通过 git 正常安装,或者依赖没有安装到 ComfyUI 当前真正使用的 Python 虚拟环境中。


二、这类问题最常见的根本原因

1. ComfyUI Desktop 有两个不同目录,容易混淆

Windows 版 ComfyUI Desktop 通常会有两个目录:

D:\ComfyUI
= ComfyUI Desktop 桌面程序本体,里面有 ComfyUI.exe、resources、dll 等文件

C:\ComfyUI_data
= ComfyUI 实际运行数据目录,里面有 .venv、custom_nodes、models、input、output、user 等目录

真正安装插件的位置不是桌面程序目录,而是:

C:\ComfyUI_data\custom_nodes

真正安装 Python 依赖的位置也不是系统 Python,而是:

C:\ComfyUI_data\.venv

如果你把插件装到了旧目录,例如:

C:\ComfyUI\custom_nodes

但当前 ComfyUI 实际使用的是:

C:\ComfyUI_data\custom_nodes

那么就会出现“插件好像安装了,但工作流仍然缺失节点”的情况。

2. 插件文件夹存在,但不是正常 git 仓库

如果执行:

git pull

出现:

fatal: not a git repository (or any of the parent directories): .git

说明这个插件文件夹虽然存在,但不是通过 git clone 正常安装的,可能是:

  • ComfyUI Manager 下载残留;
  • 手动解压过的 ZIP;
  • 上次安装失败留下的半成品目录;
  • 迁移或重装 ComfyUI 后留下的旧目录。

这种目录继续修通常很麻烦,最稳的方式是删除后重新克隆。

3. 依赖装到了错误的 Python 环境

很多用户会直接执行:

pip install xxx

这样有可能装到了系统 Python,而不是 ComfyUI Desktop 的虚拟环境。

正确方式必须使用:

C:\ComfyUI_data\.venv\Scripts\python.exe -m pip install xxx

只要不是用 ComfyUI 当前数据目录里的 .venv 安装依赖,ComfyUI 就可能仍然加载不到节点。


三、常见红色节点对应的插件包

不同工作流缺的节点不一样,但可以根据红色节点名称判断应该安装哪个插件。

红色节点 / 缺失节点 通常对应的插件 说明
LayerUtility: PurgeVRAM V2 ComfyUI_LayerStyle / ComfyUI_LayerStyle_Advance LayerStyle 系列图像处理节点
ColorMatch ComfyUI-KJNodes 通常还需要 color-matcher 依赖
CR Text ComfyUI_Comfyroll_CustomNodes Comfyroll Studio 文本节点
comfyui-workflow-encrypt ComfyUI-Workflow-Encrypt 加密 / 解密工作流插件

四、修复前准备

下面以 ComfyUI 当前数据目录为:

C:\ComfyUI_data

为例。如果你的实际目录不同,请替换成自己的路径。

操作前请先完全关闭 ComfyUI Desktop。

建议使用管理员身份打开 CMD:

  1. 点击 Windows 开始菜单;
  2. 搜索 CMD;
  3. 右键选择“以管理员身份运行”。

五、第一步:关闭 ComfyUI 和 Python 进程

taskkill /F /IM ComfyUI.exe
taskkill /F /IM python.exe
taskkill /F /IM pythonw.exe
timeout /t 3

如果提示找不到某个进程,不用管,继续下一步。


六、第二步:进入正确的 custom_nodes 目录

cd /d C:\ComfyUI_data\custom_nodes

注意,一定是当前 ComfyUI Desktop 实际使用的数据目录。

如果你的 ComfyUI 数据目录是:

C:\ComfyUI_data

那么插件目录就是:

C:\ComfyUI_data\custom_nodes

不要装到:

C:\ComfyUI\custom_nodes

除非你的真实数据目录就是 C:\ComfyUI。


七、第三步:删除错误或残留插件目录

如果插件目录已经存在,但 git pull 报错,建议直接删除重装。

cd /d C:\ComfyUI_data\custom_nodes

rmdir /s /q ComfyUI_LayerStyle
rmdir /s /q ComfyUI_LayerStyle_Advance
rmdir /s /q ComfyUI-Workflow-Encrypt
rmdir /s /q ComfyUI-KJNodes
rmdir /s /q ComfyUI_Comfyroll_CustomNodes

如果提示“系统找不到指定的路径”,说明这个插件目录本来就不存在,可以忽略。


八、第四步:优化 GitHub 下载稳定性

有些网络环境下,git clone GitHub 仓库时可能出现:

Connection was reset
Couldn't connect to server
RPC failed

可以先执行下面命令,提高下载稳定性:

git config --global http.version HTTP/1.1
git config --global http.postBuffer 524288000
git config --global core.compression 0

九、第五步:重新安装缺失插件

继续在 CMD 中执行:

cd /d C:\ComfyUI_data\custom_nodes

git clone --depth=1 https://github.com/chflame163/ComfyUI_LayerStyle.git

git clone --depth=1 https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git

git clone --depth=1 https://github.com/jtydhr88/ComfyUI-Workflow-Encrypt.git

git clone --depth=1 https://github.com/kijai/ComfyUI-KJNodes.git

git clone --depth=1 https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git

如果某一条因为网络失败,不需要全部重来,只需要重新执行失败的那一条即可。

如果提示某个目录已存在,说明前面没有删除干净,可以先删除对应目录,再重新执行 clone 命令。


十、第六步:使用 ComfyUI 的 .venv 安装依赖

这是最关键的一步。

一定要进入 ComfyUI 数据目录:

cd /d C:\ComfyUI_data

然后用 ComfyUI 自己的 Python 环境安装依赖:

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI_LayerStyle\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI_LayerStyle_Advance\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI-Workflow-Encrypt\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI-KJNodes\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install color-matcher -i https://mirrors.aliyun.com/pypi/simple/

Comfyroll 插件有些版本可能没有 requirements.txt,可以用下面这条安全判断命令:

if exist custom_nodes\ComfyUI_Comfyroll_CustomNodes\requirements.txt .venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI_Comfyroll_CustomNodes\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

十一、如果出现依赖冲突提示怎么办?

安装过程中可能会看到类似提示:

pip's dependency resolver does not currently take into account all the packages that are installed

或者看到某些包版本冲突,例如:

torchscale requires timm==0.6.13, but you have timm 1.0.27

这类提示不一定代表安装失败。重点看最后是否出现:

Successfully installed ...

如果最后显示 Successfully installed,并且 ComfyUI 重启后节点恢复正常,通常可以先不处理。


十二、第七步:重启 ComfyUI Desktop

依赖安装完成后,重新打开 ComfyUI Desktop。

如果右侧工作流检查面板还显示“已安装但缺失”,可以点一下:

应用更改

然后再次完整关闭并重新打开 ComfyUI Desktop。

重新加载工作流后,重点观察这些红色节点是否恢复正常:

LayerUtility: PurgeVRAM V2
ColorMatch
CR Text

如果这些节点不再是红色,说明插件已经正常加载。


十三、完整命令汇总

以下命令适合 ComfyUI 数据目录为 C:\ComfyUI_data 的情况。

请先完全关闭 ComfyUI Desktop,并使用管理员 CMD 执行。

taskkill /F /IM ComfyUI.exe
taskkill /F /IM python.exe
taskkill /F /IM pythonw.exe
timeout /t 3

cd /d C:\ComfyUI_data\custom_nodes

rmdir /s /q ComfyUI_LayerStyle
rmdir /s /q ComfyUI_LayerStyle_Advance
rmdir /s /q ComfyUI-Workflow-Encrypt
rmdir /s /q ComfyUI-KJNodes
rmdir /s /q ComfyUI_Comfyroll_CustomNodes

git config --global http.version HTTP/1.1
git config --global http.postBuffer 524288000
git config --global core.compression 0

git clone --depth=1 https://github.com/chflame163/ComfyUI_LayerStyle.git
git clone --depth=1 https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git
git clone --depth=1 https://github.com/jtydhr88/ComfyUI-Workflow-Encrypt.git
git clone --depth=1 https://github.com/kijai/ComfyUI-KJNodes.git
git clone --depth=1 https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git

cd /d C:\ComfyUI_data

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI_LayerStyle\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI_LayerStyle_Advance\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI-Workflow-Encrypt\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI-KJNodes\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

.venv\Scripts\python.exe -m pip install color-matcher -i https://mirrors.aliyun.com/pypi/simple/

if exist custom_nodes\ComfyUI_Comfyroll_CustomNodes\requirements.txt .venv\Scripts\python.exe -m pip install -r custom_nodes\ComfyUI_Comfyroll_CustomNodes\requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

十四、常见问题补充

1. 为什么 Manager 显示已安装,但工作流还是缺失?

可能是 Manager 记录里认为插件已安装,但实际插件目录损坏、目录不完整,或者插件被装到了旧的 custom_nodes 目录。

这种情况下,最稳的方式是删除插件目录后重新 git clone。

2. 为什么 git pull 失败?

如果报:

fatal: not a git repository

说明这个目录不是正常 git 仓库。通常是 ZIP 解压、安装失败残留,或者 Manager 下载的目录不完整。

解决方法是删除目录后重新 git clone。

3. 为什么不能直接 pip install?

因为直接执行 pip install 可能会装到系统 Python,而不是 ComfyUI Desktop 的虚拟环境。

正确方式是:

C:\ComfyUI_data\.venv\Scripts\python.exe -m pip install ...

4. 图像加载失败也是插件问题吗?

不一定。

如果节点上显示:

图像加载失败
图像不存在

通常是工作流引用的图片文件在本机不存在,需要重新上传或重新选择图片。这和缺失节点包不是同一个问题。

5. 如果 GitHub 一直下载失败怎么办?

可以多试几次,也可以换网络环境。如果 git clone 仍然失败,可以到插件 GitHub 页面手动下载 ZIP,然后解压到 custom_nodes 目录,并确保文件夹名称正确。

不过能使用 git clone 的情况下,优先推荐 git clone,因为后续可以直接 git pull 更新。


十五、总结

ComfyUI Desktop 出现 Missing Nodes、红色节点、UNKNOWN、插件显示已安装但无法加载,本质上通常不是工作流本身坏了,而是插件安装路径、插件目录完整性或 Python 依赖环境出了问题。

解决这类问题的核心思路是:

  1. 确认当前 ComfyUI 真正使用的数据目录,例如 C:\ComfyUI_data。
  2. 插件必须安装到 C:\ComfyUI_data\custom_nodes。
  3. 依赖必须安装到 C:\ComfyUI_data\.venv。
  4. 如果插件目录不是 git 仓库,直接删除后重新 clone。
  5. 如果 Manager 显示已安装但节点仍缺失,优先检查目录是否装错或损坏。
  6. 重启 ComfyUI Desktop 后重新加载工作流。

按照本文方法清理并重装插件后,大多数 ComfyUI 插件已安装但仍提示缺失节点包的问题,都可以一次性解决。

原创文章,作者:朋远方,如若转载,请注明出处:https://caovan.com/comfyui-queshijiedianbaoxiufujiaochengchajianyianzhuangdanrengtishi-missing-nodeshongsejiedianunk/.html

(0)
打赏 微信扫一扫 微信扫一扫
朋远方的头像朋远方
ComfyUI 模型迁移教程:Windows 将 models 文件夹转移到 D 盘,并设置缓存目录,解决 C 盘空间不足
上一篇 2026年5月14日 下午12:03
Meta 公司发布最新的开源模型Llama3 | 8B和70B参数 | 在线体验地址&模型下载地址
下一篇 2024年4月19日 上午10:48

相关推荐

发表回复

登录后才能评论