Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions llada_gguf_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,30 @@ def _load_city96_modules():
importlib.import_module(alias + ".ops"),
)

comfy_root = Path(folder_paths.__file__).resolve().parent
custom_nodes = comfy_root / "custom_nodes"

custom_node_dirs = []
base_path_custom_nodes = getattr(folder_paths, "folder_names_and_paths", {}).get("custom_nodes")
if base_path_custom_nodes:
custom_node_dirs.extend(Path(p) for p in base_path_custom_nodes[0])
base_path = getattr(folder_paths, "base_path", None)
if base_path:
custom_node_dirs.append(Path(base_path) / "custom_nodes")
# Fall back to the ComfyUI install directory in case base_path isn't set.
custom_node_dirs.append(Path(folder_paths.__file__).resolve().parent / "custom_nodes")

seen = set()
candidates = []
for p in custom_nodes.iterdir() if custom_nodes.is_dir() else []:
if not p.is_dir():
for custom_nodes in custom_node_dirs:
custom_nodes = custom_nodes.resolve() if custom_nodes.is_dir() else custom_nodes
if custom_nodes in seen or not custom_nodes.is_dir():
continue
if (p / "loader.py").is_file() and (p / "dequant.py").is_file() and (p / "ops.py").is_file():
name = p.name.lower().replace("_", "-")
if "gguf" in name:
candidates.append(p)
seen.add(custom_nodes)
for p in custom_nodes.iterdir():
if not p.is_dir():
continue
if (p / "loader.py").is_file() and (p / "dequant.py").is_file() and (p / "ops.py").is_file():
name = p.name.lower().replace("_", "-")
if "gguf" in name:
candidates.append(p)

# Prefer the canonical City96 folder if present.
candidates.sort(key=lambda p: (0 if p.name.lower() == "comfyui-gguf" else 1, p.name.lower()))
Expand Down