mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-06-03 15:53:32 +08:00
more robust GGUF node detection
This commit is contained in:
parent
3765985982
commit
e81f33508b
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
from comfy.ldm.modules import attention as comfy_attention
|
from comfy.ldm.modules import attention as comfy_attention
|
||||||
import logging
|
import logging
|
||||||
import comfy.model_patcher
|
import comfy.model_patcher
|
||||||
@ -1963,14 +1964,19 @@ if v3_available:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_gguf_module(cls):
|
def _get_gguf_module(cls):
|
||||||
"""Lazy import of GGUF module with fallback options"""
|
gguf_path = os.path.join(folder_paths.folder_names_and_paths["custom_nodes"][0][0], "ComfyUI-GGUF")
|
||||||
try:
|
"""Import GGUF module with version validation"""
|
||||||
return importlib.import_module("ComfyUI-GGUF")
|
for module_name in ["ComfyUI-GGUF", "custom_nodes.ComfyUI-GGUF", "comfyui-gguf", "custom_nodes.comfyui-gguf", gguf_path, gguf_path.lower()]:
|
||||||
except ImportError:
|
|
||||||
try:
|
try:
|
||||||
return importlib.import_module("comfyui-gguf")
|
module = importlib.import_module(module_name)
|
||||||
|
return module
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError("This node requires ComfyUI-GGUF to be installed.")
|
continue
|
||||||
|
|
||||||
|
raise ImportError(
|
||||||
|
"Compatible ComfyUI-GGUF not found. "
|
||||||
|
"Please install/update from: https://github.com/city96/ComfyUI-GGUF"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user