Gourieff / comfyui-reactor-node

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

ComfyUI ReActor node import failed : [ERROR] Failed to execute install/(de)activation script AND pydantic_core issue #407

Closed Sharknaab closed 1 month ago

Sharknaab commented 2 months ago

First, confirm

What happened?

The error I get is this when I try installing ReActor (import failed) : Capture

The error I got in the console when I try installing/fixing with manager :

#######################################################################
[ComfyUI-Manager] Starting dependency installation/(de)activation for the extension

[SKIP] Downgrading pip package isn't allowed: onnx (cur=1.16.2)
[ERROR] Failed to execute install/(de)activation script: ['D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-reactor-node', 'D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\python_embeded\\python.exe', '-m', 'pip', 'install', 'opencv-python>=4.10.0.84']
 / invalid version number '4.10.0.84'

## ComfyUI-Manager: EXECUTE => ['D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\python_embeded\\python.exe', '-m', 'pip', 'install', 'segment_anything']

## Execute install/(de)activation script for 'D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node'

## ComfyUI-Manager: EXECUTE => ['D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\python_embeded\\python.exe', 'install.py']

## Execute install/(de)activation script for 'D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node'
 CUDA 12.1
 Ok

[ComfyUI-Manager] Startup script completed.
#######################################################################

The error I get when launching comfyUI :

Traceback (most recent call last):
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1993, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\__init__.py", line 18, in <module>
    from . import app
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\__init__.py", line 2, in <module>
    from .mask_renderer import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\mask_renderer.py", line 4, in <module>
    import albumentations as A
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\__init__.py", line 6, in <module>
    from .augmentations import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\__init__.py", line 1, in <module>
    from .blur.functional import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\blur\__init__.py", line 1, in <module>
    from .functional import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\blur\functional.py", line 12, in <module>
    from albumentations.augmentations.geometric.functional import scale
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\geometric\__init__.py", line 2, in <module>
    from .resize import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\geometric\resize.py", line 7, in <module>
    from pydantic import Field, ValidationInfo, field_validator
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pydantic\__init__.py", line 404, in __getattr__
    module = import_module(module_name, package=package)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pydantic\fields.py", line 17, in <module>
    from pydantic_core import PydanticUndefined
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pydantic_core\__init__.py", line 6, in <module>
    from ._pydantic_core import (
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'

Cannot import D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: No module named 'pydantic_core._pydantic_core'

What I have tried so far and that did not work :

Steps to reproduce the problem

_

Sysinfo

Windows 10

Relevant console log

The error I got in the console when I try installing/fixing with manager : 

#######################################################################
[ComfyUI-Manager] Starting dependency installation/(de)activation for the extension

[SKIP] Downgrading pip package isn't allowed: onnx (cur=1.16.2)
[ERROR] Failed to execute install/(de)activation script: ['D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-reactor-node', 'D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\python_embeded\\python.exe', '-m', 'pip', 'install', 'opencv-python>=4.10.0.84']
 / invalid version number '4.10.0.84'

## ComfyUI-Manager: EXECUTE => ['D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\python_embeded\\python.exe', '-m', 'pip', 'install', 'segment_anything']

## Execute install/(de)activation script for 'D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node'

## ComfyUI-Manager: EXECUTE => ['D:\\Programmes\\GenerativeAI\\ComfyUI_windows_portable\\python_embeded\\python.exe', 'install.py']

## Execute install/(de)activation script for 'D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node'
 CUDA 12.1
 Ok

[ComfyUI-Manager] Startup script completed.
#######################################################################

The error I get when launching comfyUI :

Traceback (most recent call last):
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1993, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\__init__.py", line 18, in <module>
    from . import app
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\__init__.py", line 2, in <module>
    from .mask_renderer import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\mask_renderer.py", line 4, in <module>
    import albumentations as A
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\__init__.py", line 6, in <module>
    from .augmentations import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\__init__.py", line 1, in <module>
    from .blur.functional import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\blur\__init__.py", line 1, in <module>
    from .functional import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\blur\functional.py", line 12, in <module>
    from albumentations.augmentations.geometric.functional import scale
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\geometric\__init__.py", line 2, in <module>
    from .resize import *
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\albumentations\augmentations\geometric\resize.py", line 7, in <module>
    from pydantic import Field, ValidationInfo, field_validator
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pydantic\__init__.py", line 404, in __getattr__
    module = import_module(module_name, package=package)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pydantic\fields.py", line 17, in <module>
    from pydantic_core import PydanticUndefined
  File "D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pydantic_core\__init__.py", line 6, in <module>
    from ._pydantic_core import (
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'

Cannot import D:\Programmes\GenerativeAI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: No module named 'pydantic_core._pydantic_core'


### Additional information

_No response_
Gourieff commented 2 months ago

Please show D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\python.exe -m pip show pydantic_core pydantic

Sharknaab commented 2 months ago

Here you go !

Name: pydantic_core
Version: 2.20.1
Summary: Core functionality for Pydantic validation and serialization
Home-page: https://github.com/pydantic/pydantic-core
Author:
Author-email: Samuel Colvin <s@muelcolvin.com>
License: MIT
Location: D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages
Requires: typing-extensions
Required-by: pydantic
---
Name: pydantic
Version: 2.8.2
Summary: Data validation using Python type hints
Home-page: https://github.com/pydantic/pydantic
Author:
Author-email: Samuel Colvin <s@muelcolvin.com>, Eric Jolibois <em.jolibois@gmail.com>, Hasan Ramezani <hasan.r67@gmail.com>, Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>, Terrence Dorsey <terry@pydantic.dev>, David Montague <david@pydantic.dev>, Serge Matveenko <lig@countzero.co>, Marcelo Trylesinski <marcelotryle@gmail.com>, Sydney Runkle <sydneymarierunkle@gmail.com>, David Hewitt <mail@davidhewitt.io>, Alex Hall <alex.mojaki@gmail.com>
License:
Location: D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages
Requires: annotated-types, pydantic-core, typing-extensions
Required-by: albumentations, fastapi
Sharknaab commented 2 months ago

Hey again, any idea how/if I can fix this issue ?

woshitoutouge commented 1 month ago

IMPORT FAILED too, but different error:

RecursionError: maximum recursion depth exceeded

Cannot import D:\Code\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: maximum recursion depth exceeded
jeanlorencini commented 1 month ago

any idea how/if I can fix this issue ?

Gourieff commented 1 month ago

Here you go !

Name: pydantic_core
Version: 2.20.1
Summary: Core functionality for Pydantic validation and serialization
Home-page: https://github.com/pydantic/pydantic-core
Author:
Author-email: Samuel Colvin <s@muelcolvin.com>
License: MIT
Location: D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages
Requires: typing-extensions
Required-by: pydantic
---
Name: pydantic
Version: 2.8.2
Summary: Data validation using Python type hints
Home-page: https://github.com/pydantic/pydantic
Author:
Author-email: Samuel Colvin <s@muelcolvin.com>, Eric Jolibois <em.jolibois@gmail.com>, Hasan Ramezani <hasan.r67@gmail.com>, Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>, Terrence Dorsey <terry@pydantic.dev>, David Montague <david@pydantic.dev>, Serge Matveenko <lig@countzero.co>, Marcelo Trylesinski <marcelotryle@gmail.com>, Sydney Runkle <sydneymarierunkle@gmail.com>, David Hewitt <mail@davidhewitt.io>, Alex Hall <alex.mojaki@gmail.com>
License:
Location: D:\Programmes\GenerativeAI\ComfyUI_windows_portable\python_embeded\Lib\site-packages
Requires: annotated-types, pydantic-core, typing-extensions
Required-by: albumentations, fastapi

Try to downgrade pydantic:

python_embeded\python.exe -m pip uninstall pydantic pydantic_core

python_embeded\python.exe -m pip install pydantic==2.7.2 pydantic_core==2.18.3
Sharknaab commented 1 month ago

Perfect that solved the issue right away!! thanks a lot :)