code: def get_realesrgan_models(scaler):
      try:
          from basicsr.archs.rrdbnet_arch import RRDBNet
          from realesrgan.archs.srvgg_arch import SRVGGNetCompact
  
          models = [
              UpscalerData(
                  name="R-ESRGAN General 4xV3",
                  path="https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth",
                  scale=4,
                  upscaler=scaler,
                  model=lambda: SRVGGNetCompact(
                      num_in_ch=3,
                      num_out_ch=3,
                      num_feat=64,
                      num_conv=32,
                      upscale=4,
                      act_type="prelu",
                  ),
              ),
              UpscalerData(
                  name="R-ESRGAN General WDN 4xV3",
                  path="https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth",
                  scale=4,
                  upscaler=scaler,
                  model=lambda: SRVGGNetCompact(
                      num_in_ch=3,
                      num_out_ch=3,
                      num_feat=64,
                      num_conv=32,
                      upscale=4,
                      act_type="prelu",
                  ),
              ),
              UpscalerData(
                  name="R-ESRGAN AnimeVideo",
                  path="https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth",
                  scale=4,
                  upscaler=scaler,
                  model=lambda: SRVGGNetCompact(
                      num_in_ch=3,
                      num_out_ch=3,
                      num_feat=64,
                      num_conv=16,
                      upscale=4,
                      act_type="prelu",
                  ),
              ),
              UpscalerData(
                  name="R-ESRGAN 4x+",
                  path="https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth",
                  scale=4,
                  upscaler=scaler,
                  model=lambda: RRDBNet(
                      num_in_ch=3,
                      num_out_ch=3,
                      num_feat=64,
                      num_block=23,
                      num_grow_ch=32,
                      scale=4,
                  ),
              ),
              UpscalerData(
                  name="R-ESRGAN 4x+ Anime6B",
                  path="https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth",
                  scale=4,
                  upscaler=scaler,
                  model=lambda: RRDBNet(
                      num_in_ch=3,
                      num_out_ch=3,
                      num_feat=64,
                      num_block=6,
                      num_grow_ch=32,
                      scale=4,
                  ),
              ),
              UpscalerData(
                  name="R-ESRGAN 2x+",
                  path="https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth",
                  scale=2,
                  upscaler=scaler,
                  model=lambda: RRDBNet(
                      num_in_ch=3,
                      num_out_ch=3,
                      num_feat=64,
                      num_block=23,
                      num_grow_ch=32,
                      scale=2,
                  ),
              ),
          ]
          return models
      except Exception:
          errors.report(
              "Error making Real-ESRGAN models list", exc_info=True
          )
  
file_path: stable-diffusion-webui/modules/realesrgan_model.py
imports: import os
  import numpy
  from PIL import Image
  from realesrgan import RealESRGANer
  from modules.upscaler import Upscaler, UpscalerData
  from modules.shared import cmd_opts, opts
  from modules import modelloader, errors
label_desc: Use image node_id 1 for calling a global function with example usage: get_realesrgan_models(scaler) and returns: models