Gourieff / comfyui-reactor-node

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

Pytorch 2.5.0+cu124 and latest xformers 0.0.28.post2 seem to break Reactor node. #470

Open darebgd opened 6 days ago

darebgd commented 6 days ago

First, confirm

What happened?

After I have updated xformers and pytorch to the versions in the title, Reactor node failed to install. I consider myself pretty skilled when fixing this (rather fragile) node, but all my attempts failed this time. It was usually the onnxruntime-gpu or onnx library being too high versions, but I tried most of my tricks. At this point, I think it's simply the torch component.

Steps to reproduce the problem

Update to PyTorch 2.5.0+cu124 then xformers 0.0.28 post2 and watch it die.

Sysinfo

pip freeze of my venv:

absl-py==2.1.0 accelerate==1.0.1 addict==2.4.0 aiohappyeyeballs==2.4.3 aiohttp==3.10.10 aiosignal==1.3.1 albucore==0.0.19 albumentations==1.4.19 annotated-types==0.7.0 attrs==24.2.0 beautifulsoup4==4.12.3 certifi==2024.8.30 cffi==1.17.1 charset-normalizer==3.4.0 click==8.1.7 clip-interrogator==0.6.0 colorama==0.4.6 coloredlogs==15.0.1 contourpy==1.3.0 cryptography==43.0.3 cycler==0.12.1 Cython==3.0.11 Deprecated==1.2.14 dill==0.3.9 easydict==1.13 einops==0.8.0 eval_type_backport==0.2.0 facexlib @ file:///E:/ComfyUI/custom_nodes/CharacterFaceSwap/thirdparty/facexlib filelock==3.13.1 flatbuffers==24.3.25 fonttools==4.54.1 frozenlist==1.4.1 fsspec==2024.2.0 ftfy==6.3.0 future==1.0.0 gdown==5.2.0 gitdb==4.0.11 GitPython==3.1.43 grpcio==1.67.0 huggingface-hub==0.26.1 humanfriendly==10.0 idna==3.10 imageio==2.36.0 importlib_metadata==8.5.0 insightface @ file:///E:/ComfyUI/insightface-0.7.3-cp312-cp312-win_amd64.whl#sha256=4e58a... Jinja2==3.1.3 joblib==1.4.2 kiwisolver==1.4.7 kornia==0.7.3 kornia_rs==0.1.5 lazy_loader==0.4 llvmlite==0.43.0 lmdb==1.5.1 lpips==0.1.4 Markdown==3.7 markdown-it-py==3.0.0 MarkupSafe==2.1.5 matplotlib==3.9.2 matrix-client==0.4.0 mdurl==0.1.2 mpmath==1.3.0 multidict==6.1.0 networkx==3.2.1 numba==0.60.0 numpy==1.26.3 onnx==1.17.0 onnx2torch==1.5.15 onnxruntime==1.19.2 onnxruntime-gpu==1.19.2 open_clip_torch==2.28.0 opencv-python==4.10.0.84 opencv-python-headless==4.10.0.84 packaging==24.1 pandas==2.2.3 piexif==1.1.3 pillow==10.2.0 pipdeptree==2.23.4 platformdirs==4.3.6 prettytable==3.11.0 propcache==0.2.0 protobuf==5.28.3 psutil==6.1.0 py-cpuinfo==9.0.0 pycparser==2.22 pydantic==2.9.2 pydantic_core==2.23.4 pygit2==1.16.0 PyGithub==2.4.0 Pygments==2.18.0 PyJWT==2.9.0 PyNaCl==1.5.0 pyparsing==3.2.0 pyreadline3==3.5.4 PySocks==1.7.1 python-dateutil==2.9.0.post0 pytz==2024.2 PyYAML==6.0.2 regex==2024.9.11 requests==2.32.3 rich==13.9.2 safetensors==0.4.5 scikit-image==0.24.0 scikit-learn==1.5.2 scipy==1.14.1 seaborn==0.13.2 segment-anything==1.0 sentencepiece==0.2.0 setuptools==70.0.0 shellingham==1.5.4 simpleeval==1.0.0 six==1.16.0 smmap==5.0.1 soundfile==0.12.1 soupsieve==2.6 spandrel==0.4.0 stringzilla==3.10.5 sympy==1.13.1 tb-nightly==2.19.0a20241021 tensorboard-data-server==0.7.2 threadpoolctl==3.5.0 tifffile==2024.9.20 timm==1.0.11 tokenizers==0.20.1 tomli==2.0.2 torch==2.5.0+cu124 torchaudio==2.5.0+cu124 torchsde==0.2.6 torchvision==0.20.0+cu124 tqdm==4.66.5 trampoline==0.1.2 transformers==4.45.2 typer==0.12.5 typing_extensions==4.9.0 tzdata==2024.2 ultralytics==8.3.21 ultralytics-thop==2.0.9 urllib3==2.2.3 wcwidth==0.2.13 Werkzeug==3.0.4 wrapt==1.16.0 xformers==0.0.28.post2 yapf==0.40.2 yarl==1.16.0 zipp==3.20.2

Relevant console log

### ComfyUI Revision: 2783 [66b0961a] | Released on '2024-10-23'
Traceback (most recent call last):
  File "E:\ComfyUI\nodes.py", line 2001, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "E:\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "E:\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "E:\ComfyUI\venv\Lib\site-packages\insightface\__init__.py", line 16, in <module>
    from . import model_zoo
  File "E:\ComfyUI\venv\Lib\site-packages\insightface\model_zoo\__init__.py", line 1, in <module>
    from .model_zoo import get_model
  File "E:\ComfyUI\venv\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 11, in <module>
    from .arcface_onnx import *
  File "E:\ComfyUI\venv\Lib\site-packages\insightface\model_zoo\arcface_onnx.py", line 10, in <module>
    import onnx
  File "E:\ComfyUI\venv\Lib\site-packages\onnx\__init__.py", line 78, in <module>
    from onnx.external_data_helper import (
  File "E:\ComfyUI\venv\Lib\site-packages\onnx\external_data_helper.py", line 13, in <module>
    import onnx.onnx_cpp2py_export.checker as c_checker
ModuleNotFoundError: No module named 'onnx.onnx_cpp2py_export.checker'; 'onnx.onnx_cpp2py_export' is not a package

Cannot import E:\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: No module named 'onnx.onnx_cpp2py_export.checker'; 'onnx.onnx_cpp2py_export' is not a package

Additional information

No response

darebgd commented 6 days ago

It worked with 2.4.1 and the previous xformers version, nothing else has been tweaked.

darebgd commented 5 days ago

I am sorry for prematurely opening the bug. After a day, it seems everything works fine again. I do have an update script before I run Comfy, but no new nodes were updated. I have a handful of them - like 6-7 only (fresh install)

Also, I didn't pay attention to Comfy's version (my mistake), so it's possible they fixed something on their end. I checked the onnx library and it does have "onnx.onnx_cpp2py_export.checker" so I don't get it - maybe it was a glitch that got corrected after the restart? Anyhow, it works now with the aforementioned configuration, please close the bug.