mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-07-19 10:57:11 +08:00
Add LazySwitchKJ
This commit is contained in:
parent
6dfd2c2420
commit
b37122a9fd
@ -136,6 +136,7 @@ NODE_CONFIG = {
|
|||||||
"SetShakkerLabsUnionControlNetType": {"class": SetShakkerLabsUnionControlNetType, "name": "Set Shakker Labs Union ControlNet Type"},
|
"SetShakkerLabsUnionControlNetType": {"class": SetShakkerLabsUnionControlNetType, "name": "Set Shakker Labs Union ControlNet Type"},
|
||||||
"StyleModelApplyAdvanced": {"class": StyleModelApplyAdvanced, "name": "Style Model Apply Advanced"},
|
"StyleModelApplyAdvanced": {"class": StyleModelApplyAdvanced, "name": "Style Model Apply Advanced"},
|
||||||
"DiffusionModelSelector": {"class": DiffusionModelSelector, "name": "Diffusion Model Selector"},
|
"DiffusionModelSelector": {"class": DiffusionModelSelector, "name": "Diffusion Model Selector"},
|
||||||
|
"LazySwitchKJ": {"class": LazySwitchKJ, "name": "Lazy Switch KJ"},
|
||||||
#audioscheduler stuff
|
#audioscheduler stuff
|
||||||
"NormalizedAmplitudeToMask": {"class": NormalizedAmplitudeToMask},
|
"NormalizedAmplitudeToMask": {"class": NormalizedAmplitudeToMask},
|
||||||
"NormalizedAmplitudeToFloatList": {"class": NormalizedAmplitudeToFloatList},
|
"NormalizedAmplitudeToFloatList": {"class": NormalizedAmplitudeToFloatList},
|
||||||
|
|||||||
@ -2592,4 +2592,34 @@ class HunyuanVideoEncodeKeyframesToCond:
|
|||||||
out.append(c)
|
out.append(c)
|
||||||
if len(out) == 1:
|
if len(out) == 1:
|
||||||
out.append(out[0])
|
out.append(out[0])
|
||||||
return (model_clone, out[0], out[1], out_latent)
|
return (model_clone, out[0], out[1], out_latent)
|
||||||
|
|
||||||
|
|
||||||
|
class LazySwitchKJ:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"switch": ("BOOLEAN",),
|
||||||
|
"on_false": (IO.ANY, {"lazy": True}),
|
||||||
|
"on_true": (IO.ANY, {"lazy": True}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = (IO.ANY,)
|
||||||
|
FUNCTION = "switch"
|
||||||
|
CATEGORY = "KJNodes/misc"
|
||||||
|
DESCRIPTION = "Controls flow of execution based on a boolean switch."
|
||||||
|
|
||||||
|
def check_lazy_status(self, switch, on_false=None, on_true=None):
|
||||||
|
if switch and on_true is None:
|
||||||
|
return ["on_true"]
|
||||||
|
if not switch and on_false is None:
|
||||||
|
return ["on_false"]
|
||||||
|
|
||||||
|
def switch(self, switch, on_false = None, on_true=None):
|
||||||
|
value = on_true if switch else on_false
|
||||||
|
return (value,)
|
||||||
Loading…
x
Reference in New Issue
Block a user