mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-20 09:57:49 +02:00
Load the models after the device init, to let the UI load before the models finish loading
This commit is contained in:
parent
543f13f9a3
commit
afb88616d8
@ -39,13 +39,11 @@ def init(device):
|
|||||||
|
|
||||||
device_manager.device_init(thread_data, device)
|
device_manager.device_init(thread_data, device)
|
||||||
|
|
||||||
init_and_load_default_models()
|
|
||||||
|
|
||||||
def destroy():
|
def destroy():
|
||||||
for model_type in ('stable-diffusion', 'hypernetwork', 'gfpgan', 'realesrgan'):
|
for model_type in ('stable-diffusion', 'hypernetwork', 'gfpgan', 'realesrgan'):
|
||||||
model_loader.unload_model(thread_data, model_type)
|
model_loader.unload_model(thread_data, model_type)
|
||||||
|
|
||||||
def init_and_load_default_models():
|
def load_default_models():
|
||||||
# init default model paths
|
# init default model paths
|
||||||
for model_type in model_manager.KNOWN_MODEL_TYPES:
|
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)
|
thread_data.model_paths[model_type] = model_manager.resolve_model_to_use(model_type=model_type)
|
||||||
|
@ -283,6 +283,7 @@ def thread_render(device):
|
|||||||
'alive': True
|
'alive': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runtime2.load_default_models()
|
||||||
current_state = ServerStates.Online
|
current_state = ServerStates.Online
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user