code: def _preprocess_image(
      image: Union[List, PIL.Image.Image, torch.Tensor]
  ):
      deprecation_message = "The preprocess method is deprecated and will be removed in diffusers 1.0.0. Please use VaeImageProcessor.preprocess(...) instead"
      deprecate(
          "preprocess",
          "1.0.0",
          deprecation_message,
          standard_warn=False,
      )
      if isinstance(image, torch.Tensor):
          return image
      elif isinstance(image, PIL.Image.Image):
          image = [image]
  
      if isinstance(image[0], PIL.Image.Image):
          w, h = image[0].size
          w, h = (
              x - x % 8 for x in (w, h)
          )  # resize to integer multiple of 8
  
          image = [
              np.array(
                  i.resize(
                      (w, h), resample=PIL_INTERPOLATION["lanczos"]
                  )
              )[None, :]
              for i in image
          ]
          image = np.concatenate(image, axis=0)
          image = np.array(image).astype(np.float32) / 255.0
          image = image.transpose(0, 3, 1, 2)
          image = 2.0 * image - 1.0
          image = torch.from_numpy(image)
      elif isinstance(image[0], torch.Tensor):
          image = torch.cat(image, dim=0)
      return image
  
file_path: llmga/llmga/diffusers/src/diffusers/pipelines/repaint/pipeline_repaint.py
imports: from typing import List, Optional, Tuple, Union
  import numpy
  import PIL.Image
  import torch
  from ...models import UNet2DModel
  from ...schedulers import RePaintScheduler
  from ...utils import PIL_INTERPOLATION, deprecate, logging
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
label_desc: Use image node_id 1 for calling a global function with example usage: _preprocess_image(image) and returns: image, image