mirror of
https://github.com/justUmen/Bjornulf_custom_nodes.git
synced 2026-03-21 20:52:11 -03:00
0.25
This commit is contained in:
26
loop_images.py
Normal file
26
loop_images.py
Normal file
@@ -0,0 +1,26 @@
|
||||
class LoopImages:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"number_of_images": ("INT", {"default": 2, "min": 1, "max": 10, "step": 1}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "loop_images"
|
||||
OUTPUT_IS_LIST = (True,)
|
||||
CATEGORY = "Bjornulf"
|
||||
|
||||
def loop_images(self, number_of_images, **kwargs):
|
||||
image_list = []
|
||||
for i in range(1, number_of_images + 1):
|
||||
image_key = f"image_{i}"
|
||||
if image_key in kwargs and kwargs[image_key] is not None:
|
||||
image_list.append(kwargs[image_key])
|
||||
return (image_list,)
|
||||
|
||||
@classmethod
|
||||
def IS_CHANGED(cls, number_of_images, ** kwargs):
|
||||
return float("nan") # This will force the node to always update
|
||||
|
||||
Reference in New Issue
Block a user