mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(config): edge cases in models.yaml migration
When running the configurator, the `legacy_models_conf_path` was stripped when saving the config file. Then the migration logic didn't fire correctly, and the custom models.yaml paths weren't migrated into the db. - Rework the logic to migrate this path by adding it to the config object as a normal field that is not excluded from serialization. - Rearrange the models.yaml migration logic to remove the legacy path after migrating, then write the config file. This way, the legacy path doesn't stick around. - Move the schema version into the config object. - Back up the config file before attempting migration. - Add tests to cover this edge case
This commit is contained in:
@ -34,6 +34,7 @@ from transformers import AutoFeatureExtractor
|
||||
|
||||
import invokeai.configs as model_configs
|
||||
from invokeai.app.services.config import InvokeAIAppConfig
|
||||
from invokeai.app.services.config.config_default import get_config
|
||||
from invokeai.backend.install.install_helper import InstallHelper, InstallSelections
|
||||
from invokeai.backend.model_manager import ModelType
|
||||
from invokeai.backend.util import choose_precision, choose_torch_device
|
||||
@ -63,8 +64,7 @@ def get_literal_fields(field: str) -> Tuple[Any]:
|
||||
|
||||
# --------------------------globals-----------------------
|
||||
|
||||
# Start from a fresh config object - we will read the user's config from file later, and update it with their choices
|
||||
config = InvokeAIAppConfig()
|
||||
config = get_config()
|
||||
|
||||
PRECISION_CHOICES = get_literal_fields("precision")
|
||||
DEVICE_CHOICES = get_literal_fields("device")
|
||||
|
Reference in New Issue
Block a user