code: def esrgan_upscale(model, img):
      if opts.ESRGAN_tile == 0:
          return upscale_without_tiling(model, img)
  
      grid = images.split_grid(
          img,
          opts.ESRGAN_tile,
          opts.ESRGAN_tile,
          opts.ESRGAN_tile_overlap,
      )
      newtiles = []
      scale_factor = 1
  
      for y, h, row in grid.tiles:
          newrow = []
          for tiledata in row:
              x, w, tile = tiledata
  
              output = upscale_without_tiling(model, tile)
              scale_factor = output.width // tile.width
  
              newrow.append(
                  [x * scale_factor, w * scale_factor, output]
              )
          newtiles.append([y * scale_factor, h * scale_factor, newrow])
  
      newgrid = images.Grid(
          newtiles,
          grid.tile_w * scale_factor,
          grid.tile_h * scale_factor,
          grid.image_w * scale_factor,
          grid.image_h * scale_factor,
          grid.overlap * scale_factor,
      )
      output = images.combine_grid(newgrid)
      return output
  
file_path: stable-diffusion-webui/modules/esrgan_model.py
imports: import sys
  import numpy
  import torch
  from PIL import Image
  import modules.esrgan_model_arch
  from modules import modelloader, images, devices
  from modules.shared import opts
  from modules.upscaler import Upscaler, UpscalerData
label_desc: Use image node_id 5 for calling a global function with example usage: esrgan_upscale(model, img) and returns: output, upscale_without_tiling