mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 21:04:41 +08:00
Add start/end levels
This commit is contained in:
parent
488b444b2d
commit
e74c2b034a
9
nodes.py
9
nodes.py
@ -136,13 +136,12 @@ class CreateFadeMask:
|
||||
"width": ("INT", {"default": 256,"min": 16, "max": 4096, "step": 1}),
|
||||
"height": ("INT", {"default": 256,"min": 16, "max": 4096, "step": 1}),
|
||||
"interpolation": (["linear", "ease_in", "ease_out", "ease_in_out"],),
|
||||
"start_level": ("FLOAT", {"default": 1.0,"min": 0.0, "max": 1.0, "step": 0.01}),
|
||||
"end_level": ("FLOAT", {"default": 0.0,"min": 0.0, "max": 1.0, "step": 0.01}),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
def createfademask(self, frames, width, height, invert, interpolation):
|
||||
def createfademask(self, frames, width, height, invert, interpolation, start_level, end_level):
|
||||
def ease_in(t):
|
||||
return t * t
|
||||
|
||||
@ -166,7 +165,7 @@ class CreateFadeMask:
|
||||
elif interpolation == "ease_in_out":
|
||||
t = ease_in_out(t)
|
||||
|
||||
color = 1.0 - t
|
||||
color = start_level - t * (start_level - end_level)
|
||||
image = np.full((height, width), color, dtype=np.float32)
|
||||
image_batch[i] = image
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user