|
|
|
@ -117,13 +117,13 @@ def select_checkpoint():
|
|
|
|
return checkpoint_info
|
|
|
|
return checkpoint_info
|
|
|
|
|
|
|
|
|
|
|
|
if len(checkpoints_list) == 0:
|
|
|
|
if len(checkpoints_list) == 0:
|
|
|
|
print(f"No checkpoints found. When searching for checkpoints, looked at:", file=sys.stderr)
|
|
|
|
print("No checkpoints found. When searching for checkpoints, looked at:", file=sys.stderr)
|
|
|
|
if shared.cmd_opts.ckpt is not None:
|
|
|
|
if shared.cmd_opts.ckpt is not None:
|
|
|
|
print(f" - file {os.path.abspath(shared.cmd_opts.ckpt)}", file=sys.stderr)
|
|
|
|
print(f" - file {os.path.abspath(shared.cmd_opts.ckpt)}", file=sys.stderr)
|
|
|
|
print(f" - directory {model_path}", file=sys.stderr)
|
|
|
|
print(f" - directory {model_path}", file=sys.stderr)
|
|
|
|
if shared.cmd_opts.ckpt_dir is not None:
|
|
|
|
if shared.cmd_opts.ckpt_dir is not None:
|
|
|
|
print(f" - directory {os.path.abspath(shared.cmd_opts.ckpt_dir)}", file=sys.stderr)
|
|
|
|
print(f" - directory {os.path.abspath(shared.cmd_opts.ckpt_dir)}", file=sys.stderr)
|
|
|
|
print(f"Can't run without a checkpoint. Find and place a .ckpt file into any of those locations. The program will exit.", file=sys.stderr)
|
|
|
|
print("Can't run without a checkpoint. Find and place a .ckpt file into any of those locations. The program will exit.", file=sys.stderr)
|
|
|
|
exit(1)
|
|
|
|
exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
checkpoint_info = next(iter(checkpoints_list.values()))
|
|
|
|
checkpoint_info = next(iter(checkpoints_list.values()))
|
|
|
|
@ -324,7 +324,7 @@ def load_model(checkpoint_info=None):
|
|
|
|
|
|
|
|
|
|
|
|
script_callbacks.model_loaded_callback(sd_model)
|
|
|
|
script_callbacks.model_loaded_callback(sd_model)
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Model loaded.")
|
|
|
|
print("Model loaded.")
|
|
|
|
return sd_model
|
|
|
|
return sd_model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -359,5 +359,5 @@ def reload_model_weights(sd_model=None, info=None):
|
|
|
|
if not shared.cmd_opts.lowvram and not shared.cmd_opts.medvram:
|
|
|
|
if not shared.cmd_opts.lowvram and not shared.cmd_opts.medvram:
|
|
|
|
sd_model.to(devices.device)
|
|
|
|
sd_model.to(devices.device)
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Weights loaded.")
|
|
|
|
print("Weights loaded.")
|
|
|
|
return sd_model
|
|
|
|
return sd_model
|
|
|
|
|