Vision (Auto)Processor not accepting multiple images.
Author: c1ekrt
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 4.45.2
- Platform: Windows-10-10.0.22621-SP0
- Python version: 3.10.15
- Huggingface_hub version: 0.26.1
- Safetensors version: 0.4.5
- Accelerate version: 1.0.1
- Accelerate config:    - compute_environment: LOCAL_MACHINE
        - distributed_type: NO
        - mixed_precision: no
        - use_cpu: False
        - debug: False
        - num_processes: 1
        - machine_rank: 0
        - num_machines: 1
        - gpu_ids: all
        - rdzv_backend: static
        - same_network: True
        - main_training_function: main
        - enable_cpu_affinity: False
        - downcast_bf16: no
        - tpu_use_cluster: False
        - tpu_use_sudo: False
        - tpu_env: []
- PyTorch version (GPU?): 2.5.0+cu118 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: No
- Using GPU in script?: No
- GPU type: NVIDIA GeForce GTX 1080 Ti

### Who can help?

@amyeroberts @qub

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

```
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
from PIL import Image
import requests
import torch
from typing import List

model_id = "google/paligemma-3b-ft-nlvr2-448"  # checkpoint tuned for multiple images
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
processor = AutoProcessor.from_pretrained(model_id)

prompt = "answer en Which of the two pictures shows a snowman, first or second?"
stop_sign_image = Image.open(
    requests.get("https://www.ilankelman.org/stopsigns/australia.jpg", stream=True).raw
)
snow_image = Image.open(
    requests.get(
        "https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/snowman.jpg", stream=True
    ).raw
)
print(type(stop_sign_image))
print(type(snow_image))

inputs = processor(images=[[snow_image, stop_sign_image]], text=prompt, return_tensors="pt")

output = model.generate(**inputs, max_new_tokens=20)
print(processor.decode(output[0], skip_special_tokens=True)[inputs.input_ids.shape[1]: ])
```

Running the code got the error:

```
Loading checkpoint shards: 100%|██████████| 3/3 [00:00<00:00,  6.89it/s]
<class 'PIL.JpegImagePlugin.JpegImageFile'>
<class 'PIL.JpegImagePlugin.JpegImageFile'>
Traceback (most recent call last):

  File ~\AppData\Local\anaconda3\envs\GenericDiffusion\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File d:\paligemma\inference_multi.py:29
    inputs = processor(images=[[snow_image, stop_sign_image]], text=prompt, return_tensors="pt")

  File ~\AppData\Local\anaconda3\envs\GenericDiffusion\lib\site-packages\transformers\models\paligemma\processing_paligemma.py:257 in __call__
    pixel_values = self.image_processor(images, **output_kwargs["images_kwargs"])["pixel_values"]

  File ~\AppData\Local\anaconda3\envs\GenericDiffusion\lib\site-packages\transformers\image_processing_utils.py:41 in __call__
    return self.preprocess(images, **kwargs)

  File ~\AppData\Local\anaconda3\envs\GenericDiffusion\lib\site-packages\transformers\utils\generic.py:852 in wrapper
    return func(*args, **valid_kwargs)

  File ~\AppData\Local\anaconda3\envs\GenericDiffusion\lib\site-packages\transformers\models\siglip\image_processing_siglip.py:184 in preprocess
    images = make_list_of_images(images)

  File ~\AppData\Local\anaconda3\envs\GenericDiffusion\lib\site-packages\transformers\image_utils.py:205 in make_list_of_images
    raise ValueError(

ValueError: Invalid image type. Expected either PIL.Image.Image, numpy.ndarray, torch.Tensor, tf.Tensor or jax.ndarray, but got <class 'list'>.
```


### Expected behavior

This code is the slightly modified version of huggingface [PaliGemma](https://huggingface.co/docs/transformers/main/model_doc/paligemma) multi-image inference example code.

According to the image_utils.py, ImageInput should accept 
`images=[[snow_image, stop_sign_image]]`
as an input
However, error occured. 


Comments:
Hey @c1ekrt ! 

Support for multi-image input in Paligemma was added in https://github.com/huggingface/transformers/pull/33447 and it is recommended to use specific checkpoints for that or fine-tune the model on your data, otherwise the model doesn't seem to perform well on multiple image reasoning

Can you try with the latest release? It works for me and seems to be added only in v4.46


Updating works, closing this issue.