ShmuelRonen / ComfyUI_wav2lip

A custom node for ComfyUI that allows you to perform lip-syncing on videos using the Wav2Lip model. It takes an input video and an audio file and generates a lip-synced output video.
89 stars 20 forks source link

ModuleNotFoundError: No module named 'custom_nodes.facerestore_cf' #3

Closed signorinileandro closed 4 months ago

signorinileandro commented 4 months ago

Traceback (most recent call last): File "/home/leandro/ComfyUI/nodes.py", line 1888, 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 "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/init.py", line 1, in from .wav2lip import Wav2Lip File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 15, in from .facelib.utils.face_restoration_helper import FaceRestoreHelper File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/facelib/utils/face_restoration_helper.py", line 7, in from custom_nodes.facerestore_cf.facelib.detection import init_detection_model ModuleNotFoundError: No module named 'custom_nodes.facerestore_cf'

ShmuelRonen commented 4 months ago

please git pull to the last update

signorinileandro commented 4 months ago

Already did, still showing the same error

ShmuelRonen commented 4 months ago

I upload now update for wav2lip.py please check it out for cure your error

ShmuelRonen commented 4 months ago

Try the new fix of wav2lip.py

signorinileandro commented 4 months ago

Hi! Thank you for your fast response. Did a gitpull from the custom node folder but still having the same error

ShmuelRonen commented 4 months ago

Send me the CMD log

signorinileandro commented 4 months ago
Traceback (most recent call last):
  File "/home/leandro/ComfyUI/nodes.py", line 1888, 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 "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/__init__.py", line 1, in <module>
    from .wav2lip import Wav2Lip
  File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 15, in <module>
    from .facelib.utils.face_restoration_helper import FaceRestoreHelper
  File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/facelib/utils/face_restoration_helper.py", line 7, in <module>
    from custom_nodes.facerestore_cf.facelib.detection import init_detection_model
ModuleNotFoundError: No module named 'custom_nodes.facerestore_cf'
ShmuelRonen commented 4 months ago

Also check by date if wav2lip.py indeed updated

signorinileandro commented 4 months ago

Yes it's updated

ShmuelRonen commented 4 months ago

Did you downloaded all the models and put them in the right hierarchy order

signorinileandro commented 4 months ago

Yes, did the whole process of cloning the repository, installing requirements and downloading models again. Still same error: ModuleNotFoundError: No module named 'custom_nodes.facerestore_cf'

ShmuelRonen commented 4 months ago

ok. here is an alternative version of wav2lip.py that shuld work for you. Due to github limitations I will rename it to wav2lip.txt and you will change it back to the correct name. wav2lip.txt

signorinileandro commented 4 months ago

Replacing that file is giving me this now: `Traceback (most recent call last): File "/home/leandro/ComfyUI/nodes.py", line 1879, 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 "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/init.py", line 1, in from .wav2lip import Wav2Lip File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 22, in from wav2lipnode import wav2lip ModuleNotFoundError: No module named 'wav2lip_node'

Cannot import /home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip module for custom nodes: No module named 'wav2lip_node'`

ShmuelRonen commented 4 months ago

Add path dynamic allocation to wav2lip.py please git pull

signorinileandro commented 4 months ago

Do I keep the wav2lip.py you gave me? How do I add the dynamic path allocation?

ShmuelRonen commented 4 months ago

No. just replace it with the wav2lip.py file that in the repository

signorinileandro commented 4 months ago

Traceback (most recent call last): File "/home/leandro/ComfyUI/nodes.py", line 1879, 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 "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/__init__.py", line 1, in <module> from .wav2lip import Wav2Lip File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 15, in <module> from .facelib.utils.face_restoration_helper import FaceRestoreHelper File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/facelib/utils/face_restoration_helper.py", line 7, in <module> from custom_nodes.facerestore_cf.facelib.detection import init_detection_model ModuleNotFoundError: No module named 'custom_nodes.facerestore_cf'

Still same error :cry:

ShmuelRonen commented 4 months ago

According to the log you sent I made another change in the code of wav2lip.py please update.

ShmuelRonen commented 4 months ago

New wav2lip.py please update

signorinileandro commented 4 months ago

` (base) leandro@LeandroPC:~/ComfyUI/custom_nodes/ComfyUI_wav2lip$ git pull remote: Enumerating objects: 18, done. remote: Counting objects: 100% (15/15), done. remote: Compressing objects: 100% (9/9), done. remote: Total 18 (delta 9), reused 6 (delta 6), pack-reused 3 Desempaquetando objetos: 100% (18/18), 12.27 KiB | 199.00 KiB/s, listo. Desde https://github.com/ShmuelRonen/ComfyUI_wav2lip 746db1d..5677b55 main -> origin/main Actualizando 746db1d..5677b55 Fast-forward README.md | 26 ++------------------------ wav2lip.py | 28 +++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 29 deletions(-) (base) leandro@LeandroPC:~/ComfyUI/custom_nodes/ComfyUI_wav2lip$ ^C (base) leandro@LeandroPC:~/ComfyUI/custom_nodes/ComfyUI_wav2lip$ cd ../.. (base) leandro@LeandroPC:~/ComfyUI$ python main.py Total VRAM 7966 MB, total RAM 15892 MB xformers version: 0.0.25.post1 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync VAE dtype: torch.bfloat16 Using xformers cross attention Traceback (most recent call last): File "/home/leandro/ComfyUI/nodes.py", line 1879, 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 "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/init.py", line 1, in from .wav2lip import Wav2Lip File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 15, in from .facelib.utils.face_restoration_helper import FaceRestoreHelper File "/home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip/facelib/utils/face_restoration_helper.py", line 7, in from custom_nodes.facerestore_cf.facelib.detection import init_detection_model ModuleNotFoundError: No module named 'custom_nodes.facerestore_cf'

Cannot import /home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip module for custom nodes: No module named 'custom_nodes.facerestore_cf'

Import times for custom nodes: 0.0 seconds: /home/leandro/ComfyUI/custom_nodes/websocket_image_save.py 0.0 seconds (IMPORT FAILED): /home/leandro/ComfyUI/custom_nodes/ComfyUI_wav2lip

`

ShmuelRonen commented 4 months ago

Please update to the last wv2lip.py

signorinileandro commented 4 months ago

It had an indentation error on line 218, after fixing it, it gives the same error as before

ShmuelRonen commented 4 months ago

Yes. thanks for let me know.

ShmuelRonen commented 4 months ago

I find the problem. please replace the file face_restoration_helper.py from the repository that in ComfyUI_wav2lip\facelib\utils

signorinileandro commented 4 months ago

Switched to Windows, did a clean installation I already have that file in the utils folder image

ShmuelRonen commented 4 months ago

I change 3 lines in face_restoration_helper.py. so you must replace it

signorinileandro commented 4 months ago

Still same error

ShmuelRonen commented 4 months ago

Try CTRL + F5 to refresh comfyui

ShmuelRonen commented 4 months ago

Also delete the folder pycache in ComfyUI_wav2lip\facelib\utils.

signorinileandro commented 4 months ago

I managed to make it work. I just replaced custom_nodes.facerestore_cf to custom_nodes.ComfyUI_wav2lip everywhere and it worked. I think you are missing librosa in the requirements.txt, I had to install it aswell in order to make it work

ShmuelRonen commented 4 months ago

where (in what files) are u replaced custom_nodes.facerestore_cf to custom_nodes.ComfyUI_wav2lip because I do it already?

signorinileandro commented 4 months ago

All of them. I was replacing one by one, but ComfyUI just kept giving error in all the places where custom_nodes.facerestore_cf was present

ShmuelRonen commented 4 months ago

I update now wav2lip.py and wav2lip_node.py

signorinileandro commented 4 months ago

Do u have an example workflow? Tried copying yours from the readme photo, but it gets stuck on Video Combine node

ShmuelRonen commented 4 months ago

video combine on your comfyui in out of date . git pull to the last version