rename WanVideoTeaCache -> WanVideoTeaCacheKJ to avoid clash with wrapper

This commit is contained in:
kijai 2025-03-03 16:55:56 +02:00
parent 3b0d20532f
commit 60abdef03e
3 changed files with 47 additions and 2 deletions

View File

@ -183,7 +183,8 @@ NODE_CONFIG = {
"ScheduledCFGGuidance": {"class": ScheduledCFGGuidance, "name": "Scheduled CFG Guidance"},
"ApplyRifleXRoPE_HunuyanVideo": {"class": ApplyRifleXRoPE_HunuyanVideo, "name": "Apply RifleXRoPE HunuyanVideo"},
"ApplyRifleXRoPE_WanVideo": {"class": ApplyRifleXRoPE_WanVideo, "name": "Apply RifleXRoPE WanVideo"},
"WanVideoTeaCache": {"class": WanVideoTeaCache, "name": "WanVideo Tea Cache"},
"WanVideoTeaCacheKJ": {"class": WanVideoTeaCacheKJ, "name": "WanVideo Tea Cache"},
"TimerNodeKJ": {"class": TimerNodeKJ, "name": "Timer Node KJ"},
#instance diffusion
"CreateInstanceDiffusionTracking": {"class": CreateInstanceDiffusionTracking},

View File

@ -788,7 +788,7 @@ def teacache_wanvideo_forward_orig(self, x, t, context, clip_fea=None, freqs=Non
x = self.unpatchify(x, grid_sizes)
return x
class WanVideoTeaCache:
class WanVideoTeaCacheKJ:
@classmethod
def INPUT_TYPES(s):
return {

View File

@ -2601,3 +2601,47 @@ class EmbedND_RifleX(nn.Module):
dim=-3,
)
return emb.unsqueeze(1)
class Timer:
def __init__(self, name):
self.name = name
self.start_time = None
self.elapsed = 0
class TimerNodeKJ:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"any_input": (any, {}),
"mode": (["start", "stop"],),
"name": ("STRING", {"default": "Timer"}),
},
"optional": {
"timer": ("TIMER",),
},
}
RETURN_TYPES = (any, "TIMER", "INT", )
RETURN_NAMES = ("any_output", "timer", "time")
FUNCTION = "timer"
CATEGORY = "KJNodes/misc"
def timer(self, mode, name, any_input=None, timer=None):
if timer is None:
if mode == "start":
timer = Timer(name=name)
timer.start_time = time.time()
return {"ui": {
"text": [f"{timer.start_time}"]},
"result": (any_input, timer, 0)
}
elif mode == "stop" and timer is not None:
end_time = time.time()
timer.elapsed = int((end_time - timer.start_time) * 1000)
timer.start_time = None
return (any_input, timer, timer.elapsed)