From 92138df5ccfe0340b7c2a32f150437e533900f91 Mon Sep 17 00:00:00 2001 From: Craftyawesome Date: Thu, 25 Aug 2022 19:59:09 -0500 Subject: [PATCH] fix gfpgan oom on 6GB force a gc if out of memory --- webui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/webui.py b/webui.py index 2751d75a..b3375e98 100644 --- a/webui.py +++ b/webui.py @@ -678,6 +678,7 @@ def process_images(outpath, func_init, func_sample, prompt, seed, sampler_index, x_sample = x_sample.astype(np.uint8) if use_GFPGAN and GFPGAN is not None: + torch_gc() cropped_faces, restored_faces, restored_img = GFPGAN.enhance(x_sample, has_aligned=False, only_center_face=False, paste_back=True) x_sample = restored_img