Skip to content

Commit fdaddaf

Browse files
fix(mm): only add suffix to model paths when path is file
1 parent 23d59ab commit fdaddaf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

invokeai/app/services/model_install/model_install_default.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ def install_path(
186186
info: AnyModelConfig = self._probe(Path(model_path), config) # type: ignore
187187

188188
if preferred_name := config.name:
189-
# Careful! Don't use pathlib.Path(...).with_suffix - it can will strip everything after the first dot.
190-
preferred_name = f"{preferred_name}{model_path.suffix}"
189+
if Path(model_path).is_file():
190+
# Careful! Don't use pathlib.Path(...).with_suffix - it can will strip everything after the first dot.
191+
preferred_name = f"{preferred_name}{model_path.suffix}"
191192

192193
dest_path = (
193194
self.app_config.models_path / info.base.value / info.type.value / (preferred_name or model_path.name)

0 commit comments

Comments
 (0)