mirror of
https://github.com/Haoming02/sd-webui-old-photo-restoration.git
synced 2026-11-05 00:28:04 +00:00
[GH-ISSUE #18] OutOfMemoryError #16
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Haoming02/sd-webui-old-photo-restoration#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @li-marigold on GitHub (Apr 16, 2024).
Original GitHub issue: https://github.com/Haoming02/sd-webui-old-photo-restoration/issues/18
Automatic 1111 v.1.9.0
Running Stage 1: Overall restoration
model weights loaded
processing...
using NL + Res...
processing...
*** Error completing request
*** Arguments: ('task(ka0dwwune9959vj)', 0.0, <PIL.Image.Image image mode=RGBA size=1057x808 at 0x1DB9BFA6320>, None, '', '', True, False, 0.0, 4, 0.0, 512, 512, True, 'None', 'None', 0, True, 1, False, 1, 0, False, 0.5, 0.2, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Horizontal'], False, ['Deepbooru'], True, 'Restoration First', True, True, False) {}
Traceback (most recent call last):
File "E:\Stable Diffusion and AI\stable-diffusion-webui\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "E:\Stable Diffusion and AI\stable-diffusion-webui\modules\call_queue.py", line 36, in f
res = func(*args, **kwargs)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\modules\postprocessing.py", line 131, in run_postprocessing_webui
return run_postprocessing(*args, **kwargs)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\modules\postprocessing.py", line 71, in run_postprocessing
scripts.scripts_postproc.run(initial_pp, args)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\modules\scripts_postprocessing.py", line 185, in run
script.process_firstpass(pp, **process_args)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\extensions\sd-webui-old-photo-restoration\scripts\bop.py", line 46, in process_firstpass
pp.image = main(img, do_scratch, is_hr, do_face_res)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\extensions\sd-webui-old-photo-restoration\scripts\main_function.py", line 56, in main
stage1_output = global_test(
File "E:\Stable Diffusion and AI\stable-diffusion-webui\extensions\sd-webui-old-photo-restoration\Global\test.py", line 139, in global_test
generated = model.inference(input_image, mask)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\extensions\sd-webui-old-photo-restoration\Global\models\mapping_model.py", line 443, in inference
label_feat_map = self.mapping_net(label_feat.detach(), inst_data)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\extensions\sd-webui-old-photo-restoration\Global\models\NonLocal_feature_mapping_model.py", line 70, in forward
x2 = self.NL(x1, mask)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\extensions\sd-webui-old-photo-restoration\Global\models\networks.py", line 481, in forward
f_div_C = F.softmax(f, dim=2)
File "E:\Stable Diffusion and AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\functional.py", line 1856, in softmax
ret = input.softmax(dim)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 10.39 GiB. GPU 0 has a total capacty of 3.00 GiB of which 0 bytes is free. Of the allocated memory 13.04 GiB is allocated by PyTorch, and 329.16 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
A: 13.04 GB, R: 13.37 GB, Sys: 3.0/3 GB (100.0%)
Any suggestions how to solve this?
@Haoming02 commented on GitHub (Apr 16, 2024):
Hmm
What GPU are you using?
And how large of an image were you trying to process?
@li-marigold commented on GitHub (Apr 16, 2024):
@Haoming02 commented on GitHub (Apr 17, 2024):
For now, you can go into the folder and edit this line to:
https://github.com/Haoming02/sd-webui-old-photo-restoration/blob/main/scripts/main_function.py#L25
@li-marigold commented on GitHub (Apr 17, 2024):
yay! It's worked! Thanks!!!