mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-13 23:04:40 +08:00
Update nodes.py
This commit is contained in:
parent
e285ea31b2
commit
b026acb17b
8
nodes.py
8
nodes.py
@ -479,13 +479,15 @@ class GetImageRangeFromBatch:
|
|||||||
return {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"images": ("IMAGE",),
|
"images": ("IMAGE",),
|
||||||
"start_index": ("INT", {"default": 1,"min": 0, "max": 4096, "step": 1}),
|
"start_index": ("INT", {"default": 0,"min": -1, "max": 4096, "step": 1}),
|
||||||
"num_frames": ("INT", {"default": 1,"min": 0, "max": 4096, "step": 1}),
|
"num_frames": ("INT", {"default": 1,"min": 1, "max": 4096, "step": 1}),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def imagesfrombatch(self, images, start_index, num_frames):
|
def imagesfrombatch(self, images, start_index, num_frames):
|
||||||
if start_index >= len(images):
|
if start_index == -1:
|
||||||
|
start_index = len(images) - num_frames
|
||||||
|
if start_index < 0 or start_index >= len(images):
|
||||||
raise ValueError("GetImageRangeFromBatch: Start index is out of range")
|
raise ValueError("GetImageRangeFromBatch: Start index is out of range")
|
||||||
end_index = start_index + num_frames
|
end_index = start_index + num_frames
|
||||||
if end_index > len(images):
|
if end_index > len(images):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user