Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies missing for Insightface #162

Open
pphoto808 opened this issue Dec 25, 2023 · 157 comments
Open

Dependencies missing for Insightface #162

pphoto808 opened this issue Dec 25, 2023 · 157 comments
Labels
documentation Improvements or additions to documentation

Comments

@pphoto808
Copy link

Screenshot 2023-12-24 at 19 27 54

I have followed in the installation guide lines. Installed all the appropriate files in ComfyUI environment, updated Comfy and still get the same error.

Running Comfy on Mac Studio M2 Ultra.

@Winnougan
Copy link

I'm getting the exact same problem @pphoto808! Running on an i9, RTX 4080. Very weird. I followed all of Matteo's/Cubiq's instructions. Pip installed all of the dependencies and models. Everything is placed where it should be. And still on ComfyUI I get this:

Error occurred when executing InsightFaceLoader:

IPAdapter: InsightFace is not installed! Install the missing dependencies if you wish to use FaceID models.

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 459, in load_insight_face
raise Exception('IPAdapter: InsightFace is not installed! Install the missing dependencies if you wish to use FaceID models.')

@DavidGdsn
Copy link

Same problem here. I guess we'll need a new tutorial: "How to properly install InsightFace to make it work with IPAdapter", apparently many of us couldn't make it.

@ultimatech-cn
Copy link

ultimatech-cn commented Dec 25, 2023

It is the same problem with issue #156.
There is a workaround I am using.
But I still hope someone can find better solution.

@MMoneer
Copy link

MMoneer commented Dec 25, 2023

This solution From Reactor Trubleshoot:
I. (For Windows users) If you still cannot build Insightface for some reason or just don't want to install Visual Studio or VS C++ Build Tools - do the following:
(ComfyUI Portable) From the root folder check the version of Python:
run CMD and type python_embeded\python.exe -V
Download prebuilt Insightface package for Python 3.10 or for Python 3.11 (if in the previous step you see 3.11) and put into the stable-diffusion-webui (A1111 or SD.Next) root folder (where you have "webui-user.bat" file) or into ComfyUI root folder if you use ComfyUI Portable
From the root folder run:
(SD WebUI) CMD and .\venv\Scripts\activate
(ComfyUI Portable) run CMD
Then update your PIP:
(SD WebUI) python -m pip install -U pip
(ComfyUI Portable) python_embeded\python.exe -m pip install -U pip
Then install Insightface:
(SD WebUI) pip install insightface-0.7.3-cp310-cp310-win_amd64.whl (for 3.10) or pip install insightface-0.7.3-cp311-cp311-win_amd64.whl (for 3.11)
(ComfyUI Portable) python_embeded\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl (for 3.10) or python_embeded\python.exe -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl (for 3.11)
Enjoy!

I suggest uninstalling InsightFace first if exists then follow the above instructions.
Good luck

@DavidGdsn
Copy link

Thanks MMoneer, I've tried that, but no luck. Comfy still complains that InsightFace is not installed.

@MMoneer
Copy link

MMoneer commented Dec 25, 2023

do you have any errors in the consol log?

@DavidGdsn
Copy link

"Error occurred when executing InsightFaceLoader:

IPAdapter: InsightFace is not installed! Install the missing dependencies if you wish to use FaceID models.

File "F:\ConfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "F:\ConfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "F:\ConfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "F:\ConfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 459, in load_insight_face
raise Exception('IPAdapter: InsightFace is not installed! Install the missing dependencies if you wish to use FaceID models.')"

@MMoneer
Copy link

MMoneer commented Dec 25, 2023

I mean while InsightFace installation prosses.

@DavidGdsn
Copy link

Not really, if I run the install command again, I get this:
Processing f:\confyui\comfyui_windows_portable\python_embeded\insightface-0.7.3-cp310-cp310-win_amd64.whl
Requirement already satisfied: numpy in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (1.23.5)
Requirement already satisfied: onnx in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (1.14.0)
Requirement already satisfied: tqdm in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (4.66.1)
Requirement already satisfied: requests in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (2.31.0)
Requirement already satisfied: matplotlib in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (3.7.2)
Requirement already satisfied: Pillow in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (9.5.0)
Requirement already satisfied: scipy in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (1.11.2)
Requirement already satisfied: scikit-learn in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (1.3.0)
Requirement already satisfied: scikit-image in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (0.20.0)
Requirement already satisfied: easydict in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (1.10)
Requirement already satisfied: cython in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (3.0.2)
Requirement already satisfied: albumentations in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (1.3.1)
Requirement already satisfied: prettytable in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from insightface==0.7.3) (3.8.0)
Requirement already satisfied: PyYAML in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from albumentations->insightface==0.7.3) (6.0.1)
Requirement already satisfied: qudida>=0.0.4 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from albumentations->insightface==0.7.3) (0.0.4)
Requirement already satisfied: opencv-python-headless>=4.1.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from albumentations->insightface==0.7.3) (4.7.0.72)
Requirement already satisfied: networkx>=2.8 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-image->insightface==0.7.3) (3.1)
Requirement already satisfied: imageio>=2.4.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-image->insightface==0.7.3) (2.31.3)
Requirement already satisfied: tifffile>=2019.7.26 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-image->insightface==0.7.3) (2023.8.30)
Requirement already satisfied: PyWavelets>=1.1.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-image->insightface==0.7.3) (1.4.1)
Requirement already satisfied: packaging>=20.0 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-image->insightface==0.7.3) (23.1)
Requirement already satisfied: lazy_loader>=0.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-image->insightface==0.7.3) (0.3)
Requirement already satisfied: contourpy>=1.0.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->insightface==0.7.3) (1.1.0)
Requirement already satisfied: cycler>=0.10 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->insightface==0.7.3) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->insightface==0.7.3) (4.42.1)
Requirement already satisfied: kiwisolver>=1.0.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->insightface==0.7.3) (1.4.5)
Requirement already satisfied: pyparsing<3.1,>=2.3.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->insightface==0.7.3) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->insightface==0.7.3) (2.8.2)
Requirement already satisfied: protobuf>=3.20.2 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from onnx->insightface==0.7.3) (3.20.3)
Requirement already satisfied: typing-extensions>=3.6.2.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from onnx->insightface==0.7.3) (4.7.1)
Requirement already satisfied: wcwidth in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from prettytable->insightface==0.7.3) (0.2.6)
Requirement already satisfied: charset-normalizer<4,>=2 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->insightface==0.7.3) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->insightface==0.7.3) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->insightface==0.7.3) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->insightface==0.7.3) (2023.7.22)
Requirement already satisfied: joblib>=1.1.1 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-learn->insightface==0.7.3) (1.3.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from scikit-learn->insightface==0.7.3) (3.2.0)
Requirement already satisfied: colorama in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from tqdm->insightface==0.7.3) (0.4.6)
Requirement already satisfied: six>=1.5 in f:\confyui\comfyui_windows_portable\python_embeded\lib\site-packages (from python-dateutil>=2.7->matplotlib->insightface==0.7.3) (1.16.0)
insightface is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

@Winnougan
Copy link

Winnougan commented Dec 25, 2023

This solution From Reactor Trubleshoot: I. (For Windows users) If you still cannot build Insightface for some reason or just don't want to install Visual Studio or VS C++ Build Tools - do the following: (ComfyUI Portable) From the root folder check the version of Python: run CMD and type python_embeded\python.exe -V Download prebuilt Insightface package for Python 3.10 or for Python 3.11 (if in the previous step you see 3.11) and put into the stable-diffusion-webui (A1111 or SD.Next) root folder (where you have "webui-user.bat" file) or into ComfyUI root folder if you use ComfyUI Portable From the root folder run: (SD WebUI) CMD and .\venv\Scripts\activate (ComfyUI Portable) run CMD Then update your PIP: (SD WebUI) python -m pip install -U pip (ComfyUI Portable) python_embeded\python.exe -m pip install -U pip Then install Insightface: (SD WebUI) pip install insightface-0.7.3-cp310-cp310-win_amd64.whl (for 3.10) or pip install insightface-0.7.3-cp311-cp311-win_amd64.whl (for 3.11) (ComfyUI Portable) python_embeded\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl (for 3.10) or python_embeded\python.exe -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl (for 3.11) Enjoy!

I suggest uninstalling InsightFace first if exists then follow the above instructions. Good luck

I've tried that troubleshooting option too! Doesn't resolve the issue for me.
I even downloaded and updated the entire Visual Studio Installer from Microsoft (as recommended on stackoverflow thread). Re-downloaded. Re-installed. Triple checked all the names of files. Nothing. Can anyone show us how to get this working? Thx

@MMoneer
Copy link

MMoneer commented Dec 25, 2023

Please uninstall Insightface first, as the above Requirement already satisfied , it has to be a fresh installation

@Winnougan
Copy link

Please uninstall Insightface first, as the above Requirement already satisfied , it has to be a fresh installation

Doesn't work. Does it work for you? Can you share some screenshots of how you got it running?

@piakdev
Copy link

piakdev commented Dec 25, 2023

Please uninstall Insightface first, as the above Requirement already satisfied , it has to be a fresh installation

How to uninstall Insightface? I success install Insightface but also got an error from ComfyUI like @Winnougan

@Winnougan
Copy link

Please uninstall Insightface first, as the above Requirement already satisfied , it has to be a fresh installation

How to uninstall Insightface? I success install Insightface but also got an error from ComfyUI like @Winnougan

To uninstall anything using pip you type:
pip uninstall insightface

However, it's not working for me. I suspect there's something with a missing model? Or perhaps the name of the folder. I'm hoping @cubiq can share a fix for us.

@piakdev
Copy link

piakdev commented Dec 25, 2023

23_comfyUI_04

Is it right? @Winnougan

@piakdev
Copy link

piakdev commented Dec 25, 2023

23_comfyUI_05

After uninstalled. Now, I reinstall Insightface.

@piakdev
Copy link

piakdev commented Dec 25, 2023

23_comfyUI_06

Error occurred when executing InsightFaceLoader:

IPAdapter: InsightFace is not installed! Install the missing dependencies if you wish to use FaceID models.

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 459, in load_insight_face
raise Exception('IPAdapter: InsightFace is not installed! Install the missing dependencies if you wish to use FaceID models.')

@Winnougan
Copy link

23_comfyUI_04

Is it right? @Winnougan

Yes, it's correct. But, just like you, I'm continuing to run into errors. There seems to be no fix until @cubiq can resolve this for us.

@cubiq
Copy link
Owner

cubiq commented Dec 25, 2023

  • run the update bat scripts from the update directory to ensure that the latest version of comfy is installed, do not rely on the manager even if it says that everything's updated it might not be true
  • be sure to have the latest version of ipadapter extension installed
  • delete the __pycache__ directories from inside ipadapter extension and reactor if you have it... just in case
  • upgrade pip python_embeded\python.exe -m pip install -U pip
  • install insightface python_embeded\python.exe -m pip install insightface

On windows to compile insightface you need Visual Studio installed or the "Desktop Development with C++" from VS C++ Build Tools.

Alternatively you can download the pre-compiled version from here. Select the file based on your python version cp310 is for python 3.10, cp311 if for python 3.11. To know what version of python you have use: python_embeded\python.exe -V

Then you can install it with python_embeded\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl or cp311 for python 3.11.

If you have inisghtface already installed remove it with python_embeded\python.exe -m pip uninstall insightface and repeat the process.

It's not my fault that Tencent Labs chose inisghtface as provider and Insightface is such a pain.

I honestly don't remember if onnx is automatically installed, just in case you can try to also manually install onnxruntime and onnxruntime-gpu (if you want),

On a Mac I have no idea, if it's any close to linux you just have to install it with pip, be sure to activate the comfyui environment first. Note the I'm not sure it will work on a Mac anyway. Software support is not great on anything that is not Cuda.

@MMoneer
Copy link

MMoneer commented Dec 25, 2023

brave_25122023_014

I faced this problem with reactor, I did these steps:
1- uninstall numpy 1.26 and install 1.24
1- uninstall InsightFace then reinstall as reactor troubleshoot (it didn't work without the other steps) "Also you can use pip install --upgrade --force-reinstall"
3- uninstall onnx 1.15.0 onnxruntime 1.16.3 onnxruntime-gpu 1.16.3 and instal version 1.14 for all (this step helps me for reactor)
Now reactor and face-id work for me, I hope that works for you

@renzorosso
Copy link

running the update_comfyui_and_python_dependencies.bat in the update folder fixed it for me.

@nyukers
Copy link

nyukers commented Dec 25, 2023

brave_25122023_014

I faced this problem with reactor, I did these steps: 1- uninstall numpy 1.26 and install 1.24 1- uninstall InsightFace then reinstall as reactor troubleshoot (it didn't work without the other steps) "Also you can use pip install --upgrade --force-reinstall" 3- uninstall onnx 1.15.0 onnxruntime 1.16.3 onnxruntime-gpu 1.16.3 and instal version 1.14 for all (this step helps me for reactor) Now reactor and face-id work for me, I hope that works for you

I don't know, my Reactor is well done, but FaceID is failed. The new will break the good.)

@MMoneer
Copy link

MMoneer commented Dec 25, 2023

brave_25122023_014
I faced this problem with reactor, I did these steps: 1- uninstall numpy 1.26 and install 1.24 1- uninstall InsightFace then reinstall as reactor troubleshoot (it didn't work without the other steps) "Also you can use pip install --upgrade --force-reinstall" 3- uninstall onnx 1.15.0 onnxruntime 1.16.3 onnxruntime-gpu 1.16.3 and instal version 1.14 for all (this step helps me for reactor) Now reactor and face-id work for me, I hope that works for you

I don't know, my Reactor is well done, but FaceID is failed. The new will break the good.)

That is weird if the InsightFace is the issue Reactor will not work!

@2PeteShakur
Copy link

as renzorosso stated: try running the update_comfyui_and_python_dependencies.bat - it worked for them.

@DavidGdsn
Copy link

Great! Thanks to everyone who has participated in the search for a solution, and a special thanks to Matteo, who is making all of this possible, and trying to help us even a 25th of December.
For me, running the update_comfyui_and_python_dependencies.bat from the Update folder was enough to solve the problem.

@WinstonWoof
Copy link

The only way I've managed (despite following all the good advice above) to get faceID to work without ComfyUI moaning about Insight face not being installed was too.

Extract a fresh copy of ComfyUI Portable to a new folder (from a n older zip file)
carry out upgrade
Add Ipadaptors
Install InsightFace using pre compiled wheel as per above advice
Install onnxruntime using "python_embeded\python.exe -m pip install onnxruntime"

Now to put all my usual custom nodes back in and see what if anything else breaks.

This is the joy of bleeding edge, this is open source, this is the way ;o)

@Ahmet0691
Copy link

The only way I've managed (despite following all the good advice above) to get faceID to work without ComfyUI moaning about Insight face not being installed was too.

Extract a fresh copy of ComfyUI Portable to a new folder (from a n older zip file) carry out upgrade Add Ipadaptors Install InsightFace using pre compiled wheel as per above advice Install onnxruntime using "python_embeded\python.exe -m pip install onnxruntime"

Now to put all my usual custom nodes back in and see what if anything else breaks.

This is the joy of bleeding edge, this is open source, this is the way ;o)

Solved.

@pphoto808
Copy link
Author

You guys are the best Christmas present ever lol. Nice to see so many responses! Sneaked away from my wife to say thanks for the comments and suggestions. Since I'm on Mac, don't have the batch update file or folder. Is it possible for someone to attach the file (update_comfyui_and_python_dependencies.bat)? I want to maybe rewrite as a python script and try that. IF that doesn't work, then I'll try the other recommendation. Again, thanks to all!

@renzorosso
Copy link

Heres the contents of the file:

@echo off
..\python_embeded\python.exe .\update.py ..\ComfyUI
echo
echo This will try to update pytorch and all python dependencies, if you get an error wait for pytorch/xformers to fix their stuff
echo You should not be running this anyways unless you really have to
echo
echo If you just want to update normally, close this and run update_comfyui.bat instead.
echo
pause
..\python_embeded\python.exe -s -m pip install --upgrade torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 xformers -r ../ComfyUI/requirements.txt pygit2
pause

@Winnougan
Copy link

brave_25122023_014

I faced this problem with reactor, I did these steps: 1- uninstall numpy 1.26 and install 1.24 1- uninstall InsightFace then reinstall as reactor troubleshoot (it didn't work without the other steps) "Also you can use pip install --upgrade --force-reinstall" 3- uninstall onnx 1.15.0 onnxruntime 1.16.3 onnxruntime-gpu 1.16.3 and instal version 1.14 for all (this step helps me for reactor) Now reactor and face-id work for me, I hope that works for you

How do you install 1.14 with pip? I was having problems. Still can't get it to load. Tried every suggestion so far. Running on i9, RTX 4080 (so I have cudas).

Updated ComfyUI, followed every instruction. But I'd like to download onnx and the onnx runtime to 1.14 but can't figure it out.

@37OMKAR
Copy link

37OMKAR commented Jul 13, 2024

ok i have the same issue as diverted by the admin, i am totally new, so some easy lag will help , thanks

@supereth
Copy link

supereth commented Jul 24, 2024

I have done all steps mentioned by cubiq plus installed onnxruntime and onnxruntime-gpu and now comfy moans about invoking this last.

Error occurred when executing IPAdapterUnifiedLoaderFaceID:

Unable to import dependency onnxruntime.

File "D:\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 580, in load_models
self.insightface['model'] = insightface_loader(provider)
File "D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\utils.py", line 157, in insightface_loader
raise Exception(e)

on insightface installation i also get an error

WARNING: Error parsing dependencies of torchsde: .* suffix can only be used with == or != operators
numpy (>=1.19.*) ; python_version >= "3.7"
~~~~~~~^

@37OMKAR
Copy link

37OMKAR commented Jul 24, 2024

i copy pasted the logs into chat gpt and to be honest , i got it working

@supereth
Copy link

Solved the issue by ... installing Visual Studio to compile the insightface... which did not work but God knows what other stuff did cos retrying to install the precompiled wheel it went ahead (didn't before), then reinstalled onnxruntime and... voila!

/shrug

@37OMKAR
Copy link

37OMKAR commented Jul 24, 2024

Solved the issue by ... installing Visual Studio to compile the insightface... which did not work but God knows what other stuff did cos retrying to install the precompiled wheel it went ahead (didn't before), then reinstalled onnxruntime and... voila!

/shrug

yes and same chat gpt helped me, the author must now some how integrate the consle of to chatgpt sowhere as we can solve the error that are poped into the consel

@Raineyly
Copy link

执行 IPAdapterAdvanced 时发生错误:

加载 ImageProjModel 的 state_dict 时出现错误: proj.weight 的大小不匹配:从检查点复制形状为 torch.Size([8192, 1024]) 的参数,当前模型中的形状为 torch.Size([8192, 768])。

文件“D:\ComfyUI-aki-v1.1\execution.py”,第 151 行,在 recursive_execute output_data 中,output_ui = get_output_data(obj, input_data_all) 文件“D:\ComfyUI-aki-v1.1\execution.py”,第 81 行,在 get_output_data 中 return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) 文件“D:\ComfyUI-aki-v1.1\execution.py”,第 74 行,在 map_node_over_list 中 results.append(getattr(obj, func)(slice_dict(input_data_all, i))) 文件“D:\ComfyUI-aki-v1.1\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py”,第 592 行,在 apply_ipadapter 中 返回(ipadapter_execute(model.clone(),ipadapter_model,clip_vision,ipa_args),) 文件“D:\ ComfyUI-aki-v1.1 \ custom_nodes \ ComfyUI_IPAdapter_plus \ IPAdapterPlus.py”,第 279 行,在 ipadapter_execute ipa = IPAdapter( 文件“D:\ ComfyUI-aki-v1.1 \ custom_nodes \ ComfyUI_IPAdapter_plus \ IPAdapterPlus.py”,第 70 行,在init self.image_proj_model.load_state_dict(ipadapter_model [“image_proj”]) 文件“D:\ ComfyUI-aki-v1.1 \ python \ lib \ site-packages \ torch \ nn \ modules \ module.py”,第 2152 行,在 load_state_dict 中 引发 RuntimeError('在加载 state_dict 时出错{}:\n\t{}'.格式(

和你一样的情况,但是办公室电脑里面没有装plus V2,就可以正常运行,晚上回去,把V2的插件卸载了再试一下

@lior007
Copy link

lior007 commented Jul 31, 2024

This solution From Reactor Trubleshoot: I. (For Windows users) If you still cannot build Insightface for some reason or just don't want to install Visual Studio or VS C++ Build Tools - do the following: (ComfyUI Portable) From the root folder check the version of Python: run CMD and type python_embeded\python.exe -V Download prebuilt Insightface package for Python 3.10 or for Python 3.11 (if in the previous step you see 3.11) and put into the stable-diffusion-webui (A1111 or SD.Next) root folder (where you have "webui-user.bat" file) or into ComfyUI root folder if you use ComfyUI Portable From the root folder run: (SD WebUI) CMD and .\venv\Scripts\activate (ComfyUI Portable) run CMD Then update your PIP: (SD WebUI) python -m pip install -U pip (ComfyUI Portable) python_embeded\python.exe -m pip install -U pip Then install Insightface: (SD WebUI) pip install insightface-0.7.3-cp310-cp310-win_amd64.whl (for 3.10) or pip install insightface-0.7.3-cp311-cp311-win_amd64.whl (for 3.11) (ComfyUI Portable) python_embeded\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl (for 3.10) or python_embeded\python.exe -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl (for 3.11) Enjoy!

I suggest uninstalling InsightFace first if exists then follow the above instructions. Good luck

no work for me

@revaraver
Copy link

For those who have correctly installed insightface but encounter the error "insightface model is required for FaceID models," I spent over 5 hours resolving this frustrating issue, and I hope this can help others.

The problem occurs because the IPAdapter FaceID node encounters an error during operation, but the actual error originates from its preceding loader. However, the plugin misleadingly attributes the error to the IPAdapter FaceID node, which caused significant confusion and wasted at least 4.5 hours in troubleshooting.

The loader first reports an error during its operation, and this error occurs only once. The error message was something like "DLL load failed" (I don’t remember the exact wording). Subsequent errors appear in the IPAdapter FaceID and the misleading "insightface model is required for FaceID models" message. What is the "insightface model"? The "insightface model" only appears after the loader processes correctly!

The root cause of the issue was that onnx was recently updated to version 1.16.2, which caused FaceID to fail. To resolve this, you need to downgrade to version 1.16.1 (by running pip install onnx==1.16.1 in the appropriate environment/directory) and also set onnxruntime to version 1.18.1 (by running pip install onnxruntime==1.18.1).

I found that many people encounter various issues with this plugin, and it is notorious for being difficult to install on forums like ComfyUI_IPAdapter_plus. This plugin, which is highly sensitive to dependencies, oddly does not have a requirements.txt. Perhaps creating a "requirements.txt" file in the custom_nodes\ComfyUI_IPAdapter_plus folder with the following content could serve as a temporary workaround:
onnxruntime==1.18.1
onnx==1.16.1
requirements.txt

@cubiq
Copy link
Owner

cubiq commented Aug 4, 2024

glad you solved, that might help others on windows but I have the latest versions installed and it works just fine so the root of the problem is somewhere else. Maybe the python version

pip list |grep onnx
onnx                               1.16.2
onnxruntime                        1.18.1
onnxruntime-gpu                    1.18.1

@revaraver
Copy link

I tried to update and install onnx1.16.2 again, and the error reappeared:

Traceback (most recent call last):
File "D:\git\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\git\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\git\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\git\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 610, in load_models
self.insightface['model'] = insightface_loader(provider)
File "D:\git\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\utils.py", line 161, in insightface_loader
raise Exception(e)
Exception: DLL load failed while importing onnx_cpp2py_export: A dynamic link library (DLL) initialization routine failed

Then downgrading onnx to 1.16.1 solved the problem. It's strange. I tested and encountered this problem in both venv (python 3.10) and embedded (python 3.11). It's strange, but I don't plan to study it further. I just put what I encountered here:(
It may be that my CPU is too old (e5 2680 v4)

@Alezipa
Copy link

Alezipa commented Aug 8, 2024

I followed the instructions on this video and it worked, after already trying everything else. https://www.youtube.com/watch?v=vCCVxGtCyho

@HollyChoui
Copy link

我找到了一个新的解决办法,跟上面很多人一样,我也是不停地卸载、安装insightface,都没办法正常使用instantid,一直报错,最后我去到C:\Program Files\ComfyUI-aki-v1.3\models\insightface\models\antelopev2 这个文件夹内,发现“1k3d68.onnx”等5个模型文件,被包多了一层文件夹(即放在了C:\Program Files\ComfyUI-aki-v1.3\models\insightface\models\antelopev2\antelopev2 文件夹内),所以导致一直报错,我把5个模型文件放在了C:\Program Files\ComfyUI-aki-v1.3\models\insightface\models\antelopev2 这个文件夹内,就能正常使用instantid了,哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈,解决问题的感觉好爽

@Lanzrong
Copy link

Lanzrong commented Aug 14, 2024

Error occurred when executing IPAdapterInsightFaceLoader:

cannot import name 'builder' from 'google.protobuf.internal' (D:\PR\ComfyUI-aki-v1.3\python\lib\site-packages\google\protobuf\internal_init_.py)

File "D:\PR\ComfyUI-aki-v1.3\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\PR\ComfyUI-aki-v1.3\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\PR\ComfyUI-aki-v1.3\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\PR\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 674, in load_insightface
return (insightface_loader(provider, model_name=model_name),)
File "D:\PR\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_IPAdapter_plus\utils.py", line 161, in insightface_loader
raise Exception(e)


Problem with "protobuf"?

Checked, "D:\PR\ComfyUI-aki-v1.3\python\lib\site-packages\google\protobuf\internal_init_.py" is an empty file.
There's another folder:
D:\PR\ComfyUI-aki-v1.3\python\Lib\site-packages\protobuf-3.19.6.dist-info


Has anyone experienced this problem? How to solve it?

@tzktok
Copy link

tzktok commented Sep 2, 2024

python_embeded\python.exe -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl

i have installed insightface successfully..but still InsightFaceLoader and IPAdapterApplyFaceID nodes are misssing.. @MMoneer

@zengxianyang001
Copy link

For those who have correctly installed insightface but encounter the error "insightface model is required for FaceID models," I spent over 5 hours resolving this frustrating issue, and I hope this can help others.

The problem occurs because the IPAdapter FaceID node encounters an error during operation, but the actual error originates from its preceding loader. However, the plugin misleadingly attributes the error to the IPAdapter FaceID node, which caused significant confusion and wasted at least 4.5 hours in troubleshooting.

The loader first reports an error during its operation, and this error occurs only once. The error message was something like "DLL load failed" (I don’t remember the exact wording). Subsequent errors appear in the IPAdapter FaceID and the misleading "insightface model is required for FaceID models" message. What is the "insightface model"? The "insightface model" only appears after the loader processes correctly!

The root cause of the issue was that onnx was recently updated to version 1.16.2, which caused FaceID to fail. To resolve this, you need to downgrade to version 1.16.1 (by running pip install onnx==1.16.1 in the appropriate environment/directory) and also set onnxruntime to version 1.18.1 (by running pip install onnxruntime==1.18.1).

I found that many people encounter various issues with this plugin, and it is notorious for being difficult to install on forums like ComfyUI_IPAdapter_plus. This plugin, which is highly sensitive to dependencies, oddly does not have a requirements.txt. Perhaps creating a "requirements.txt" file in the custom_nodes\ComfyUI_IPAdapter_plus folder with the following content could serve as a temporary workaround: onnxruntime==1.18.1 onnx==1.16.1 requirements.txt

This is the reason why my insightface cannot be loaded. Thank you very much for your help. requirements.txt is very useful. Thank you.

@scofano
Copy link

scofano commented Sep 10, 2024

File "D:\ComfyUI_windows_portable - Copia\ComfyUI\custom_nodes\comfyui-reactor-node_init_.py", line 23, in
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "D:\ComfyUI_windows_portable - Copia\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in
from insightface.app.common import Face
File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\insightface_init_.py", line 16, in
from . import model_zoo
File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\insightface\model_zoo_init_.py", line 1, in
from .model_zoo import get_model
File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\insightface\model_zoo\model_zoo.py", line 11, in
from .arcface_onnx import *
File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\insightface\model_zoo\arcface_onnx.py", line 10, in
import onnx
File "D:\ComfyUI_windows_portable - Copia\python_embeded\Lib\site-packages\onnx_init_.py", line 77, in
from onnx.onnx_cpp2py_export import ONNX_ML
ImportError: DLL load failed while importing onnx_cpp2py_export: Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou.

@papanoyang
Copy link

papanoyang commented Sep 17, 2024

I managed to solve the problem with your comments.
Thank you all.

I installed a new ComfyUI to clarify what the problem is.
(I correctly unzipped the new ComfyUI and used it)

  1. Unzip ComfyUI
  2. Install ComfyUI Manager.
  3. Install ComfyUI_IPAdapter_pluse from Manager (do not restart ComfyUI, but quit ComfyUI)
  4. Execute the following command.
.\python_embeded\python.exe -m pip install .\insightface-0.7.3-cp311-cp311-win_amd64.whl onnxruntime
  1. at this stage I tried to use FaceID with the required models and got an error.
    I checked the onnx version and found the following.
onnx==1.16.2
onnxruntime==1.19.2
  1. uninstalling onnx
    Uninstall onnx with the following command.
.\python_embeded\python.exe -m pip uninstall onnx onnxruntime
  1. reinstall onnx with the following command
.\python_embeded\python.exe -m pip install onnx==1.16.1 onnxruntime==1.18.1

@Qiuhao-Wu
Copy link

大家有ip-adapter的requirement.txt么

@dxdpxl
Copy link

dxdpxl commented Oct 5, 2024

Just a hint for everyone getting install errors... Maybe this will help one of you too! I had nearly all the install errors listed above and you possible could find on google 🤣 and NONE of the solution provided all over the places I searched helped at ALL and I tried a LOT.

After all the struggle I tough, maybe my download is corrupted... and VOILA, that was it! First try and no install errors.

Go to https://github.com/Gourieff/Assets/tree/main/Insightface

DO NOT right click on the file name and save as! It will not download the file correctly! Instead, left click on the filename and on the right, next to "Raw" click on the down-arrow which says on hoover "Download raw file" and click this one to download the file. The file via right click "save as" was only 300+kb while the downloaded file was over 800kb... 🤷‍♂️

Good luck and have a nice one

@cives
Copy link

cives commented Oct 28, 2024

Just a hint for everyone getting install errors... Maybe this will help one of you too! I had nearly all the install errors listed above and you possible could find on google 🤣 and NONE of the solution provided all over the places I searched helped at ALL and I tried a LOT.

After all the struggle I tough, maybe my download is corrupted... and VOILA, that was it! First try and no install errors.

Go to https://github.com/Gourieff/Assets/tree/main/Insightface

DO NOT right click on the file name and save as! It will not download the file correctly! Instead, left click on the filename and on the right, next to "Raw" click on the down-arrow which says on hoover "Download raw file" and click this one to download the file. The file via right click "save as" was only 300+kb while the downloaded file was over 800kb... 🤷‍♂️

Good luck and have a nice one

That was it! Thank you.

@io-tyra
Copy link

io-tyra commented Nov 18, 2024

  • python_embeded\python.exe -m pip install insightface

still dont work plz help ! :(

PS D:\ComfyUI_windows_portable> python_embeded\python.exe -m pip install -U pip
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: pip in d:\comfyui_windows_portable\python_embeded\lib\site-packages (24.3.1)
PS D:\ComfyUI_windows_portable> python_embeded\python.exe -m pip install insightface
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting insightface
Downloading insightface-0.7.3.tar.gz (439 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
Traceback (most recent call last):
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 303, in _get_build_requires
self.run_setup()
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\setuptools\build_meta.py", line 319, in run_setup
exec(code, locals())
File "", line 11, in
ModuleNotFoundError: No module named 'Cython'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
PS D:\ComfyUI_windows_portable>

@wi-cuckoo
Copy link

pip3.10 install onnxruntime
pip3.10 install onnxruntime-gpu
pip3.10 install insightface

then restart the server, try it

@io-tyra
Copy link

io-tyra commented Nov 22, 2024

Captura de pantalla 2024-11-22 062533

:( still dont work

maybe because i have (python 3.12) ?

@rzyns
Copy link

rzyns commented Nov 22, 2024

  • python_embeded\python.exe -m pip install insightface

still dont work plz help ! :(

PS D:\ComfyUI_windows_portable> python_embeded\python.exe -m
...
ModuleNotFoundError: No module named 'Cython' [end of output]
...

I had to manually install Cython:

python_embeded\python.exe -m pip install Cython

I also had to install Python 3.12.7 (which is the version of my python_embedded\python.exe) using the full installer. You'll also need the MSVC build tools (see: deepinsight/insightface#2340 (comment))

Then, for Cython to be able to actually find the Python header files and libraries, I had to create a pydistutils.cfg file in my $HOME directory (usually C:\Users\YourUserNameHere) with the following contents (update the paths appropriately):

[build_ext]
include_dirs='C:\Program Files\Python312\include;path/to/ComfyUI_windows_portable\python_embeded\Lib\site-packages\numpy\core\include'
library_dirs='C:\Program Files\Python312\libs'

Then, python_embedded\python.exe -m pip install insightface worked for me. There has to be a better way, though... 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests