mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 06:40:48 +08:00
Fix subpath model downloads
This commit is contained in:
parent
a892411cf8
commit
74a9c45395
@ -33,7 +33,7 @@ def get_or_download(folder_name: str, filename: str, known_files: List[HuggingFi
|
||||
destination = folder_paths.get_folder_paths(folder_name)[0]
|
||||
known_file: Optional[HuggingFile | CivitFile] = None
|
||||
for candidate in known_files:
|
||||
if candidate.filename == filename or filename in candidate.alternate_filenames or filename == candidate.save_with_filename:
|
||||
if str(candidate) == filename or candidate.filename == filename or filename in candidate.alternate_filenames or filename == candidate.save_with_filename:
|
||||
known_file = candidate
|
||||
break
|
||||
if known_file is None:
|
||||
|
||||
@ -24,6 +24,8 @@ PROGRESS_BAR_HOOK = None
|
||||
def load_torch_file(ckpt, safe_load=False, device=None):
|
||||
if device is None:
|
||||
device = torch.device("cpu")
|
||||
if ckpt is None:
|
||||
raise FileNotFoundError("the checkpoint was not found")
|
||||
if ckpt.lower().endswith(".safetensors"):
|
||||
sd = safetensors.torch.load_file(ckpt, device=device.type)
|
||||
else:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user