mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-01-24 00:24:32 +08:00
rename WanVideoTeaCache -> WanVideoTeaCacheKJ to avoid clash with wrapper
This commit is contained in:
parent
3b0d20532f
commit
60abdef03e
@ -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},
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user