Skip to content

Commit 6fc6be3

Browse files
David Hauptmanpsychedelicious
authored andcommitted
Fix error message when adding a local path with quotes around the string
1 parent 174ea02 commit 6fc6be3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

invokeai/app/services/model_install/model_install_default.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,10 @@ def _guess_source(self, source: str) -> ModelSource:
438438
variants = "|".join(ModelRepoVariant.__members__.values())
439439
hf_repoid_re = f"^([^/:]+/[^/:]+)(?::({variants})?(?::/?([^:]+))?)?$"
440440
source_obj: Optional[StringLikeSource] = None
441+
source_stripped = source.strip('\"') # Strip possible quotes from source string to avoid later errors with local files or directories
441442

442-
if Path(source).exists(): # A local file or directory
443-
source_obj = LocalModelSource(path=Path(source))
443+
if Path(source_stripped).exists(): # A local file or directory
444+
source_obj = LocalModelSource(path=Path(source_stripped))
444445
elif match := re.match(hf_repoid_re, source):
445446
source_obj = HFModelSource(
446447
repo_id=match.group(1),

0 commit comments

Comments
 (0)