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/
Apache License 2.0
326 stars 40 forks source link

Problems with deepfuse lipsync #4

Open Maelstrom2014 opened 5 months ago

Maelstrom2014 commented 5 months ago

Hi! I tried mp3 and wav, but all the same error:

Error occurred when executing DeepFuzeAdavance:

'str' object has no attribute 'sample_rate'

File "C:\ai\comfyui\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai\comfyui\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai\comfyui\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai\comfyui\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1333, in lipsyncgenerate
write(audio_file,audio.sample_rate,audio.audio_data)
^^^^^^^^^^^^^^^^^
Aenon1 commented 5 months ago

Same here. A search returns this page but I don't know your code, so I don't want to change anything and maybe make matters worse. :) I got this from another page but the linked page goes deeper on the subject:

In python you cannot access dictionary items using the syntax dict.key , If entry is a dictionary, you can use entry['key1'] entry.get('key')

https://bobbyhadz.com/blog/python-attributeerror-dict-object-has-no-attribute

SamKhoze commented 5 months ago

Hello @Maelstrom2014, can you tell me which node you are using to load audio, currently we are not supporting VHS_load audio, it is only supports (https://github.com/a1lazydog/ComfyUI-AudioScheduler.git) LoadAudio node for this git repo. if you still facing the same issue please let us know.

Thank you

Maelstrom2014 commented 5 months ago

Where? loadaudio

SamKhoze commented 5 months ago

@Maelstrom2014 I'm not sure why the audio load isn't showing up on your AudioScheduler Nodes. Maybe you can try uninstalling and reinstalling it. Here's a screenshot to help you find the node. Screenshot 2024-06-18 at 11 09 37 AM

Aenon1 commented 5 months ago

I'm using your workflow. I'm getting this error: Error occurred when executing DeepFuzeAdavance:

'dict' object has no attribute 'sample_rate'

File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1333, in lipsyncgenerate write(audio_file,audio.sample_rate,audio.audio_data) ^^^^^^^^^^^^^^^^^

image

It is throwing the error when the DeepFuze Lipsync node is running.

shiccup commented 5 months ago

after i stopped getting that error i started getting this error. IndexError: list index out of range

rethink-studios commented 5 months ago

Same error, and weirdly, I have audioScheduler loaded, and I can find it in search, but not in the list

image

image

FETCH DATA from: D:\COMFYUI_BETA\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE] BilboX LUTs path set to: D:\COMFYUI_BETA\ComfyUI\custom_nodes\bilbox-comfyui\luts got prompt '🔥 - 8 Nodes not included in prompt but is activated' codeformer 24.0 video/h265-mp4 video h265-mp4 {'enhancer': 'codeformer', 'frame_enhancer': 'real_esrgan_x2', 'face_mask_padding_left': 0, 'face_mask_padding_right': 0, 'face_mask_padding_bottom': 0, 'face_mask_padding_top': 0, 'trim_frame_start': 0, 'trim_frame_end': 0, 'device': 'cpu', 'frame_rate': 24.0, 'loop_count': 0, 'filename_prefix': 'deepfuze', 'pingpong': False, 'save_output': True, 'images': ['4', 0], 'audio': ['9', 0], 'format': 'video/h265-mp4', 'pix_fmt': 'yuv420p10le', 'crf': 22, 'save_metadata': ['save_metadata', 'BOOLEAN', {'default': True}]} D:\COMFYUI_BETA\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite..\video_formats\h265-mp4.json pix_fmt crf save_metadata Output images were not of valid resolution and have had padding applied !!! Exception during processing!!! 'dict' object has no attribute 'sample_rate' Traceback (most recent call last): File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1333, in lipsyncgenerate write(audio_file,audio.sample_rate,audio.audio_data) ^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'sample_rate'

Prompt executed in 6.68 seconds got prompt '🔥 - 9 Nodes not included in prompt but is activated' codeformer 24.0 video/h265-mp4 video h265-mp4 {'enhancer': 'codeformer', 'frame_enhancer': 'real_esrgan_x2', 'face_mask_padding_left': 0, 'face_mask_padding_right': 0, 'face_mask_padding_bottom': 0, 'face_mask_padding_top': 0, 'trim_frame_start': 0, 'trim_frame_end': 0, 'device': 'cpu', 'frame_rate': 24.0, 'loop_count': 0, 'filename_prefix': 'deepfuze', 'pingpong': False, 'save_output': True, 'images': ['4', 0], 'audio': ['9', 0], 'format': 'video/h265-mp4', 'pix_fmt': 'yuv420p10le', 'crf': 22, 'save_metadata': ['save_metadata', 'BOOLEAN', {'default': True}]} D:\COMFYUI_BETA\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite..\video_formats\h265-mp4.json pix_fmt crf save_metadata Output images were not of valid resolution and have had padding applied !!! Exception during processing!!! 'dict' object has no attribute 'sample_rate' Traceback (most recent call last): File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\COMFYUI_BETA\ComfyUI\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1333, in lipsyncgenerate write(audio_file,audio.sample_rate,audio.audio_data) ^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'sample_rate'

Attached is deepFUZE_error.txt the installation log

myprivacygithub commented 5 months ago

image Using Load Audio from AudioScheduler only, but there is no input to select audio in that node?

SamKhoze commented 5 months ago

Hello @myprivacygithub,

if you are still getting error message you can use VHS load audio and attach that node output to VHS load audio from AudioScheduler node.

drmbt commented 4 months ago

if you are still getting error message you can use VHS load audio and attach that node output to VHS load audio from AudioScheduler node.

With the AudioScheduler LoadAudio I've still been getting:

Return type mismatch between linked nodes: audio, AUDIO != VHS_AUDIO

with the Load VHS Audio workaround you mentioned i get:

'AudioData' object is not callable

File "C:\AI\StabilityMatrix\Data\Packages\ComfyUI_deepfuze\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\AI\StabilityMatrix\Data\Packages\ComfyUI_deepfuze\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\AI\StabilityMatrix\Data\Packages\ComfyUI_deepfuze\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\AI\StabilityMatrix\Data\Packages\ComfyUI_deepfuze\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1339, in lipsyncgenerate open(audio_file,"wb").write(audio())

mmcc1 commented 4 months ago

Hello @Maelstrom2014, can you tell me which node you are using to load audio, currently we are not supporting VHS_load audio, it is only supports (https://github.com/a1lazydog/ComfyUI-AudioScheduler.git) LoadAudio node for this git repo. if you still facing the same issue please let us know.

Thank you

There is an issue with Audio Scheduler's Load Audio. A naming conflict.

See here: https://github.com/a1lazydog/ComfyUI-AudioScheduler/issues/22

SamKhoze commented 4 months ago

Deepfuze nodes are now compatible with VHS nodes. If you use example workflows might not work due to recent updates on VHS, and Comfyui, clear your workspace drop nodes manually and build a new workflow.

mmcc1 commented 4 months ago

I have just tried it with the latest version of Deepfuze, both from Manager and from Git. Using VHS Load Audio, I get the following error when linking to the Deepfuze TTS node (DeepFuze_VoiceClonning_Lipsync.json):

Error occurred when executing TTS_generation:

[WinError 267] The directory name is invalid

File "C:\ComfyUI-master\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI-master\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI-master\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI-master\custom_nodes\ComfyUI-DeepFuze\nodes.py", line 1431, in generate_audio result = subprocess.run(command,cwd="ComfyUI/custom_nodes/ComfyUI-DeepFuze",stdout=subprocess.PIPE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Python312\Lib\subprocess.py", line 548, in run with Popen(popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Python312\Lib\subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^