mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
reinitialize models.yaml if corrupt or missing
This commit is contained in:
parent
a2e2f0858d
commit
b1a6ba552b
@ -23,6 +23,7 @@ from urllib import request
|
|||||||
|
|
||||||
import npyscreen
|
import npyscreen
|
||||||
import transformers
|
import transformers
|
||||||
|
import omegaconf
|
||||||
from diffusers import AutoencoderKL
|
from diffusers import AutoencoderKL
|
||||||
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
|
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
|
||||||
from huggingface_hub import HfFolder
|
from huggingface_hub import HfFolder
|
||||||
@ -568,7 +569,14 @@ def default_startup_options(init_file: Path) -> Namespace:
|
|||||||
return opts
|
return opts
|
||||||
|
|
||||||
def default_user_selections(program_opts: Namespace) -> InstallSelections:
|
def default_user_selections(program_opts: Namespace) -> InstallSelections:
|
||||||
|
|
||||||
|
try:
|
||||||
installer = ModelInstall(config)
|
installer = ModelInstall(config)
|
||||||
|
except omegaconf.errors.ConfigKeyError:
|
||||||
|
logger.warning('Your models.yaml file is corrupt or out of date. Reinitializing')
|
||||||
|
initialize_rootdir(config.root_path, True)
|
||||||
|
installer = ModelInstall(config)
|
||||||
|
|
||||||
models = installer.all_models()
|
models = installer.all_models()
|
||||||
return InstallSelections(
|
return InstallSelections(
|
||||||
install_models=[models[installer.default_model()].path or models[installer.default_model()].repo_id]
|
install_models=[models[installer.default_model()].path or models[installer.default_model()].repo_id]
|
||||||
|
@ -958,7 +958,6 @@ class ModelManager(object):
|
|||||||
config.controlnet_dir,
|
config.controlnet_dir,
|
||||||
] if x
|
] if x
|
||||||
}
|
}
|
||||||
print(directories)
|
|
||||||
scanner = ScanAndImport(directories, self.logger, ignore=known_paths, installer=installer)
|
scanner = ScanAndImport(directories, self.logger, ignore=known_paths, installer=installer)
|
||||||
scanner.search()
|
scanner.search()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user