1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

add simple error check to model loading (#4950)

This commit is contained in:
Alex "mcmonkey" Goodwin
2024-09-17 16:57:17 +09:00
committed by GitHub
parent 0b7dfa986d
commit 254838f23c
7 changed files with 31 additions and 23 deletions

View File

@@ -235,6 +235,14 @@ def get_full_path(folder_name: str, filename: str) -> str | None:
return None
def get_full_path_or_raise(folder_name: str, filename: str) -> str:
full_path = get_full_path(folder_name, filename)
if full_path is None:
raise FileNotFoundError(f"Model in folder '{folder_name}' with filename '{filename}' not found.")
return full_path
def get_filename_list_(folder_name: str) -> tuple[list[str], dict[str, float], float]:
folder_name = map_legacy(folder_name)
global folder_names_and_paths