fix race condition on model load via api

This commit is contained in:
Vladimir Mandic
2023-06-19 09:13:17 -04:00
parent f42553918b
commit 2345237844
3 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -617,7 +617,7 @@ def reload_model_weights(sd_model=None, info=None, reuse_dict=False):
current_checkpoint_info = None
else:
current_checkpoint_info = sd_model.sd_checkpoint_info
if checkpoint_info is not None and sd_model.sd_model_checkpoint == checkpoint_info.filename:
if checkpoint_info is not None and current_checkpoint_info.filename == checkpoint_info.filename:
return
if shared.cmd_opts.lowvram or shared.cmd_opts.medvram:
lowvram.send_everything_to_cpu()