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.
53 stars 10 forks source link

Import Failed #20

Closed mike-rowley closed 1 month ago

mike-rowley commented 1 month ago

I am getting the following error in the ComfyUI log when it loads:

Base directory: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip Checkpoints path: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/Wav2Lip/checkpoints Model path: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/Wav2Lip/checkpoints/wav2lip_gan.pth Wav2Lip path added to sys.path: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip Directory created or exists: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/facedetection Current directory: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip Wav2Lip path: /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip Traceback (most recent call last): File "/mnt/wf/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 "/mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/init.py", line 1, in from .wav2lip import Wav2Lip File "/mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 56, in from wav2lipnode import wav2lip ModuleNotFoundError: No module named 'wav2lip_node'

Cannot import /mnt/wf/ComfyUI/custom_nodes/ComfyUI_wav2lip module for custom nodes: No module named 'wav2lip_node'

Any suggestions? I looked through existing Issues and nothing seemed to match.

ShmuelRonen commented 1 month ago

It looks like the code can't find wav2lip_node.py in ComfyUI_wav2lip\Wav2lip. Since this node works well for many users, it's maybe a Linux problem. perhaps use in capital letter 'Wav2lip'

try to change the name of this directory to wav2lip and make a little change in wav2lip.py in line 48

from:

print(f"Wav2Lip path added to sys.path: {wav2lip_path}")

to:

print(f"wav2Lip path added to sys.path: {wav2lip_path}")

mike-rowley commented 1 month ago

I have reinstalled via the Manager and manually through a git pull with the same result.

I can't see how changing the string in a printf statement alters the code execution, it will just change the text in the comfy execution console

mike-rowley commented 1 month ago

Ah I understand, change the directory and not the code. And yes that resolves the issue. The capitol letters on Linux were the issue. Thanks for the assistance, I am assuming you will change this in the code base in the future?

ShmuelRonen commented 1 month ago

It's bigger than that. I make the change and put it in the repository.

ShmuelRonen commented 1 month ago

ok. I give you a test to check if it's will work for you on Linux.

  1. change the name of to folder Wav2lip to wav2lip.
  2. change the name of this code from wav2lip.txt to wav2lip.py and replace the old file with the new one: wav2lip.txt
  3. in the folder wav2lip replace this file after you change from .txt to .py: wav2lip_node.txt
  4. Restart ComfyUI

Let me know if it works for you.

mike-rowley commented 1 month ago

I made the 3 changes and Import Failed with this error:

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

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

ShmuelRonen commented 1 month ago

I continue to look at it. In the meantime you can run it on ComfyUI on Windows if you have it.

Uemuet commented 1 month ago

i tried your files for fix and now i get this

Wav2Lip path added to sys.path: /content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip Traceback (most recent call last): File "/content/drive/MyDrive/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 "/content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip/init.py", line 1, in from .wav2lip import Wav2Lip File "/content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 15, in from .facelib.utils.face_restoration_helper import FaceRestoreHelper File "/content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip/facelib/utils/face_restoration_helper.py", line 7, in from custom_nodes.ComfyUI_wav2lip.facelib.detection import init_detection_model File "/content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip/init.py", line 1, in from .wav2lip import Wav2Lip File "/content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip/wav2lip.py", line 50, in from .basicsr.utils.registry import ARCH_REGISTRY ModuleNotFoundError: No module named 'custom_nodes.ComfyUI_wav2lip.basicsr'

Cannot import /content/drive/MyDrive/ComfyUI/custom_nodes/ComfyUI_wav2lip module for custom nodes: No module named 'custom_nodes.ComfyUI_wav2lip.basicsr'

ShmuelRonen commented 1 month ago

The folder 'basicsr' in path 'custom_nodes.ComfyUI_wav2lip.basicsr' not exist anymore!

It's looks like you use old version of ComfyUI_wav2lip or some other mismatch

simonjaq commented 1 month ago

Hi @ShmuelRonen I have the exact same issue on Ubuntu. Also tried your fix above and getting the same 'ModuleNotFoundError: No module named 'custom_nodes.ComfyUI_wav2lip.basicsr'' error. Looks like a super useful node and would be great to get it to run.

Uemuet commented 1 month ago

The folder 'basicsr' in path 'custom_nodes.ComfyUI_wav2lip.basicsr' not exist anymore!

It's looks like you use old version of ComfyUI_wav2lip or some other mismatch

I have the newest comfyui version

ShmuelRonen commented 1 month ago

The folder 'basicsr' in path 'custom_nodes.ComfyUI_wav2lip.basicsr' not exist anymore! It's looks like you use old version of ComfyUI_wav2lip or some other mismatch

I have the newest comfyui version

ComfyUI_wav2lip latest version

ksenia-portu commented 1 month ago

I have got the same error on linux ( on NixOS)

    from wav2lip_node import wav2lip_
ModuleNotFoundError: No module named 'wav2lip_node'

The comfyui and your node are latest version

ShmuelRonen commented 1 month ago

I have got the same error on linux ( on NixOS)

    from wav2lip_node import wav2lip_
ModuleNotFoundError: No module named 'wav2lip_node'

The comfyui and your node are latest version

The wav2lip node is not compatible with Linux ComfyUI. sorry for that.

ksenia-portu commented 4 weeks ago

https://github.com/ksenia-portu/ComfyUI_wav2lip this version is compatible with linux and windows @mike-rowley . Maybe the author @ShmuelRonen will accept a pull request