mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-04-02 15:47:01 +08:00
Update image_nodes.py
This commit is contained in:
parent
3d6b72f28d
commit
5b8d419c6f
@ -1585,14 +1585,13 @@ Randomizes image order within a batch.
|
||||
}
|
||||
|
||||
def imagesfrombatch(self, start_index, num_frames, images=None, masks=None):
|
||||
|
||||
chosen_images = None
|
||||
chosen_masks = None
|
||||
|
||||
# Process images if provided
|
||||
if images is not None:
|
||||
if start_index == -1:
|
||||
start_index = len(images) - num_frames
|
||||
start_index = max(0, len(images) - num_frames)
|
||||
if start_index < 0 or start_index >= len(images):
|
||||
raise ValueError("Start index is out of range")
|
||||
end_index = start_index + num_frames
|
||||
@ -1603,7 +1602,7 @@ Randomizes image order within a batch.
|
||||
# Process masks if provided
|
||||
if masks is not None:
|
||||
if start_index == -1:
|
||||
start_index = len(masks) - num_frames
|
||||
start_index = max(0, len(masks) - num_frames)
|
||||
if start_index < 0 or start_index >= len(masks):
|
||||
raise ValueError("Start index is out of range for masks")
|
||||
end_index = start_index + num_frames
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user