chrisgoringe / cg-image-picker

241 stars 16 forks source link

IndexError: index 2 is out of bounds for dimension 0 with size 1 #88

Closed iiOxygen closed 6 months ago

iiOxygen commented 6 months ago

I'm trying to select an image from different samplers, but the below occurs when I try to progress one. am I trying to go too far?

Traceback (most recent call last):
  File "/home/jupyter/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/home/jupyter/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/home/jupyter/ComfyUI/execution.py", line 65, in map_node_over_list
    results.append(getattr(obj, func)(**input_data_all))
  File "/home/jupyter/ComfyUI/custom_nodes/cg-image-picker/image_chooser_preview.py", line 84, in func
    return self.batch_up_selections(images_in, latent_samples_in, selections, mode)
  File "/home/jupyter/ComfyUI/custom_nodes/cg-image-picker/image_chooser_preview.py", line 106, in batch_up_selections
    latents_out = self.latent_bundle(latent_samples_in, good)
  File "/home/jupyter/ComfyUI/custom_nodes/cg-image-picker/image_chooser_preview.py", line 91, in latent_bundle
    return { "samples" : self.tensor_bundle(latent_samples_in, picks) }
  File "/home/jupyter/ComfyUI/custom_nodes/cg-image-picker/image_chooser_preview.py", line 87, in tensor_bundle
    return torch.cat(tuple([tensor_in[(x)%self.batch].unsqueeze_(0) for x in picks])).reshape([-1]+list(tensor_in.shape[1:]))
  File "/home/jupyter/ComfyUI/custom_nodes/cg-image-picker/image_chooser_preview.py", line 87, in <listcomp>
    return torch.cat(tuple([tensor_in[(x)%self.batch].unsqueeze_(0) for x in picks])).reshape([-1]+list(tensor_in.shape[1:]))
IndexError: index 1 is out of bounds for dimension 0 with size 1

image

iiOxygen commented 6 months ago

well, linking the batch latent with it works, for some reason? image

chrisgoringe commented 6 months ago

If you look carefully at the first case, the latent input, though not connected, is getting a latent via a use everywhere node.

So the image picker was getting a different batch size of images and latents.

On Wed, 20 Mar 2024 at 11:10 pm, iiOxygen @.***> wrote:

well, linking the batch latent with it works, for some reason? image.png (view on web) https://github.com/chrisgoringe/cg-image-picker/assets/142164755/3e684e19-439d-47db-bd71-3b9109dbae07

— Reply to this email directly, view it on GitHub https://github.com/chrisgoringe/cg-image-picker/issues/88#issuecomment-2009420218, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBLMA65GQ7E7B4M5JS65K3YZF4BZAVCNFSM6AAAAABE7JPT3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBZGQZDAMRRHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>