shiimizu / ComfyUI-PhotoMaker-Plus

PhotoMaker for ComfyUI
GNU General Public License v3.0
208 stars 21 forks source link

Having Issue with installation on Insightface Package #34

Closed jimweaver closed 1 week ago

jimweaver commented 1 month ago

Shiimizu, I'm facing this issue hopefully you can figure this out.

(IMPORT FAILED): C:\Art and Media\Data\Packages\ComfyUI\custom_nodes\ComfyUI-PhotoMaker-Plus

Message from console:

Loading: ComfyUI-Manager (V2.48.1) ComfyUI Revision: 2474 [2d75df45] | Released on '2024-08-05' Traceback (most recent call last): File "C:\Art and Media\Data\Packages\ComfyUI\nodes.py", line 1941, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Art and Media\Data\Packages\ComfyUI\custom_nodes\ComfyUI-PhotoMaker-Plus__init__.py", line 1, in from .photomaker import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "C:\Art and Media\Data\Packages\ComfyUI\custom_nodes\ComfyUI-PhotoMaker-Plus\photomaker.py", line 20, in from .insightface_package import FaceAnalysis2, analyze_faces, insightface_loader File "C:\Art and Media\Data\Packages\ComfyUI\custom_nodes\ComfyUI-PhotoMaker-Plus\insightface_package.py", line 3, in from insightface import FaceAnalysis ModuleNotFoundError: No module named 'insightface' Cannot import C:\Art and Media\Data\Packages\ComfyUI\custom_nodes\ComfyUI-PhotoMaker-Plus module for custom nodes: No module named 'insightface'

From cmd:

pip check pydantic confection 0.0.4 has requirement pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4, but you have pydantic 2.7.0. spacy 3.4.4 has requirement pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4, but you have pydantic 2.7.0. thinc 8.1.9 has requirement pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4, but you have pydantic 2.7.0.

jimweaver commented 1 month ago

pip check insightface confection 0.0.4 has requirement pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4, but you have pydantic 2.7.0. spacy 3.4.4 has requirement pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4, but you have pydantic 2.7.0. thinc 8.1.9 has requirement pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4, but you have pydantic 2.7.0.

shiimizu commented 1 month ago

Did you run

pip install -U insightface
jimweaver commented 1 month ago

Yeah, I already did. The version I have installed is 0.7.3.

shiimizu commented 1 month ago

It seems like many people have this issue[^1] [^2] [^3]. Make sure you use the python that runs ComfyUI. So, something like python_embeded\python.exe -m pip install -U insightface

[^1]: Dependencies missing for Insightface · Issue #162 · cubiq/ComfyUI_IPAdapter_plus (github.com)

[^2]: Installing Insightface : r/comfyui (reddit.com)

[^3]: Installing insightface... : r/comfyui (reddit.com)

There are also prebuilt packages so you don’t have to build it yourself:

instructions from the reactor node.

Instructions from a reddit user:

From the ComfyUI root folder (where you have "webui-user.bat" file) check the version of Python aka run CMD and type "python_embeded\python.exe -V"

jimweaver commented 1 month ago

I'm using a launcher called Stability Matrix as a manager for ComfyUI. I'll go ahead and try to install insightface again.

jimweaver commented 1 month ago

Problem solved! I guess the Stability Matrix has it own python 3.10 env.

I have follow the https://github.com/Gourieff/comfyui-reactor-node#i-for-windows-users-if-you-still-cannot-build-insightface-for-some-reasons-or-just-dont-want-to-install-visual-studio-or-vs-c-build-tools---do-the-following and downloaded prebuilt Insightface package into ComfyUI root folder in .venv/script through CMD

  • python.exe -m pip install insightface

Finally, Stable Matrix is able to find insightface and install ComfyUI-PhotoMaker-Plus.