Skip to content

Commit ec0a832

Browse files
authored
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. (Comfy-Org#11755)
1 parent 04c49a2 commit ec0a832

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/assets/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def get_comfy_models_folders() -> list[tuple[str, list[str]]]:
8181
"""
8282
targets: list[tuple[str, list[str]]] = []
8383
models_root = os.path.abspath(folder_paths.models_dir)
84-
for name, (paths, _exts) in folder_paths.folder_names_and_paths.items():
84+
for name, values in folder_paths.folder_names_and_paths.items():
85+
paths, _exts = values[0], values[1] # NOTE: this prevents nodepacks that hackily edit folder_... from breaking ComfyUI
8586
if any(os.path.abspath(p).startswith(models_root + os.sep) for p in paths):
8687
targets.append((name, paths))
8788
return targets

0 commit comments

Comments
 (0)