add load-checkpoint api endpoint and test all models script

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-08-09 14:06:54 -04:00
parent 44a20a47c1
commit 73049f7bb8
6 changed files with 117 additions and 14 deletions
+8
View File
@@ -140,6 +140,14 @@ def get_checkpoint():
checkpoint['hash'] = shared.sd_model.sd_checkpoint_info.shorthash
return checkpoint
def set_checkpoint(sd_model_checkpoint: str, force:bool=False):
from modules import sd_models
if force:
sd_models.unload_model_weights(op='model')
shared.opts.sd_model_checkpoint = sd_model_checkpoint
model = sd_models.reload_model_weights()
return { 'ok': model is not None }
def post_refresh_checkpoints():
shared.refresh_checkpoints()
return {}