diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-06-27 05:38:14 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-06-27 05:38:14 +0000 |
commit | 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8 (patch) | |
tree | b0e9b9d93f90b5d50084292a48578bd4f9a83ec6 /modules/realesrgan_model.py | |
parent | baf6946e06249c5af9851c60171692c44ef633e0 (diff) | |
parent | dbc88c96450793b08b520f3b86cd46d6aeaaae52 (diff) | |
download | stable-diffusion-webui-gfx803-394ffa7b0a7fff3ec484bcd084e673a8b301ccc8.tar.gz stable-diffusion-webui-gfx803-394ffa7b0a7fff3ec484bcd084e673a8b301ccc8.tar.bz2 stable-diffusion-webui-gfx803-394ffa7b0a7fff3ec484bcd084e673a8b301ccc8.zip |
Merge branch 'release_candidate'
Diffstat (limited to 'modules/realesrgan_model.py')
-rw-r--r-- | modules/realesrgan_model.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/modules/realesrgan_model.py b/modules/realesrgan_model.py index 99983678..2d27b321 100644 --- a/modules/realesrgan_model.py +++ b/modules/realesrgan_model.py @@ -1,6 +1,4 @@ import os
-import sys
-import traceback
import numpy as np
from PIL import Image
@@ -9,7 +7,8 @@ from realesrgan import RealESRGANer from modules.upscaler import Upscaler, UpscalerData
from modules.shared import cmd_opts, opts
-from modules import modelloader
+from modules import modelloader, errors
+
class UpscalerRealESRGAN(Upscaler):
def __init__(self, path):
@@ -36,8 +35,7 @@ class UpscalerRealESRGAN(Upscaler): self.scalers.append(scaler)
except Exception:
- print("Error importing Real-ESRGAN:", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ errors.report("Error importing Real-ESRGAN", exc_info=True)
self.enable = False
self.scalers = []
@@ -76,9 +74,8 @@ class UpscalerRealESRGAN(Upscaler): info.local_data_path = load_file_from_url(url=info.data_path, model_dir=self.model_download_path, progress=True)
return info
- except Exception as e:
- print(f"Error making Real-ESRGAN models list: {e}", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ except Exception:
+ errors.report("Error making Real-ESRGAN models list", exc_info=True)
return None
def load_models(self, _):
@@ -135,5 +132,4 @@ def get_realesrgan_models(scaler): ]
return models
except Exception:
- print("Error making Real-ESRGAN models list:", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ errors.report("Error making Real-ESRGAN models list", exc_info=True)
|