Gourieff / comfyui-reactor-node

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

Import Failed. Have tried all documented solutions. #429

Closed tro2789 closed 1 month ago

tro2789 commented 1 month ago

First, confirm

What happened?

I cannot get ComfyUI to successfully import the Reactor nodes. I have read instructions carefully, following them very closely, but am unsuccessful. I previously had the nodes working, but an update broke my setup. I tried a fresh install and still cannot get the nodes to import.

Steps to reproduce the problem

  1. I had Reactor working on my system previously. I recently updated ComfyUI and Reactor stopped working.
  2. I couldn't get it running again, so I decided to start with a fresh installation of ComfyUI.
  3. The only custom nodes I have installed presently are ComfyUI Manager and Reactor.
  4. The Reactor nodes fail to import. I have followed all documented processes in the repo.
  5. My system fails to build the wheel for insightface, even though I have Visual Studio 2022 installed. I have also tried installing CS C++ Build Tools to see if that would help. It did not.
  6. Since I was unable to build the wheel even after installing the recommended tools, I followed the steps listed here: https://github.com/Gourieff/comfyui-reactor-node?tab=readme-ov-file#insightfacebuild. I downloaded the appropriate pre-built wheel and did the install.
  7. Following the steps linked above did not resolve the issue. Despite successfully installing everything, ComfyUI still does not import the nodes.
  8. My original installation was done via Stability Matrix. I tried doing the install there, as well as a separate portable ComfyUI install. Neither has worked.

Sysinfo

Ryzen 5950x RTX 4080 128GB RAM Windows 11 Pro (23H2) Firefox Only custom nodes in use are ComfyUI Manager and Reactor.

Relevant console log

[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-09-21 15:04:01.888135
** Platform: Windows
** Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
** Python executable: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\Scripts\python.exe
** ComfyUI Path: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI
** Log path: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\comfyui.log

Prestartup times for custom nodes:
   1.3 seconds: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 16376 MB, total RAM 130996 MB
pytorch version: 2.4.1+cu124
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4080 : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\web
Adding extra search path checkpoints C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\StableDiffusion
Adding extra search path vae C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\VAE
Adding extra search path loras C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Lora
Adding extra search path loras C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\LyCORIS
Adding extra search path upscale_models C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\ESRGAN
Adding extra search path upscale_models C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\RealESRGAN
Adding extra search path upscale_models C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\SwinIR
Adding extra search path embeddings C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\TextualInversion
Adding extra search path hypernetworks C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Hypernetwork
Adding extra search path controlnet C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\ControlNet
Adding extra search path controlnet C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\T2IAdapter
Adding extra search path clip C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\CLIP
Adding extra search path clip_vision C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\InvokeClipVision
Adding extra search path diffusers C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Diffusers
Adding extra search path gligen C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\GLIGEN
Adding extra search path vae_approx C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\ApproxVAE
Adding extra search path ipadapter C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\IpAdapter
Adding extra search path ipadapter C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\InvokeIpAdapters15
Adding extra search path ipadapter C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\InvokeIpAdaptersXl
Adding extra search path prompt_expansion C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\PromptExpansion
Adding extra search path ultralytics C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Ultralytics
Adding extra search path ultralytics_bbox C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Ultralytics\bbox
Adding extra search path ultralytics_segm C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Ultralytics\segm
Adding extra search path sams C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\Sams
Adding extra search path diffusion_models C:\Users\tro27\AppData\Roaming\StabilityMatrix\Models\unet
C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
### Loading: ComfyUI-Manager (V2.51)
### ComfyUI Revision: 2715 [364b69e9] | Released on '2024-09-21'
Traceback (most recent call last):
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\nodes.py", line 1994, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\insightface\__init__.py", line 18, in <module>
    from . import app
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\insightface\app\__init__.py", line 2, in <module>
    from .mask_renderer import *
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\insightface\app\mask_renderer.py", line 4, in <module>
    import albumentations as A
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\albumentations\__init__.py", line 6, in <module>
    from .augmentations import *
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\albumentations\augmentations\__init__.py", line 1, in <module>
    from .blur.functional import *
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\albumentations\augmentations\blur\__init__.py", line 1, in <module>
    from .functional import *
  File "C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\albumentations\augmentations\blur\functional.py", line 9, in <module>
    from albucore.utils import clipped, maybe_process_in_chunks, preserve_channel_dim
ImportError: cannot import name 'preserve_channel_dim' from 'albucore.utils' (C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\albucore\utils.py)

Cannot import C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: cannot import name 'preserve_channel_dim' from 'albucore.utils' (C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\lib\site-packages\albucore\utils.py)

Import times for custom nodes:
   0.0 seconds: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\websocket_image_save.py
   0.1 seconds (IMPORT FAILED): C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\comfyui-reactor-node
   0.3 seconds: C:\Users\tro27\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\custom_nodes\ComfyUI-Manager

Starting server

To see the GUI go to: http://127.0.0.1:8188
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json

Additional information

I'm assuming the issue is with Insightface given the logs, but I've followed all the recommended steps and still can't get it to work. Any ideas?

tro2789 commented 1 month ago

Additional context:

For the insightface install for stability matrix, I was working in the Data/Assets/Python310 directory as that is what was recommended when searching through the other issues here. Even though the install using a prebuilt wheel appeared to succeed, the nodes still fail to import.

For the portable install, I followed the instructions provided in the repo to the letter, starting from a completely fresh install multiple times just in case. Downloading the prebuilt wheel corresponding to the python environment being used and installing it using the methods detailed appeared to work as I was going through the process, but upon loading ComfyUI... still no luck.

tro2789 commented 1 month ago

Hah, as fate would have it, I found the solution pretty quickly after posting this. Downgrading albucore to 0.0.16 resolved my issue.

This issue is also mentioned here, it seems: https://github.com/ostris/ai-toolkit/issues/182