correctly import diffusers models by their local path

- Corrects a bug in which the local path was treated as a repo_id
This commit is contained in:
Lincoln Stein 2023-01-20 20:13:43 -05:00
parent 33a5c83c74
commit 96a900d1fe

View File

@ -577,7 +577,7 @@ def import_model(model_path:str, gen, opt, completer):
elif re.match('^[\w.+-]+/[\w.+-]+$',model_path):
model_name = import_diffuser_model(model_path, gen, opt, completer)
elif os.path.isdir(model_path):
model_name = import_diffuser_model(model_path, gen, opt, completer)
model_name = import_diffuser_model(Path(model_path), gen, opt, completer)
else:
print(f'** {model_path} is neither the path to a .ckpt file nor a diffusers repository id. Can\'t import.')