mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
Make it so that upscalers are not repeated when restarting UI.
This commit is contained in:
14
webui.py
14
webui.py
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import importlib
|
||||
@@ -55,8 +56,8 @@ def initialize():
|
||||
gfpgan.setup_model(cmd_opts.gfpgan_models_path)
|
||||
shared.face_restorers.append(modules.face_restoration.FaceRestoration())
|
||||
|
||||
modelloader.list_builtin_upscalers()
|
||||
modules.scripts.load_scripts()
|
||||
|
||||
modelloader.load_upscalers()
|
||||
|
||||
modules.sd_vae.refresh_vae_list()
|
||||
@@ -169,23 +170,22 @@ def webui():
|
||||
modules.script_callbacks.app_started_callback(shared.demo, app)
|
||||
|
||||
wait_on_server(shared.demo)
|
||||
print('Restarting UI...')
|
||||
|
||||
sd_samplers.set_samplers()
|
||||
|
||||
print('Reloading extensions')
|
||||
extensions.list_extensions()
|
||||
|
||||
localization.list_localizations(cmd_opts.localizations_dir)
|
||||
|
||||
print('Reloading custom scripts')
|
||||
modelloader.forbid_loaded_nonbuiltin_upscalers()
|
||||
modules.scripts.reload_scripts()
|
||||
modelloader.load_upscalers()
|
||||
|
||||
print('Reloading modules: modules.ui')
|
||||
importlib.reload(modules.ui)
|
||||
print('Refreshing Model List')
|
||||
for module in [module for name, module in sys.modules.items() if name.startswith("modules.ui")]:
|
||||
importlib.reload(module)
|
||||
|
||||
modules.sd_models.list_models()
|
||||
print('Restarting Gradio')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user