mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Remove instances making models relative to the model dir
This commit is contained in:
parent
b1f5ac4548
commit
6e2cef1db5
@ -493,7 +493,7 @@ class ModelInstallService(ModelInstallServiceBase):
|
||||
self._logger.info(f"Scanning {self._app_config.models_path} for new and orphaned models")
|
||||
for cur_base_model in BaseModelType:
|
||||
for cur_model_type in ModelType:
|
||||
models_dir = Path(cur_base_model.value, cur_model_type.value)
|
||||
models_dir = self._app_config.models_path / Path(cur_base_model.value, cur_model_type.value)
|
||||
installed.update(self.scan_directory(models_dir))
|
||||
self._logger.info(f"{len(installed)} new models registered; {len(defunct_models)} unregistered")
|
||||
|
||||
@ -518,7 +518,7 @@ class ModelInstallService(ModelInstallServiceBase):
|
||||
new_path = models_dir / model.base.value / model.type.value / model.name
|
||||
self._logger.info(f"Moving {model.name} to {new_path}.")
|
||||
new_path = self._move_model(old_path, new_path)
|
||||
model.path = new_path.relative_to(models_dir).as_posix()
|
||||
model.path = new_path.as_posix()
|
||||
self.record_store.update_model(key, ModelRecordChanges(path=model.path))
|
||||
return model
|
||||
|
||||
@ -581,9 +581,6 @@ class ModelInstallService(ModelInstallServiceBase):
|
||||
|
||||
info = info or ModelProbe.probe(model_path, config)
|
||||
|
||||
if not model_path.is_absolute():
|
||||
model_path = (self._app_config.models_path / model_path)
|
||||
|
||||
model_path = model_path.resolve()
|
||||
|
||||
info.path = model_path.as_posix()
|
||||
|
Loading…
Reference in New Issue
Block a user