code: def get_input_image_tensor(image: Image.Image, device="cuda"):
      w, h = image.size
      print(f"loaded input image of size ({w}, {h})")
      width, height = map(
          lambda x: x - x % 64, (w, h)
      )  # resize to integer multiple of 64
      image = image.resize((width, height))
      image_array = np.array(image.convert("RGB"))
      image_array = image_array[None].transpose(0, 3, 1, 2)
      image_tensor = (
          torch.from_numpy(image_array).to(dtype=torch.float32) / 127.5
          - 1.0
      )
      return image_tensor.to(device)
  
imports: import math
  import os
  from typing import List, Optional, Union
  import numpy
  import torch
  from einops import rearrange
  from imwatermark import WatermarkEncoder
  from omegaconf import ListConfig
  from PIL import Image
  from torch import autocast
  from sgm.util import append_dims
label_desc: Use image node_id 5 for calling a global function with example usage: get_input_image_tensor(image, device) and returns: image_tensor