Merge pull request #11 from Craftyawesome/fix-gfpgan-vram

Workaround for gfpgan OOM on 6GB
This commit is contained in:
AUTOMATIC1111 2022-08-26 20:41:16 +03:00 committed by GitHub
commit a51bedfb5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -678,6 +678,7 @@ def process_images(outpath, func_init, func_sample, prompt, seed, sampler_index,
x_sample = x_sample.astype(np.uint8) x_sample = x_sample.astype(np.uint8)
if use_GFPGAN and GFPGAN is not None: 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) cropped_faces, restored_faces, restored_img = GFPGAN.enhance(x_sample, has_aligned=False, only_center_face=False, paste_back=True)
x_sample = restored_img x_sample = restored_img