code: def load_model(self, path: str):
      if path.startswith("http"):
          # TODO: this doesn't use `path` at all?
          filename = modelloader.load_file_from_url(
              url=self.model_url,
              model_dir=self.model_download_path,
              file_name=f"{self.model_name}.pth",
          )
      else:
          filename = path
  
      state_dict = torch.load(
          filename,
          map_location="cpu"
          if devices.device_esrgan.type == "mps"
          else None,
      )
  
      if "params_ema" in state_dict:
          state_dict = state_dict["params_ema"]
      elif "params" in state_dict:
          state_dict = state_dict["params"]
          num_conv = 16 if "realesr-animevideov3" in filename else 32
          model = arch.SRVGGNetCompact(
              num_in_ch=3,
              num_out_ch=3,
              num_feat=64,
              num_conv=num_conv,
              upscale=4,
              act_type="prelu",
          )
          model.load_state_dict(state_dict)
          model.eval()
          return model
  
      if (
          "body.0.rdb1.conv1.weight" in state_dict
          and "conv_first.weight" in state_dict
      ):
          nb = 6 if "RealESRGAN_x4plus_anime_6B" in filename else 23
          state_dict = resrgan2normal(state_dict, nb)
      elif "conv_first.weight" in state_dict:
          state_dict = mod2normal(state_dict)
      elif "model.0.weight" not in state_dict:
          raise Exception("The file is not a recognized ESRGAN model.")
  
      in_nc, out_nc, nf, nb, plus, mscale = infer_params(state_dict)
  
      model = arch.RRDBNet(
          in_nc=in_nc,
          out_nc=out_nc,
          nf=nf,
          nb=nb,
          upscale=mscale,
          plus=plus,
      )
      model.load_state_dict(state_dict)
      model.eval()
  
      return model
  
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 3 for calling the UpscalerESRGAN obj's underlying member method code with example usage: obj.load_model(path) and returns: model, model