mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix CLI import of diffusers by repo_id
- Fix a bug in the CLI which prevented diffusers imported by their repo_ids from being correctly registered in the current session (though they install correctly) - Capitalize the "i" in Imported in the autogenerated descriptions.
This commit is contained in:
parent
9b157b6532
commit
e29c9a7d9e
@ -672,7 +672,7 @@ def import_model(model_path: str, gen, opt, completer, convert=False) -> str:
|
|||||||
|
|
||||||
gen.model_manager.commit(opt.conf)
|
gen.model_manager.commit(opt.conf)
|
||||||
completer.update_models(gen.model_manager.list_models())
|
completer.update_models(gen.model_manager.list_models())
|
||||||
print(f">> {model_name} successfully installed")
|
print(f">> {imported_name} successfully installed")
|
||||||
|
|
||||||
def _verify_load(model_name: str, gen) -> bool:
|
def _verify_load(model_name: str, gen) -> bool:
|
||||||
print(">> Verifying that new model loads...")
|
print(">> Verifying that new model loads...")
|
||||||
|
@ -640,7 +640,7 @@ class ModelManager(object):
|
|||||||
models.yaml file.
|
models.yaml file.
|
||||||
"""
|
"""
|
||||||
model_name = model_name or Path(repo_or_path).stem
|
model_name = model_name or Path(repo_or_path).stem
|
||||||
model_description = model_description or f"imported diffusers model {model_name}"
|
model_description = model_description or f"Imported diffusers model {model_name}"
|
||||||
new_config = dict(
|
new_config = dict(
|
||||||
description=model_description,
|
description=model_description,
|
||||||
vae=vae,
|
vae=vae,
|
||||||
@ -699,7 +699,7 @@ class ModelManager(object):
|
|||||||
model_name or Path(weights).stem
|
model_name or Path(weights).stem
|
||||||
) # note this gives ugly pathnames if used on a URL without a Content-Disposition header
|
) # note this gives ugly pathnames if used on a URL without a Content-Disposition header
|
||||||
model_description = (
|
model_description = (
|
||||||
model_description or f"imported stable diffusion weights file {model_name}"
|
model_description or f"Imported stable diffusion weights file {model_name}"
|
||||||
)
|
)
|
||||||
new_config = dict(
|
new_config = dict(
|
||||||
weights=str(weights_path),
|
weights=str(weights_path),
|
||||||
@ -835,7 +835,7 @@ class ModelManager(object):
|
|||||||
thing, commit_to_conf=commit_to_conf
|
thing, commit_to_conf=commit_to_conf
|
||||||
)
|
)
|
||||||
pipeline, _, _, _ = self._load_diffusers_model(self.config[model_name])
|
pipeline, _, _, _ = self._load_diffusers_model(self.config[model_name])
|
||||||
|
return model_name
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
f"** {thing}: Unknown thing. Please provide a URL, file path, directory or HuggingFace repo_id"
|
f"** {thing}: Unknown thing. Please provide a URL, file path, directory or HuggingFace repo_id"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user