mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-07-19 22:57:31 +08:00
Update model_optimization_nodes.py
This commit is contained in:
parent
8d7a3a3bab
commit
9f7cf610da
@ -9,7 +9,12 @@ import comfy.model_management as mm
|
|||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
import importlib
|
import importlib
|
||||||
|
try:
|
||||||
from comfy_api.latest import io
|
from comfy_api.latest import io
|
||||||
|
v3_available = True
|
||||||
|
except ImportError:
|
||||||
|
v3_available = False
|
||||||
|
logging.warning("ComfyUI v3 node API not available, please update ComfyUI to access latest v3 nodes.")
|
||||||
|
|
||||||
sageattn_modes = ["disabled", "auto", "sageattn_qk_int8_pv_fp16_cuda", "sageattn_qk_int8_pv_fp16_triton", "sageattn_qk_int8_pv_fp8_cuda", "sageattn_qk_int8_pv_fp8_cuda++"]
|
sageattn_modes = ["disabled", "auto", "sageattn_qk_int8_pv_fp16_cuda", "sageattn_qk_int8_pv_fp16_triton", "sageattn_qk_int8_pv_fp8_cuda", "sageattn_qk_int8_pv_fp8_cuda++"]
|
||||||
|
|
||||||
@ -1913,10 +1918,13 @@ class CFGZeroStarAndInit:
|
|||||||
m.set_model_sampler_cfg_function(cfg_zerostar)
|
m.set_model_sampler_cfg_function(cfg_zerostar)
|
||||||
return (m, )
|
return (m, )
|
||||||
|
|
||||||
|
if v3_available:
|
||||||
class GGUFLoaderKJ(io.ComfyNode):
|
class GGUFLoaderKJ(io.ComfyNode):
|
||||||
|
gguf_nodes = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __init__(cls):
|
def _ensure_gguf_loaded(cls):
|
||||||
|
if cls.gguf_nodes is None:
|
||||||
try:
|
try:
|
||||||
cls.gguf_nodes = importlib.import_module("ComfyUI-GGUF")
|
cls.gguf_nodes = importlib.import_module("ComfyUI-GGUF")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -1927,6 +1935,7 @@ class GGUFLoaderKJ(io.ComfyNode):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
|
cls._ensure_gguf_loaded()
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
node_id="GGUFLoaderKJ",
|
node_id="GGUFLoaderKJ",
|
||||||
category="KJNodes/experimental",
|
category="KJNodes/experimental",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user