code: def make_batch(image, mask, device):
      image = np.array(Image.open(image).convert("RGB"))
      image = image.astype(np.float32) / 255.0
      image = image[None].transpose(0, 3, 1, 2)
      image = torch.from_numpy(image)
  
      mask = np.array(Image.open(mask).convert("L"))
      mask = mask.astype(np.float32) / 255.0
      mask = mask[None, None]
      mask[mask < 0.5] = 0
      mask[mask >= 0.5] = 1
      mask = torch.from_numpy(mask)
  
      masked_image = (1 - mask) * image
  
      batch = {
          "image": image,
          "mask": mask,
          "masked_image": masked_image,
      }
      for k in batch:
          batch[k] = batch[k].to(device=device)
          batch[k] = batch[k] * 2.0 - 1.0
      return batch
  
file_path: compvis-stable-diffusion/scripts/inpaint.py
imports: import argparse, os, sys, glob
  from omegaconf import OmegaConf
  from PIL import Image
  from tqdm import tqdm
  import numpy
  import torch
  from main import instantiate_from_config
  from ldm.models.diffusion.ddim import DDIMSampler
label_desc: Use image node_id 1 for calling a global function with example usage: make_batch(image, mask, device) and returns: batch