mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 12:54:40 +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"},
|
||||
"StyleModelApplyAdvanced": {"class": StyleModelApplyAdvanced, "name": "Style Model Apply Advanced"},
|
||||
"DiffusionModelSelector": {"class": DiffusionModelSelector, "name": "Diffusion Model Selector"},
|
||||
"LazySwitchKJ": {"class": LazySwitchKJ, "name": "Lazy Switch KJ"},
|
||||
#audioscheduler stuff
|
||||
"NormalizedAmplitudeToMask": {"class": NormalizedAmplitudeToMask},
|
||||
"NormalizedAmplitudeToFloatList": {"class": NormalizedAmplitudeToFloatList},
|
||||
|
||||
@ -2592,4 +2592,34 @@ class HunyuanVideoEncodeKeyframesToCond:
|
||||
out.append(c)
|
||||
if len(out) == 1:
|
||||
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