Skip to content

Commit 39c14eb

Browse files
author
Lincoln Stein
committed
fix pretrained model download to work with xl
1 parent e943913 commit 39c14eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

invokeai/backend/install/model_install_backend.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import List, Dict, Callable, Union, Set
1111

1212
import requests
13-
from diffusers import StableDiffusionPipeline
13+
from diffusers import DiffusionPipeline
1414
from diffusers import logging as dlogging
1515
from huggingface_hub import hf_hub_url, HfFolder, HfApi
1616
from omegaconf import OmegaConf
@@ -310,6 +310,8 @@ def _get_model_name(self,path_name: str, location: Path)->str:
310310
if key := self.reverse_paths.get(path_name):
311311
(name, base, mtype) = ModelManager.parse_key(key)
312312
return name
313+
elif location.is_dir():
314+
return location.name
313315
else:
314316
return location.stem
315317

@@ -365,7 +367,7 @@ def _download_hf_pipeline(self, repo_id: str, staging: Path)->Path:
365367
model = None
366368
for revision in revisions:
367369
try:
368-
model = StableDiffusionPipeline.from_pretrained(repo_id,revision=revision,safety_checker=None)
370+
model = DiffusionPipeline.from_pretrained(repo_id,revision=revision,safety_checker=None)
369371
except: # most errors are due to fp16 not being present. Fix this to catch other errors
370372
pass
371373
if model:

0 commit comments

Comments
 (0)