mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-26 19:19:53 +00:00
Add workaround for hacky nodepack(s) that edit folder_names_and_paths to have values with tuples of more than 2. Other things could potentially break with those nodepack(s), so I will hunt for the guilty nodepack(s) now. (#11755)
This commit is contained in:
@@ -81,7 +81,8 @@ def get_comfy_models_folders() -> list[tuple[str, list[str]]]:
|
|||||||
"""
|
"""
|
||||||
targets: list[tuple[str, list[str]]] = []
|
targets: list[tuple[str, list[str]]] = []
|
||||||
models_root = os.path.abspath(folder_paths.models_dir)
|
models_root = os.path.abspath(folder_paths.models_dir)
|
||||||
for name, (paths, _exts) in folder_paths.folder_names_and_paths.items():
|
for name, values in folder_paths.folder_names_and_paths.items():
|
||||||
|
paths, _exts = values[0], values[1] # NOTE: this prevents nodepacks that hackily edit folder_... from breaking ComfyUI
|
||||||
if any(os.path.abspath(p).startswith(models_root + os.sep) for p in paths):
|
if any(os.path.abspath(p).startswith(models_root + os.sep) for p in paths):
|
||||||
targets.append((name, paths))
|
targets.append((name, paths))
|
||||||
return targets
|
return targets
|
||||||
|
|||||||
Reference in New Issue
Block a user