Add ModelPassThrough -node

This commit is contained in:
kijai 2024-05-09 19:14:05 +03:00
parent 916241840a
commit 148c805a15
2 changed files with 22 additions and 0 deletions

View File

@ -90,6 +90,7 @@ NODE_CONFIG = {
"VRAM_Debug": {"class": VRAM_Debug, "name": "VRAM Debug"},
"SomethingToString": {"class": SomethingToString, "name": "Something To String"},
"EmptyLatentImagePresets": {"class": EmptyLatentImagePresets, "name": "Empty Latent Image Presets"},
"ModelPassThrough": {"class": ModelPassThrough, "name": "ModelPass"},
#audioscheduler stuff
"NormalizedAmplitudeToMask": {"class": NormalizedAmplitudeToMask},
"NormalizedAmplitudeToFloatList": {"class": NormalizedAmplitudeToFloatList},

View File

@ -280,6 +280,27 @@ class CondPassThrough:
def passthrough(self, positive, negative):
return (positive, negative,)
class ModelPassThrough:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"model": ("MODEL", ),
},
}
RETURN_TYPES = ("MODEL", )
RETURN_NAMES = ("model",)
FUNCTION = "passthrough"
CATEGORY = "KJNodes/misc"
DESCRIPTION = """
Simply passes through the model,
workaround for Set node not allowing bypassed inputs.
"""
def passthrough(self, model):
return (model,)
def append_helper(t, mask, c, set_area_to_bounds, strength):
n = [t[0], t[1].copy()]
_, h, w = mask.shape