aboutsummaryrefslogtreecommitdiffstats
path: root/modules/codeformer_model.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-06-01 05:42:50 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-06-01 05:42:50 +0000
commitb3390a984081950c626070889580e01727689921 (patch)
treef1fb3352f91d70034d54a99c220f1ca594d8b3dc /modules/codeformer_model.py
parent0cc05fc492a9360d3b2f1b3f64c7d74f9041f74e (diff)
parent36888092afa82ee248bc947229f813b453629317 (diff)
downloadstable-diffusion-webui-gfx803-b3390a984081950c626070889580e01727689921.tar.gz
stable-diffusion-webui-gfx803-b3390a984081950c626070889580e01727689921.tar.bz2
stable-diffusion-webui-gfx803-b3390a984081950c626070889580e01727689921.zip
Merge branch 'dev' into startup-profile
Diffstat (limited to 'modules/codeformer_model.py')
-rw-r--r--modules/codeformer_model.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/codeformer_model.py b/modules/codeformer_model.py
index ececdbae..4260b016 100644
--- a/modules/codeformer_model.py
+++ b/modules/codeformer_model.py
@@ -1,13 +1,11 @@
import os
-import sys
-import traceback
import cv2
import torch
import modules.face_restoration
import modules.shared
-from modules import shared, devices, modelloader
+from modules import shared, devices, modelloader, errors
from modules.paths import models_path
# codeformer people made a choice to include modified basicsr library to their project which makes
@@ -105,8 +103,8 @@ def setup_model(dirname):
restored_face = tensor2img(output, rgb2bgr=True, min_max=(-1, 1))
del output
torch.cuda.empty_cache()
- except Exception as error:
- print(f'\tFailed inference for CodeFormer: {error}', file=sys.stderr)
+ except Exception:
+ errors.report('Failed inference for CodeFormer', exc_info=True)
restored_face = tensor2img(cropped_face_t, rgb2bgr=True, min_max=(-1, 1))
restored_face = restored_face.astype('uint8')
@@ -135,7 +133,6 @@ def setup_model(dirname):
shared.face_restorers.append(codeformer)
except Exception:
- print("Error setting up CodeFormer:", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ errors.report("Error setting up CodeFormer", exc_info=True)
# sys.path = stored_sys_path