Load the models after the device init, to let the UI load before the models finish loading

This commit is contained in:
cmdr2 2022-12-11 13:30:16 +05:30
parent 543f13f9a3
commit afb88616d8
2 changed files with 2 additions and 3 deletions

View File

@ -39,13 +39,11 @@ def init(device):
device_manager.device_init(thread_data, device)
init_and_load_default_models()
def destroy():
for model_type in ('stable-diffusion', 'hypernetwork', 'gfpgan', 'realesrgan'):
model_loader.unload_model(thread_data, model_type)
def init_and_load_default_models():
def load_default_models():
# init default model paths
for model_type in model_manager.KNOWN_MODEL_TYPES:
thread_data.model_paths[model_type] = model_manager.resolve_model_to_use(model_type=model_type)

View File

@ -283,6 +283,7 @@ def thread_render(device):
'alive': True
}
runtime2.load_default_models()
current_state = ServerStates.Online
while True: