fix(config): split check_invokeai_root into separate function to validate, use this in model_install to determine if need to run configurator

This commit is contained in:
psychedelicious
2024-03-11 23:16:21 +11:00
parent 9539ecce79
commit b8c46fb15b
2 changed files with 17 additions and 10 deletions

View File

@ -7,10 +7,14 @@ import sys
from invokeai.app.services.config import InvokeAIAppConfig
def validate_root_structure(config: InvokeAIAppConfig) -> None:
assert config.db_path.parent.exists(), f"{config.db_path.parent} not found"
assert config.models_path.exists(), f"{config.models_path} not found"
def check_invokeai_root(config: InvokeAIAppConfig):
try:
assert config.db_path.parent.exists(), f"{config.db_path.parent} not found"
assert config.models_path.exists(), f"{config.models_path} not found"
validate_root_structure(config)
except Exception as e:
print()
print(f"An exception has occurred: {str(e)}")