aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gfpgan_model.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-27 10:48:25 +0000
committerGitHub <noreply@github.com>2022-11-27 10:48:25 +0000
commit151e2cc627b262fc23e392d2450be2364edf4714 (patch)
tree1fb00fdb640c6cb201375e60a16af3c5d61ca3f2 /modules/gfpgan_model.py
parentcc90dcc93334356931e799f162a41ae99cc84716 (diff)
parentf4a488f585c09b420dc05199240e68f8fb74337f (diff)
downloadstable-diffusion-webui-gfx803-151e2cc627b262fc23e392d2450be2364edf4714.tar.gz
stable-diffusion-webui-gfx803-151e2cc627b262fc23e392d2450be2364edf4714.tar.bz2
stable-diffusion-webui-gfx803-151e2cc627b262fc23e392d2450be2364edf4714.zip
Merge pull request #4461 from brkirch/face-restoration-device-fix
Fix setting device for GFPGAN and CodeFormer
Diffstat (limited to 'modules/gfpgan_model.py')
-rw-r--r--modules/gfpgan_model.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gfpgan_model.py b/modules/gfpgan_model.py
index a9452dce..1e2dbc32 100644
--- a/modules/gfpgan_model.py
+++ b/modules/gfpgan_model.py
@@ -36,7 +36,9 @@ def gfpgann():
else:
print("Unable to load gfpgan model!")
return None
- model = gfpgan_constructor(model_path=model_file, upscale=1, arch='clean', channel_multiplier=2, bg_upsampler=None)
+ if hasattr(facexlib.detection.retinaface, 'device'):
+ facexlib.detection.retinaface.device = devices.device_gfpgan
+ model = gfpgan_constructor(model_path=model_file, upscale=1, arch='clean', channel_multiplier=2, bg_upsampler=None, device=devices.device_gfpgan)
loaded_gfpgan_model = model
return model