diff --git a/modules/processors/frame/face_enhancer.py b/modules/processors/frame/face_enhancer.py index 72e5efff..fbc56e29 100644 --- a/modules/processors/frame/face_enhancer.py +++ b/modules/processors/frame/face_enhancer.py @@ -54,12 +54,12 @@ def get_face_enhancer() -> Any: with THREAD_LOCK: if FACE_ENHANCER is None: model_path = os.path.join(models_dir, "GFPGANv1.4.pth") - if platform.system() == "Darwin": # Mac OS + elif platform.system() == "Darwin": # Mac OS mps_device = None - if torch.backends.mps.is_available(): + elif torch.backends.mps.is_available(): mps_device = torch.device("mps") FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1, device=mps_device) # type: ignore[attr-defined] - else: # Other OS + elif: # Other OS FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined] return FACE_ENHANCER