new middleware handler and ability to restart server on-the-fly

This commit is contained in:
Vladimir Mandic
2023-04-16 15:57:00 -04:00
parent b7e4b0414a
commit 58df74cfd5
14 changed files with 145 additions and 125 deletions
+3 -2
View File
@@ -103,6 +103,9 @@ def cleanup_models():
src_path = os.path.join(root_path, "repositories/latent-diffusion/experiments/pretrained_models/")
dest_path = os.path.join(models_path, "LDSR")
move_files(src_path, dest_path)
src_path = os.path.join(root_path, "ScuNET")
dest_path = os.path.join(models_path, "ScuNET")
move_files(src_path, dest_path)
def move_files(src_path: str, dest_path: str, ext_filter: str = None):
@@ -134,11 +137,9 @@ forbidden_upscaler_classes = set()
def list_builtin_upscalers():
load_upscalers()
builtin_upscaler_classes.clear()
builtin_upscaler_classes.extend(Upscaler.__subclasses__())
def forbid_loaded_nonbuiltin_upscalers():
for cls in Upscaler.__subclasses__():
if cls not in builtin_upscaler_classes: