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 · 147 comments
Open

Dependencies missing for Insightface #162

pphoto808 opened this issue Dec 25, 2023 · 147 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.

@MrsHorrid
Copy link

MrsHorrid commented Apr 30, 2024

okay so i solved it... heres what i did .
install comfy manually its easier than it looks first clone the comfyui git repo
then in the comfyui folder make sure you create a venv with python 3.10 like so : C:\Users\youruser\AppData\Local\Programs\Python\Python310\python.exe -m venv venv

then you activate the venv with this command : venv\Scripts\activate.ps1

then install torch nightly : pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121

then install onnxruntime : pip install onnxruntime

after that install the requirements : pip install -r requirements.txt

then install the python 3.10 wheel of insight face

after that launch comfyui by writing python.exe main.py and pressing enter

you can also make a webui.bat file . to do so make a text file and call it webui

paste this in it :
@echo off
REM Activate the virtual environment
call venv\Scripts\activate.bat

REM Run the Python script
python main.py

REM Keep the command window open after running the script (useful for seeing output or errors)
pause

then save and exit. change the text file extention to .bat and click yes

test comfyui is working well

after that install the ipadpater plus repo manually by git cloning it to the custom nodes folder

everything should work from here hope this helps

@dcollaoa
Copy link

dcollaoa commented May 1, 2024

Well this is the last Runpod.io config what I'm using:
REMEMBER TO PUT YOUR TOKEN FOR CIVITAI DOWNLOADING 👍

#!/bin/bash
mkdir /workspace/ComfyUI/models/ipadapter/

DEST_DIR_CLIP_VISION="/workspace/ComfyUI/models/clip_vision/"
DEST_DIR_VAE="/workspace/ComfyUI/models/vae"
DEST_DIR_IP_ADAPTER="/workspace/ComfyUI/models/ipadapter/"
DEST_DIR_LORAS="/workspace/ComfyUI/models/loras/"
DEST_DIR_UPSCALE="/workspace/ComfyUI/models/upscale_models/"
DEST_DIR_CHECKPOINTS="/workspace/ComfyUI/models/checkpoints/"
DEST_DIR_CONTROLNET="/workspace/ComfyUI/models/controlnet/"

#CLIP_VISION
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/image_encoder/model.safetensors --output-document=CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors && mv CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors "$DEST_DIR_CLIP_VISION"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/image_encoder/model.safetensors --output-document=CLIP-ViT-bigG-14-laion2B-39B-b160k.safetensors && mv CLIP-ViT-bigG-14-laion2B-39B-b160k.safetensors "$DEST_DIR_CLIP_VISION"
wget https://huggingface.co/comfyanonymous/clip_vision_g/resolve/main/clip_vision_g.safetensors --output-document=clip_vision_g.safetensors && mv clip_vision_g.safetensors "$DEST_DIR_CLIP_VISION"

#IPADAPTER
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15.safetensors --output-document=ip-adapter_sd15.safetensors && mv ip-adapter_sd15.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15_light_v11.bin --output-document=ip-adapter_sd15_light_v11.bin && mv ip-adapter_sd15_light_v11.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-plus_sd15.safetensors --output-document=ip-adapter-plus_sd15.safetensors && mv ip-adapter-plus_sd15.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-plus-face_sd15.safetensors --output-document=ip-adapter-plus-face_sd15.safetensors && mv ip-adapter-plus-face_sd15.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-full-face_sd15.safetensors --output-document=ip-adapter-full-face_sd15.safetensors && mv ip-adapter-full-face_sd15.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15_vit-G.safetensors --output-document=ip-adapter_sd15_vit-G.safetensors && mv ip-adapter_sd15_vit-G.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter_sdxl_vit-h.safetensors --output-document=ip-adapter_sdxl_vit-h.safetensors && mv ip-adapter_sdxl_vit-h.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter-plus_sdxl_vit-h.safetensors --output-document=ip-adapter-plus_sdxl_vit-h.safetensors && mv ip-adapter-plus_sdxl_vit-h.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter-plus-face_sdxl_vit-h.safetensors --output-document=ip-adapter-plus-face_sdxl_vit-h.safetensors && mv ip-adapter-plus-face_sdxl_vit-h.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter_sdxl.safetensors --output-document=ip-adapter_sdxl.safetensors && mv ip-adapter_sdxl.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15_light.safetensors --output-document=ip-adapter_sd15_light.safetensors && mv ip-adapter_sd15_light.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sd15.bin --output-document=ip-adapter-faceid_sd15.bin && mv ip-adapter-faceid_sd15.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sd15.bin --output-document=ip-adapter-faceid-plusv2_sd15.bin && mv ip-adapter-faceid-plusv2_sd15.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-portrait-v11_sd15.bin --output-document=ip-adapter-faceid-portrait-v11_sd15.bin && mv ip-adapter-faceid-portrait-v11_sd15.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sdxl.bin --output-document=ip-adapter-faceid_sdxl.bin && mv ip-adapter-faceid_sdxl.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sdxl.bin --output-document=ip-adapter-faceid-plusv2_sdxl.bin && mv ip-adapter-faceid-plusv2_sdxl.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-portrait_sdxl.bin --output-document=ip-adapter-faceid-portrait_sdxl.bin && mv ip-adapter-faceid-portrait_sdxl.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-portrait_sdxl_unnorm.bin --output-document=ip-adapter-faceid-portrait_sdxl_unnorm.bin && mv ip-adapter-faceid-portrait_sdxl_unnorm.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plus_sd15.bin --output-document=ip-adapter-faceid-plus_sd15.bin && mv ip-adapter-faceid-plus_sd15.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-portrait_sd15.bin --output-document=ip-adapter-faceid-portrait_sd15.bin && mv ip-adapter-faceid-portrait_sd15.bin "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/ostris/ip-composition-adapter/resolve/main/ip_plus_composition_sd15.safetensors --output-document=ip_plus_composition_sd15.safetensors && mv ip_plus_composition_sd15.safetensors "$DEST_DIR_IP_ADAPTER"
wget https://huggingface.co/ostris/ip-composition-adapter/resolve/main/ip_plus_composition_sdxl.safetensors --output-document=ip_plus_composition_sdxl.safetensors && mv ip_plus_composition_sdxl.safetensors "$DEST_DIR_IP_ADAPTER"

#LORAS
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sd15_lora.safetensors --output-document=ip-adapter-faceid_sd15_lora.safetensors && mv ip-adapter-faceid_sd15_lora.safetensors "$DEST_DIR_LORAS"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sd15_lora.safetensors --output-document=ip-adapter-faceid-plusv2_sd15_lora.safetensors && mv ip-adapter-faceid-plusv2_sd15_lora.safetensors "$DEST_DIR_LORAS"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sdxl_lora.safetensors --output-document=ip-adapter-faceid_sdxl_lora.safetensors && mv ip-adapter-faceid_sdxl_lora.safetensors "$DEST_DIR_LORAS"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sdxl_lora.safetensors --output-document=ip-adapter-faceid-plusv2_sdxl_lora.safetensors && mv ip-adapter-faceid-plusv2_sdxl_lora.safetensors "$DEST_DIR_LORAS"
wget https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plus_sd15_lora.safetensors --output-document=ip-adapter-faceid-plus_sd15_lora.safetensors && mv ip-adapter-faceid-plus_sd15_lora.safetensors "$DEST_DIR_LORAS"
wget https://huggingface.co/wangfuyun/AnimateLCM/resolve/main/AnimateLCM_sd15_t2v_lora.safetensors --output-document=AnimateLCM_sd15_t2v_lora.safetensors && mv AnimateLCM_sd15_t2v_lora.safetensors "$DEST_DIR_LORAS"
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v3_sd15_adapter.ckpt --output-document=v3_sd15_adapter.ckpt && mv v3_sd15_adapter.ckpt "$DEST_DIR_LORAS"
wget "https://civitai.com/api/download/models/110428?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/6244?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition

#UPSCALE_METHODS
wget "https://civitai.com/api/download/models/156841?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/357054?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget https://huggingface.co/Akumetsu971/SD_Anime_Futuristic_Armor/resolve/main/4x_NMKD-Siax_200k.pth --output-document=4x_NMKD-Siax_200k.pth && mv 4x_NMKD-Siax_200k.pth "$DEST_DIR_UPSCALE"

#CHECKPOINTS
wget https://huggingface.co/Eata/SD1.5/resolve/main/020.realisticVisionV51_v51VAE.safetensors --output-document=020.realisticVisionV51_v51VAE.safetensors && mv 020.realisticVisionV51_v51VAE.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/b6734996c5ee586fa4d7cae9a5bab1406df0521a/juggernautXL_v8Rundiffusion.safetensors --output-document=juggernautXL_v8Rundiffusion.safetensors && mv juggernautXL_v8Rundiffusion.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/AOM3A1B_orangemixs.safetensors --output-document=AOM3A1B_orangemixs.safetensors && mv AOM3A1B_orangemixs.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/DreamShaper_8_pruned.safetensors --output-document=DreamShaper_8_pruned.safetensors && mv DreamShaper_8_pruned.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors --output-document=SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors && mv SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/animaPencilXL_v100.safetensors --output-document=animaPencilXL_v100.safetensors && mv animaPencilXL_v100.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/animaPencilXL_v200.safetensors --output-document=animaPencilXL_v200.safetensors && mv animaPencilXL_v200.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/bluePencilXL_v050.safetensors --output-document=bluePencilXL_v050.safetensors && mv bluePencilXL_v050.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/control_v11p_sd15_canny_fp16.safetensors --output-document=control_v11p_sd15_canny_fp16.safetensors && mv control_v11p_sd15_canny_fp16.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/juggernautXL_version6Rundiffusion.safetensors --output-document=juggernautXL_version6Rundiffusion.safetensors && mv juggernautXL_version6Rundiffusion.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/realisticStockPhoto_v10.safetensors --output-document=realisticStockPhoto_v10.safetensors && mv realisticStockPhoto_v10.safetensors "$DEST_DIR_CHECKPOINTS"
wget https://huggingface.co/JCTN/fav_models/resolve/main/realisticStockPhoto_v20.safetensors --output-document=realisticStockPhoto_v20.safetensors && mv realisticStockPhoto_v20.safetensors "$DEST_DIR_CHECKPOINTS"
wget "https://civitai.com/api/download/models/178879?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/159987?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/461550?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/158155?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/405367?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/370565?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/64563?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition
wget "https://civitai.com/api/download/models/272376?token=ed96a7914YOURTOKEN65d6de1b7" --content-disposition

#CONTROLNET
wget https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose.pth --output-document=control_v11p_sd15_openpose.pth && mv control_v11p_sd15_openpose.pth "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/crishhh/animatediff_controlnet/resolve/main/controlnet_checkpoint.ckpt --output-document=controlnet_checkpoint.ckpt && mv controlnet_checkpoint.ckpt "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/crishhh/animatediff_controlnet/resolve/main/motion_checkpoint_less_motion.ckpt --output-document=motion_checkpoint_less_motion.ckpt && mv motion_checkpoint_less_motion.ckpt "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/crishhh/animatediff_controlnet/resolve/main/motion_checkpoint_more_motion.ckpt --output-document=motion_checkpoint_more_motion.ckpt && mv motion_checkpoint_more_motion.ckpt "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/diffusion_pytorch_model.safetensors --output-document=control_v11f1p_sd15_depth.safetensors && mv control_v11f1p_sd15_depth.safetensors "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors --output-document=control_v11p_sd15_openpose_fp16.safetensors && mv control_v11p_sd15_openpose_fp16.safetensors "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors --output-document=control_v11f1p_sd15_depth_fp16.safetensors && mv control_v11f1p_sd15_depth_fp16.safetensors "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/ioclab/LooseControl_WebUICombine/resolve/main/control_boxdepth_LooseControlfp16.safetensors --output-document=control_boxdepth_LooseControlfp16.safetensors && mv control_boxdepth_LooseControlfp16.safetensors "$DEST_DIR_CONTROLNET"
wget https://huggingface.co/monster-labs/control_v1p_sd15_qrcode_monster/resolve/main/control_v1p_sd15_qrcode_monster.safetensors --output-document=control_v1p_sd15_qrcode_monster.safetensors && mv control_v1p_sd15_qrcode_monster.safetensors "$DEST_DIR_CONTROLNET"

#VAE
wget https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt --output-document=vae-ft-mse-840000-ema-pruned.ckpt && mv vae-ft-mse-840000-ema-pruned.ckpt "$DEST_DIR_VAE"

#CUSTOM_NODES
cd /workspace
python -m venv venv
source venv/bin/activate
cd ComfyUI/
ls
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
git pull
cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git
git clone https://github.com/dezi-ai/ComfyUI-AnimateLCM.git
git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git
git clone https://github.com/rgthree/rgthree-comfy.git

cd /workspace/ComfyUI/custom_nodes/ComfyUI-AnimateLCM/models/
wget https://huggingface.co/wangfuyun/AnimateLCM/resolve/main/AnimateLCM_sd15_t2v.ckpt --output-document=AnimateLCM_sd15_t2v.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v3_sd15_mm.ckpt --output-document=v3_sd15_mm.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/mm_sd_v14.ckpt --output-document=mm_sd_v14.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/mm_sd_v15.ckpt --output-document=mm_sd_v15.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/mm_sd_v15_v2.ckpt --output-document=mm_sd_v15_v2.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/mm_sdxl_v10_beta.ckpt --output-document=mm_sdxl_v10_beta.ckpt
wget https://huggingface.co/manshoety/AD_Stabilized_Motion/resolve/main/mm-Stabilized_high.pth --output-document=mm-Stabilized_high.pth
wget https://huggingface.co/manshoety/AD_Stabilized_Motion/resolve/main/mm-Stabilized_mid.pth --output-document=mm-Stabilized_mid.pth
wget https://huggingface.co/manshoety/beta_testing_models/resolve/main/mm-p_0.5.pth --output-document=mm-p_0.5.pth
wget https://huggingface.co/manshoety/beta_testing_models/resolve/main/mm-p_0.75.pth --output-document=mm-p_0.75.pth
wget https://huggingface.co/CiaraRowles/TemporalDiff/resolve/main/temporaldiff-v1-animatediff.ckpt --output-document=temporaldiff-v1-animatediff.ckpt
wget https://huggingface.co/CiaraRowles/TemporalDiff/resolve/main/temporaldiff-v1-animatediff.safetensors --output-document=temporaldiff-v1-animatediff.safetensors

cd /workspace/ComfyUI/custom_nodes/ComfyUI-AnimateLCM/motion_lora/
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_PanLeft.ckpt --output-document=v2_lora_PanLeft.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_PanRight.ckpt --output-document=v2_lora_PanRight.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_RollingAnticlockwise.ckpt --output-document=v2_lora_RollingAnticlockwise.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_RollingClockwise.ckpt --output-document=v2_lora_RollingClockwise.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_TiltDown.ckpt --output-document=v2_lora_TiltDown.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_TiltUp.ckpt --output-document=v2_lora_TiltUp.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_ZoomIn.ckpt --output-document=v2_lora_ZoomIn.ckpt
wget https://huggingface.co/guoyww/animatediff/resolve/cd71ae134a27ec6008b968d6419952b0c0494cf2/v2_lora_ZoomOut.ckpt --output-document=v2_lora_ZoomOut.ckpt

python -m pip install -U pip
apt-get install -y build-essential
pip install onnxruntime onnxruntime-gpu insightface
pip install diffusers==0.26.3
pip install transformers==4.38.1
pip install accelerate==0.27.2

Works very well... :) I hope help you guys... it take a lot of time to download all this resources X_O

@DarqueLilly
Copy link

chrome_kYFwzud4iv

I'm getting this error message every time I run this simple jason file
FaceidSimpleFlow.json

I have tried EVERYTHING LISTED UNDER THIS ISSUE THREAD INCLUDING CLEAN INSTALL!!!!! all im asking is if someone fixed this EXACT error issue. Please help me!!!

@Dheeraj2002
Copy link

Dheeraj2002 commented May 8, 2024

@DarqueLilly, Getting the same. Tried the following code
from insighface import FaceAnalysis
insightface = FaceAnalysis(....)

on 182nd line. Didn't work?
Did you found any?

@DarqueLilly
Copy link

@Dheeraj2002 can you explain what ( .py file in what folder ) to edit that line on, Ill try it later today and see if it fixes the issue. I haven't came across that solution.

@sando23
Copy link

sando23 commented May 13, 2024

help, how can I install it in forge?

@AdvertiserM
Copy link

Can someone help me with this issue?
image
I swear it works sometimes then suddenly I reopen comfy and it's reset like I erased all memories of fixing it

@corintho
Copy link

hjx, i use comfyui in Matrix. it't dont folder "python_embeded". can i install insightface where is it? thanks.

For those who are using Matrix, download the pre-compiled wheel linked in the first few comments (at the time of writing, you needed the python 3.10 version).
Go to your "packages", and click on the 3 dots on the top right corner of the package you want to install it. I did it for ComfyUI, but it should also work for A1111.
Click on the "Python packages" option.
Click on the "+" icon on the top left
As the parameter for the install, fill in the full path of the wheel file that was downloaded earlier between quotes, and add "onnxruntime".
Restart your installation and it should be working.

Tested on Windows, Python 3.10 and ComfyUI

@RustieDev
Copy link

Hi guys, sorry i know im beating a dead horse here in this conversion but ive tried everything listed in this thread but still have this error message.

image

I tried using the wheel, ive uninstalled onnxruntime/insightface. Re-installed onnxruntime gpu. I've tried downloading it in the manager. I have visual studio etc. I have python 3.11 and running on windows 10. Ive also done a fresh install of comfyui and done all of the above all over again. I'm super lost. I managed to get it running fine on stable diffusion forge a long time ago.

I feel like the issue must be something about how insightface is called in comfyui's ipadater faceid but i'm not that technically literate enough to understand.

@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

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