light-and-ray / sd-webui-video-extras-tab

process video frame by frame inside "Extras" tab
21 stars 1 forks source link

MemoryError: Unable to allocate 169. MiB for an array with shape (2880, 5120, 3) and data type float32 #5

Open untanya opened 4 months ago

untanya commented 4 months ago

Hello, I encountered this error while trying to upscale a video to 1920x1080p, I don't know how to solve it, I didn't set up much as it's the first time I'm doing it...

Capture d'écran 2024-05-21 155729

Here's the full summary of the error in the terminal:

*** Error completing request
*** Arguments: ('task(l7m1bob7c8nkjzg)', 'E:\\Perso\\H\\Anime\\Rikujoubu Joshi Wa Ore no Nama Onaho\\[NH-MISSY]Rikujoubu Joshi wa Ore no Nama Onaho The Animation - 01 (VOSTFR) [HDR].mp4', 29.97, 'E:\\Perso\\H\\Anime\\Rikujoubu Joshi Wa Ore no Nama Onaho', False, 3, None, None, '', '', True, 1, 4, 1920, 1080, True, 'R-ESRGAN 4x+', 'None', 0, False, 1, False, 1, 0, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Deepbooru'], False, ['Horizontal'], False, 0.5, 0.2) {}
    Traceback (most recent call last):
      File "C:\AI\stable-diffusion-webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "C:\AI\stable-diffusion-webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "C:\AI\stable-diffusion-webui\extensions\sd-webui-video-extras-tab\video_extras_tab\process.py", line 53, in process
        run_postprocessing(*args, **kwargs)
      File "C:\AI\stable-diffusion-webui\modules\postprocessing.py", line 73, in run_postprocessing
        scripts.scripts_postproc.run(initial_pp, args)
      File "C:\AI\stable-diffusion-webui\modules\scripts_postprocessing.py", line 196, in run
        script.process(single_image, **process_args)
      File "C:\AI\stable-diffusion-webui\scripts\postprocessing_upscale.py", line 108, in process
        upscaled_image = self.upscale(pp.image, pp.info, upscaler1, upscale_mode, upscale_by, upscale_to_width, upscale_to_height, upscale_crop)
      File "C:\AI\stable-diffusion-webui\scripts\postprocessing_upscale.py", line 70, in upscale
        image = upscaler.scaler.upscale(image, upscale_by, upscaler.data_path)
      File "C:\AI\stable-diffusion-webui\modules\upscaler.py", line 65, in upscale
        img = self.do_upscale(img, selected_model)
      File "C:\AI\stable-diffusion-webui\modules\realesrgan_model.py", line 61, in do_upscale
        upsampled = upsampler.enhance(np.array(img), outscale=info.scale)[0]
      File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\realesrgan\utils.py", line 254, in enhance
        output = (output_img * 255.0).round().astype(np.uint8)
    numpy.core._exceptions._ArrayMemoryError: Unable to allocate 169. MiB for an array with shape (2880, 5120, 3) and data type float32

---

Can someone tell me how to fix it? Best Regards!

light-and-ray commented 4 months ago

Do not enotlught RAM maybe. Does it happen for the first frame?

untanya commented 4 months ago

It happened after 18 hours of processing (1127min), and I didn't really see when it happened, because I was asleep at the time.