Kosinkadink / ComfyUI-VideoHelperSuite

Nodes related to video workflows
GNU General Public License v3.0
513 stars 90 forks source link

16G memory means it cannot handle 1920*1080 video at all, Ask for help. #136

Open mayjack0312 opened 7 months ago

mayjack0312 commented 7 months ago

Running error

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "D:\ComfyUI\execution.py", line 155, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\ComfyUI\execution.py", line 85, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\ComfyUI\execution.py", line 78, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\load_video_nodes.py", line 148, in load_video
    return load_video_cv(**kwargs)
  File "D:\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\load_video_nodes.py", line 104, in load_video_cv
    images = torch.cat(images, dim=0)
RuntimeError: [enforce fail at alloc_cpu.cpp:80] data. DefaultCPUAllocator: not enough memory: you tried to allocate 65641881600 bytes.

Prompt executed in 1545.26 seconds
AustinMroz commented 7 months ago

This is most likely a consequence of uncompressed video being really big. I recommend, in rough order of effectiveness for memory reduction:

See #67 and #125

I have not seen issues in testing with resolutions as large as 4000 x 4000 or with 1920 x 1080 videos that are over an hour long. That said, it seems statistically unlikely to me that there have been multiple reports of failure at the call to torch.cat. I'll do some testing on appending individual frames directly into a torch tensor.

mayjack0312 commented 7 months ago

This is most likely a consequence of uncompressed video being really big. I recommend, in rough order of effectiveness for memory reduction:

  • Using frame_load_cap and skip_first_frames to only process a portion of the video at a time.
  • Using force_rate to reduce the frame rate.
  • Using force_size to reduce the resolution.

See #67 and #125

I have not seen issues in testing with resolutions as large as 4000 x 4000 or with 1920 x 1080 videos that are over an hour long. That said, it seems statistically unlikely to me that there have been multiple reports of failure at the call to torch.cat. I'll do some testing on appending individual frames directly into a torch tensor.

I tried using PR to compress the video resolution to 720P, and the frame sampling rate in the plug-in was also set to 10, but the effect was still not satisfactory, and then I switched back to SD.

AustinMroz commented 7 months ago

I've also started on a new system to automate the process of dividing a workflow into batches (see #140).

mayjack0312 commented 7 months ago

I've also started on a new system to automate the process of dividing a workflow into batches (see #140).

This is my workflow, but no matter how I modify it, I can’t seem to achieve good results. Please help. admin.json

H-Bole commented 6 months ago

admin (1).json Here is the workflow I've created to help you with batch management. 这是我帮你加入批量管理的工作流

H-Bole commented 6 months ago

his is the example of batch loading I have. 这是我批量加载的案例 workflow

mayjack0312 commented 6 months ago

admin (1).json Here is the workflow I've created to help you with batch management. 这是我帮你加入批量管理的工作流

Thank you so much