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/depth2img.py
imports: import sys
  import torch
  import numpy
  import gradio
  from PIL import Image
  from omegaconf import OmegaConf
  from einops import repeat, rearrange
  from pytorch_lightning import seed_everything
  from imwatermark import WatermarkEncoder
  from scripts.txt2img import put_watermark
  from ldm.util import instantiate_from_config
  from ldm.models.diffusion.ddim import DDIMSampler
  from ldm.data.util import AddMiDaS
label_desc: Use image node_id 4 for calling a global function with example usage: pad_image(input_image) and returns: im_padded