Comfy-Org / Comfy-Org/ComfyUI

DefaultCPUAllocator: not enough memory

Open
#1,611 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

I'm currently attempting to upscale a large number of images (400) inside ComfyUI using an upscaling model. The problem arises when my 32GB of RAM becomes full over time. Is there a way to avoid this issue? I am aware that I can upscale them separately in another program, but it would be convenient to do it in ComfyUI because they are used for a second pass. The closest solution would be to process them in batches, but I haven't found a node for that. Additionally, I only want the upscaler and sampler to run in batches, not everything that follows. Below is the full error message for reference:

```
!!! Exception during processing !!!
Traceback (most recent call last):
File "C:\Users\letsp\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\Users\letsp\Desktop\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:\Users\letsp\Desktop\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:\Users\letsp\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_extras\nodes_upscale_model.py", line 60, in upscale
s = torch.clamp(s.movedim(-3,-1), min=0, max=1.0)
RuntimeError: [enforce fail at ..\c10\core\impl\alloc_cpu.cpp:72] data. DefaultCPUAllocator: not enough memory: you tried to allocate 32237420544 bytes.
```

Please let me know if you require any further information.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.