code: def pad_image(input_image):
      pad_w, pad_h = (
          np.max(
              (
                  (2, 2),
                  np.ceil(np.array(input_image.size) / 64).astype(int),
              ),
              axis=0,
          )
          * 64
          - input_image.size
      )
      im_padded = Image.fromarray(
          np.pad(
              np.array(input_image),
              ((0, pad_h), (0, pad_w), (0, 0)),
              mode="edge",
          )
      )
      return im_padded
  
file_path: StableDiffusion/scripts/gradio/inpainting.py
imports: import sys
  import cv2
  import torch
  import numpy
  import gradio
  from PIL import Image
  from omegaconf import OmegaConf
  from einops import repeat
  from imwatermark import WatermarkEncoder
  from pathlib import Path
  from ldm.models.diffusion.ddim import DDIMSampler
  from ldm.util import instantiate_from_config
label_desc: Use image node_id 5 for calling a global function with example usage: pad_image(input_image) and returns: im_padded