Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

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)

Jedrzej Kosinskiec0a832acb25
diff --git a/app/assets/helpers.py b/app/assets/helpers.py
index 6755d0e56..08b465b5a 100644
--- a/app/assets/helpers.py
+++ b/app/assets/helpers.py
@@ -81,7 +81,8 @@ def get_comfy_models_folders() -> list[tuple[str, list[str]]]:
"""
targets: list[tuple[str, list[str]]] = []
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):
targets.append((name, paths))
return targets