Error occurred when executing IPAdapter: insightface model is required for FaceID models

在使用 ComfyUI IPAdapter Plus 的 FaceID 相关节点时,如果代码内检测到 insightface 不可用,就会抛出该异常。优先排查 insightface 及 onnxruntime 是否正确安装,以及 ComfyUI 在安装后是否已重启加载依赖。

快速结论:在使用 ComfyUI IPAdapter Plus 的 FaceID 相关节点时,如果代码内检测到 insightface 不可用,就会抛出该异常。优先排查 insightface 及 onnxruntime 是否正确安装,以及 ComfyUI 在安装后是否已重启加载依赖。

适用环境:Issue 中主要来自 RunPod 上的 ComfyUI 环境,使用 ComfyUI - Jupyter / ghcr.io/ai-dock/comfyui:latest-jupyter 模板,用户使用 SDXL 与 FaceID 模型,并在 /workspace/ComfyUI 目录下安装依赖。Issue 未提供明确的 Python、CUDA、PyTorch、显卡型号等版本信息。

最快修复方案:在 ComfyUI Manager 中使用 Install PIP packages 安装 pip install pillow==10.2.0 insightface onnxruntime onnxruntime-gpu,随后重启 ComfyUI;若刚安装完依赖但未重启,也可先重启 ComfyUI 再测试。

注意事项:该修复来自 Issue 中用户的验证反馈,但不同 RunPod 模板、镜像或 Python 虚拟环境可能仍会失败;若手动安装的包未安装到 ComfyUI 实际使用的 Python 环境中,或未在 ComfyUI 启动时被加载,问题可能依旧存在。另需确认 FaceID 模型应配合 FaceID IPAdapter 节点使用,而不是普通 IPAdapter 节点。

问题场景

用户在 RunPod 的 ComfyUI 环境中运行 IPAdapter Plus,使用 FaceID 模型(FaceID、LoRA 等已放入对应目录),并已尝试通过 pip install insightface、pip install onnxruntime 和 pip install onnxruntime-gpu 安装依赖。可能在执行 IPAdapter 节点时触发该报错。

报错原文

Error occurred when executing IPAdapter:

insightface model is required for FaceID models

File "/workspace/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/workspace/ComfyUI/execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/workspace/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/workspace/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus/IPAdapterPlus.py", line 569, in apply_ipadapter
return (ipadapter_execute(model.clone(), ipadapter['ipadapter']['model'], ipadapter['clipvision']['model'], **ipa_args), )
File "/workspace/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus/IPAdapterPlus.py", line 181, in ipadapter_execute
raise Exception("insightface model is required for FaceID models")

原因分析

报错对应 IPAdapterPlus.py 中的判断:当 is_faceid 为真且 insightface 不可用时,会抛出该异常。因此最可能的原因是 ComfyUI 当前运行环境没有成功加载 insightface,或者安装的 insightface / onnxruntime 不在 ComfyUI 使用的 Python 环境里。另一种可能是安装依赖后没有重启 ComfyUI,导致运行中的进程仍未加载新依赖。也有讨论指出,FaceID 模型需要使用 FaceID IPAdapter 节点,使用错误节点也可能触发问题;此外,Issue 中提到下载 InsightFace 模型后问题解决。

环境排查

  • 确认正在使用 FaceID 模型时,是否选择了对应的 FaceID IPAdapter 节点。
  • 确认 ComfyUI 启动时终端是否出现 insightface 导入或 onnxruntime 相关错误。
  • 确认 insightface、onnxruntime、onnxruntime-gpu 是否安装到 ComfyUI 实际使用的 Python 环境中,而不是系统其他 Python 环境。
  • RunPod 用户确认所用模板,Issue 中提到的模板为 ghcr.io/ai-dock/comfyui:latest-jupyter(即 ComfyUI - Jupyter)。
  • 如通过 Jupyter 终端手动安装模型或依赖,注意未使用网络卷时数据可能不会持久化。

解决步骤

  1. 先确认 FaceID 模型使用的是 FaceID 专用 IPAdapter 节点,而不是普通 IPAdapter 节点。
  2. 如果刚安装过 insightface / onnxruntime,先重启 ComfyUI,再重新执行节点。
  3. 在 RunPod 环境且使用 ComfyUI Manager 时,优先尝试通过 Install PIP packages 安装:pip install pillow==10.2.0 insightface onnxruntime onnxruntime-gpu。
  4. 安装完成后再次重启 ComfyUI。
  5. 若仍报错,检查 ComfyUI 启动日志中是否有 insightface 或 onnxruntime 的导入异常。
  6. 如果怀疑缺少 InsightFace 模型文件,可尝试下载 InsightFace 模型后重新测试。
  7. 如果使用的是 RunPod 的 Jupyter 模板,可通过终端进入目标模型目录,使用 wget 下载模型,并在必要时用 mv 重命名为带正确扩展名的文件;模型持久化需要网络卷支持。

验证方法

重启 ComfyUI 后重新执行 FaceID IPAdapter 工作流,观察是否不再出现 insightface model is required for FaceID models,节点能够正常完成推理;同时确认 ComfyUI 启动日志中没有 insightface / onnxruntime 导入失败信息。

参考来源

cubiq/ComfyUI_IPAdapter_plus #401

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

这个方案解决了吗?

celebrityanime
celebrityanime
文章: 25390

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注