MCPcopy Create free account
hub / github.com/city96/ComfyUI-GGUF / update_folder_names_and_paths

Function update_folder_names_and_paths

nodes.py:20–29  ·  view source on GitHub ↗
(key, targets=[])

Source from the content-addressed store, hash-verified

18from .dequant import is_quantized, is_torch_compatible
19
20def update_folder_names_and_paths(key, targets=[]):
21 # check for existing key
22 base = folder_paths.folder_names_and_paths.get(key, ([], {}))
23 base = base[0] if isinstance(base[0], (list, set, tuple)) else []
24 # find base key & add w/ fallback, sanity check + warning
25 target = next((x for x in targets if x in folder_paths.folder_names_and_paths), targets[0])
26 orig, _ = folder_paths.folder_names_and_paths.get(target, ([], {}))
27 folder_paths.folder_names_and_paths[key] = (orig or base, {".gguf"})
28 if base and base != orig:
29 logging.warning(f"Unknown file list already present on key {key}: {base}")
30
31# Add a custom keys for files ending in .gguf
32update_folder_names_and_paths("unet_gguf", ["diffusion_models", "unet"])

Callers 1

nodes.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected