kijai/ComfyUI-CCSR

RTX 4080 - Allocation on device 0 would exceed allowed memory. (out of memory)

Opened this issue · 0 comments

When i try to upscale x4 512x512 image at default settings i receive this error:

Error occurred when executing CCSR_Upscale:

Allocation on device 0 would exceed allowed memory. (out of memory)
Currently allocated : 9.28 GiB
Requested : 4.00 GiB
Device limit : 16.00 GiB
Free (according to CUDA): 0 bytes
PyTorch limit (set by user-supplied memory fraction)
: 17179869184.00 GiB

File "C:\Comfy\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\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:\Comfy\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\custom_nodes\ComfyUI-CCSR\nodes.py", line 140, in process
samples = sampler.sample_ccsr(
^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\custom_nodes\ComfyUI-CCSR\model\q_sampler.py", line 1052, in sample_ccsr
img_pixel = (self.model.decode_first_stage(img) + 1) / 2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\custom_nodes\ComfyUI-CCSR\ldm\models\diffusion\ddpm_ccsr_stage2.py", line 977, in decode_first_stage
return self.first_stage_model.decode(z)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\custom_nodes\ComfyUI-CCSR\ldm\models\autoencoder.py", line 90, in decode
dec = self.decoder(z)
^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\comfy\ldm\modules\diffusionmodules\model.py", line 635, in forward
h = self.up[i_level].block[i_block](h, temb, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\comfy\ldm\modules\diffusionmodules\model.py", line 140, in forward
h = self.norm1(h)
^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI\comfy\ops.py", line 90, in forward
return super().forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\modules\normalization.py", line 287, in forward
return F.group_norm(
^^^^^^^^^^^^^
File "C:\Comfy\python_embeded\Lib\site-packages\torch\nn\functional.py", line 2561, in group_norm
return torch.group_norm(input, num_groups, weight, bias, eps, torch.backends.cudnn.enabled)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

No issue when i try to upscale the same image x3 . The system is with 32GB RAM .