SamKhoze / ComfyUI-DeepFuze

DeepFuze is a state-of-the-art deep learning tool that seamlessly integrates with ComfyUI to revolutionize facial transformations, lipsyncing, Face Swapping, Lipsync Translation, video generation, and voice cloning.
https://cogidigm.com/
Other
299 stars 32 forks source link

Cannot run workflow, Error occurred when executing DeepFuzeAdavance: #37

Open Pancat007 opened 2 months ago

Pancat007 commented 2 months ago

[WinError 2] 系统找不到指定的文件。

File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1328, in lipsyncgenerate subprocess.run(["ffmpeg","-i",enhanced_filename,"-i",audio_file,"-c","copy","-map","0:v:0","-map","1:a:0",temp_file,'-y']) File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\python\lib\subprocess.py", line 503, in run with Popen(popenargs, **kwargs) as process: File "", line 217, in sentry_patched_popen_init File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\python\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Software\ComfyUI\ComfyUI-aki-v1.3\python\lib\subprocess.py", line 1456, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

I have installed CUDA, cudnn, and downloaded models in /model/deepfuze folder, but actually it cannot run using "cuda" mode or "cpu" mode,

CPU mode it shows error like above: Error occurred when executing DeepFuzeAdavance: [WinError 2] 系统找不到指定的文件。

cuda mode actually is using CPU to run

Pancat007 commented 2 months ago

!!! Exception during processing!!! C:\Software\ComfyUI\ComfyUI-aki-v1.3\output\deepfuze\17218024677184994.mp4 could not be loaded with cv.

And i found the message from the console

gilushon commented 2 months ago

Hi, same problem here. while trying to use the lip-sync node.

!!! Exception during processing!!! C:\ComfyUI_windows_portable\ComfyUI\output\deepfuze\enhanced17227753799311035.mp4 could not be loaded with cv.

The full log:

Error occurred when executing DeepFuzeAdavance:

C:\ComfyUI_windows_portable\ComfyUI\output\deepfuze\enhanced17227756370689754.mp4 could not be loaded with cv.

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1335, in lipsyncgenerate return load_video_cv(filename,0,'Disabled',512,512,0,0,1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 446, in load_video_cv (width, height, fps, duration, total_frames, target_frame_time) = next(gen) ^^^^^^^^^ File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 365, in cv_frame_generator raise ValueError(f"{video} could not be loaded with cv.")

SamKhoze commented 2 months ago

@Pancat007 @gilushon there is a section on readme file on how to fix the CV error

gilushon commented 2 months ago

Hi, This?

Errors 😾 CV Error: If you encounter the error "ComfyUI_windows_portable\ComfyUI\output\deepfuze\faceswap_file.mp4 could not be loaded with cv," it means that onnxruntime is not installed. To fix this, make sure to install onnxruntime for CPU and onnxruntime-gpu for Windows. Mac users should upgrade OpenCV using the command pip install --upgrade opencv-python-headless in their virtual environment. For Windows users, go to ComfyUI Manager, click on "pip install," paste --upgrade opencv-python-headless, click OK, and restart your ComfyUI.

I have tried this, and it Still doesn't work.

iiiCpu commented 2 months ago

Hm hm hm

['python', './run.py', '--frame-processors', 'face_swapper', '-s', 'M:\\ComfyUI\\temp\\deepfuze_00002_.png', '-t', 'M:\\ComfyUI\\temp\\deepfuze_00002.mp4', '--face-detector-model', 'yoloface', '-o', 'M:\\ComfyUI\\temp\\faceswap_17230193347680917.mp4', '--face-swapper-model', 'blendswap_256', '--reference-face-position', '0', '--face-mask-padding', '0', '0', '0', '0', '--headless', '--execution-providers', 'cuda']
Traceback (most recent call last):
  File "M:\ComfyUI\custom_nodes\ComfyUI-DeepFuze\run.py", line 7, in <module>
    from deepfuze import core
  File "M:\ComfyUI\custom_nodes\ComfyUI-DeepFuze\deepfuze\core.py", line 10, in <module>
    import onnxruntime
ModuleNotFoundError: No module named 'onnxruntime'

Seems to me, this is something about venv and subprocess calls on Windows, as (ComfyUI) M:\ComfyUI>python -c "import onnxruntime" works purrfectly. As well as

python .\run.py --frame-processors face_swapper -s M:\ComfyUI\temp\deepfuze_00002_.png -t M:\ComfyUI\temp\deepfuze_00002.mp4 --face-detector-model yoloface -o M:\ComfyUI\temp\faceswap_17230193347680917.mp4 --face-swapper-model blendswap_256 --reference-face-position 0 --face-mask-padding 0 0 0 0 --headless --execution-providers cuda

So, I did the most stupid thing. I installed all requirements outside of 'venv'. Because, oh for GOD'S LOVE, if it's the only stupid way to make your stupid code work, ok, lets do it! It's not stupid if it works!!!

Honestly, this is why I find it not a very great idea to call another models as subprocess without this much need. Well, 'neve' would by my preference.

iiiCpu commented 2 months ago

Now I have

[DEEPFUZE.PROCESSORS.FRAME.CORE] Frame processor face_swapper could not be loaded

error. Flip this slip, i'm out!

Brostopher commented 1 month ago

I have the same issue but i can get around it.

load_video_cv (width, height, fps, duration, total_frames, target_frame_time) = next(gen)

I don't have a ton of knowledge but I think the file name is too long i am able to generate once but if i rerun it try's to pull the last enhanced file and breaks due to the naming convention. Right clicking on DeepFuze Lip-sync node and clicking Fix node (recreate) works for me as well.