mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix install of models with relative paths
This commit is contained in:
@ -388,6 +388,11 @@ class ModelInstall(ModelInstallBase):
|
||||
|
||||
def _register(self, model_path: Path, info: ModelProbeInfo) -> str:
|
||||
key: str = FastModelHash.hash(model_path)
|
||||
|
||||
model_path = model_path.absolute()
|
||||
if model_path.is_relative_to(self._app_config.models_path):
|
||||
model_path = model_path.relative_to(self._app_config.models_path)
|
||||
|
||||
registration_data = dict(
|
||||
path=model_path.as_posix(),
|
||||
name=model_path.name if model_path.is_dir() else model_path.stem,
|
||||
|
@ -537,7 +537,7 @@ def list_models(installer: ModelInstall, model_type: ModelType):
|
||||
print(f"Installed models of type `{model_type}`:")
|
||||
for model in models:
|
||||
path = (config.models_path / model.path).resolve()
|
||||
print(f"{model.name:40}{model.base_model:10}{path}")
|
||||
print(f"{model.name:40}{model.base_model.value:14}{path}")
|
||||
|
||||
|
||||
class TqdmProgress(object):
|
||||
|
Reference in New Issue
Block a user