No module named 'insightface' in ComfyUI: Windows Fix
Fix No module named 'insightface' in ComfyUI for ReActor, IPAdapter FaceID, InstantID, PuLID, and other face-swap or face-analysis nodes on Windows.
ComfyUI shows ModuleNotFoundError: No module named 'insightface' (or Cannot import ... module for custom nodes: No module named 'insightface') when a face node cannot import InsightFace. Fix the Python environment ComfyUI actually uses, not a random system Python.
InsightFace is a face detection and recognition library used by ReActor (face swap), IPAdapter FaceID, InstantID, and PuLID. When it is missing, those nodes fail to load but the rest of ComfyUI usually keeps working. On PyPI it ships as a source distribution, so on Windows a plain pip install insightface often fails while trying to build native code:
error: Microsoft Visual C++ 14.0 or greater is required.
ERROR: Failed building wheel for insightface
fatal error C1083: Cannot open include file: 'Python.h': No such file or directorySeverity: medium — install it only if your workflow needs face-swap, FaceID, InstantID, PuLID, or another InsightFace-based feature.
Step 1: Use the correct Python
Install into the Python that starts ComfyUI:
| Install type | Command pattern |
|---|---|
| Official GitHub Windows portable package | From the portable package root: .\python_embeded\python.exe -s -m pip ... |
| Manual Git + venv install | Activate the venv, then run python -m pip ... |
| ComfyUI Desktop or managed launcher | Use the app's environment/terminal tools. Do not assume a portable python_embeded folder exists. |
Check the Python version first (python --version, or .\python_embeded\python.exe -s --version for portable). The wheel must match it.
Step 2: Install a matching community wheel only if you trust its source
On Windows, the community commonly uses pre-built wheels from the ReActor ecosystem. Choose the wheel that matches your Python version:
| Python | Wheel command for a manual/venv install |
|---|---|
| 3.10 | python -m pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl |
| 3.11 | python -m pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp311-cp311-win_amd64.whl |
| 3.12 | python -m pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp312-cp312-win_amd64.whl |
| 3.13 | python -m pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp313-cp313-win_amd64.whl |
For the official Windows portable package, replace python -m pip with .\python_embeded\python.exe -s -m pip.
Community-wheel boundary: These are third-party files, not wheels published by the official InsightFace PyPI project. Download only from a source you trust, record the exact URL and version, and prefer a backed-up environment. If you cannot assess that risk, do not install the wheel; use a supported environment or ask the node author for its documented dependency path.
Step 3: Install ONNX Runtime only if the workflow needs it
InsightFace uses ONNX Runtime as its inference backend. CPU ONNX Runtime is often enough:
python -m pip install onnxruntimeFor NVIDIA GPU acceleration:
python -m pip install onnxruntime-gpuGPU ONNX Runtime must match the CUDA/cuDNN family of your PyTorch runtime. If it fails with onnxruntime_providers_cuda.dll, use the ONNX / ONNXRuntime guide before changing more packages.
Step 4: Treat NumPy downgrades as a last resort
Do not downgrade NumPy just because InsightFace is mentioned — current ComfyUI environments can legitimately use NumPy 2.x. Only consider it if you see a real NumPy compatibility error from the face plugin you need, and back up first:
python -m pip install "numpy<2"Then restart ComfyUI and test only the face workflow that needed the change.
Step 5: Restart and verify
Restart ComfyUI (a plugin that already failed to import will not register its nodes until the next startup), then verify in the same environment:
python -c "import insightface; print(insightface.__version__)"Expected output is usually 0.7.3 for the community wheel path.
Still not working?
Collect the full IMPORT FAILED traceback, python --version, python -c "import torch; print(torch.__version__, torch.version.cuda)", and whether you installed CPU or GPU ONNX Runtime before choosing a support path.
Source References
Start free with Wonderful Launcher if this affects your real ComfyUI environment. It keeps launcher-native repair, task logs, and runtime checks in one place; credits are only for image generation and metered tools.
Download Wonderful LauncherSee credit packagesDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.