memory issue
First, confirm
- [X] I have read the instruction carefully
- [X] I have searched the existing issues
- [X] I have updated the extension to the latest version
What happened?
during Restoring with GFPGANv1.4.pth the following error occured
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 11.3 GiB for an array with shape (480, 768, 1368, 3) and data type float64
here is the workflow , but the total frame is 480.
if i set the total frame smaller , for exmple 100 no error will occure
Steps to reproduce the problem
r
r
Sysinfo
win11 rtx2080 8g vram, 32g ram
Relevant console log
[ReActor] 00:41:15 - STATUS - Using Hashed Source Face(s) Model...
[ReActor] 00:41:15 - STATUS - Analyzing Target Image...
[ReActor] 00:41:17 - STATUS - Swapping...
[ReActor] 00:41:17 - STATUS - --Done!--
[ReActor] 00:41:27 - STATUS - Restoring with GFPGANv1.4.pth
ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "H:\ComfyUI\ComfyUI\execution.py", line 154, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "H:\ComfyUI\ComfyUI\execution.py", line 84, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "H:\ComfyUI\ComfyUI\execution.py", line 77, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "H:\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 169, in execute
out_images = np.ndarray(shape=image_np.shape)
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 11.3 GiB for an array with shape (480, 768, 1368, 3) and data type float64
Additional information
No response
I got the same issue yesterday.
The frames were extracted from the video, then the upscale went fine, the face swap went fine, and at the end, just before the interpolation node, error saying it cannot allocate 24Gb, with the same message as above.
It was a small video, so I succeeded by unloaded everything, restarting ComfyUI and launching directly from the Faceswap and it finished successfully.
I just got the same issue! Did you fix it?
You should increase Virtual Memory in your OS
- Win+R
- Type
SystemPropertiesAdvanced - Under Performance, click Settings
- Select the Advanced tab
- Select Change...
- Uncheck Automatically managing paging file size for all drives
- Then select Custom size and fill in the appropriate size (e.g. 32768)
- Press Set - then OK - then exit from the Virtual Memory, Performance Options, and System Properties Dialog
- Reboot your system
I have 64Gb of RAM and 16384Mb of Virtual Memory and never faced this error while processing any videos
You guys can try Evolve branch to check whether this issue is fixed or not
The whole script has such a bad memory management, loads too much into RAM instead of using the performance of e.g. SSD storage or even the proper use of GPU.
I gave up with reactor and wrote our own script. With a 4060 / 16GB and 16GB Ram, we run 4 simultaneous swapping threads, each at 2.5 Frames per second (with restoration and masking) and have a 85% utilization of the GPU and 40% CPU. Besides that there is no limitation for durations of videos anymore because of no RAM issues ...
Time is of essence here, reactor is simply much too slow
The whole script has such a bad memory management, loads too much into RAM instead of using the performance of e.g. SSD storage or even the proper use of GPU.
I gave up with reactor and wrote our own script. With a 4060 / 16GB and 16GB Ram, we run 4 simultaneous swapping threads, each at 2.5 Frames per second (with restoration and masking) and have a 85% utilization of the GPU and 40% CPU. Besides that there is no limitation for durations of videos anymore because of no RAM issues ...
Time is of essence here, reactor is simply much too slow
You can make a PR and improve ReActor instead of complaining, it's an opensource non-commercial app that is still in development stage. Me and the other guys (to whom I am very grateful) develops ReActor in our free time