Gourieff / comfyui-reactor-node

Fast and Simple Face Swap Extension Node for ComfyUI
GNU General Public License v3.0
1.6k stars 157 forks source link

[SOLVED] IMPORT FAILED #25

Closed Trobinou closed 1 year ago

Trobinou commented 1 year ago

The installation is trouble-free from the Manager, and the model inswapper_128.onnx is downloaded correctly. When launching ComfyUI, I get the following error message in the console: 'Import Failed'. I have no other error messages, and, of course, the Reactor node is not available. I've had this problem since I first tried to install it over a week ago. I waited for yesterday's update before uninstalling and reinstalling it, but the result is the same. What information would you need to find a solution?

Gourieff commented 1 year ago

Show please your Console log What other nodes do you have enabled?

Trobinou commented 1 year ago

Here are the other nodes: 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SDXLAspectRatio.py 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\recommended_res_calc.py 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Camera_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\theme_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\subject_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\depth_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Composition_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lighting_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Mood_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\sdxl_prompt_styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Filter_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\sdxl-recommended-res-calc 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Focus_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUi_NNLatentUpscale 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui-main 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\stability-ComfyUI-nodes-master 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Environment_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyI2I 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Time_of_Day_Styler 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Bmad-DirtyUndoRedo 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\wlsh_nodes-main 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\sdxl_model_merging.py 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_NestedNodeBuilder 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\IPAdapter-ComfyUI 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyMath 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\images-grid-comfy-plugin-main 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\OneButtonPrompt 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\failfast-comfyui-extensions 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Derfuu_ComfyUI_ModdedNodes 0.0 seconds (IMPORT FAILED): D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_JPS-Nodes 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\facerestore 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL 0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\clipseg.py 0.3 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 0.3 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes 0.3 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui 0.4 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors 0.7 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui 0.8 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack

Gourieff commented 1 year ago

According to this Issue https://github.com/Gourieff/comfyui-reactor-node/issues/24 "was-node-suite-comfyui" can cause the dependencies conflict You can try this solution: https://github.com/Gourieff/comfyui-reactor-node/issues/24#issuecomment-1715007582

Trobinou commented 1 year ago

Thank you very much, I'll look into it.

Trobinou commented 1 year ago

I installed opencv-python==4.7.0.72 as indicated. The installation seems to have gone well:

_D:\ComfyUI_windows_portable\python_embeded>python.exe -m pip install opencv-python==4.7.0.72 Collecting opencv-python==4.7.0.72 Using cached opencv_python-4.7.0.72-cp37-abi3-win_amd64.whl (38.2 MB) Requirement already satisfied: numpy>=1.21.2 in d:\comfyui_windows_portable\pythonembeded\lib\site-packages (from opencv-python==4.7.0.72) (1.23.5) Installing collected packages: opencv-python Attempting uninstall: opencv-python Found existing installation: opencv-python 4.8.0.74 Uninstalling opencv-python-4.8.0.74: Successfully uninstalled opencv-python-4.8.0.74 Successfully installed opencv-python-4.7.0.72

Unfortunately, Reactor still doesn't work. I don't know if this helps, but here are the messages I get in the console:

_Traceback (most recent call last): File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1725, 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 "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node__init__.py", line 24, in from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 3, in from scripts.reactor_faceswap import FaceSwapScript, get_models File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 12, in from scripts.reactor_swapper import swap_face File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactorswapper.py", line 10, in import insightface ModuleNotFoundError: No module named 'insightface'

Gourieff commented 1 year ago

ModuleNotFoundError: No module named 'insightface'

This is the reason Probably you have no VS 2022 or VS C++ Build Tools in your OS Insightface cannot be built without C++ Build Tools

But you can install pre-built package by following these steps: 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

Trobinou commented 1 year ago

Fantastic, everything works! Thank you so much for your help and patience :)

Gourieff commented 1 year ago

You're welcome! Glad to help

chieeo commented 6 months ago

0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\PowerNoiseSuite 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\images-grid-comfy-plugin 0.0 seconds (IMPORT FAILED): C:\ComfyUI-aki-v1.3\custom_nodes\rgthree-comfy 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_experiments 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-layerdiffuse 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Advanced-ControlNet 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_UltimateSDUpscale 0.0 seconds (IMPORT FAILED): C:\ComfyUI-aki-v1.3\custom_nodes\efficiency-nodes-comfyui 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-AnimateDiff-Evolved 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\Derfuu_ComfyUI_ModdedNodes 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Custom-Scripts 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Marigold 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\comfyui-workspace-manager 0.0 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_Comfyroll_CustomNodes 0.1 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_tinyterraNodes 0.1 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Inspire-Pack 0.2 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-KJNodes 0.2 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\facerestore_cf 0.4 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_FizzNodes 0.5 seconds (IMPORT FAILED): C:\ComfyUI-aki-v1.3\custom_nodes\comfyui-reactor-node 0.6 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-InstantID 0.6 seconds: C:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Manager