code: def __init__(self, dirname):
      self._cached_model = None  # keep the model when SWIN_torch_compile is on to prevent re-compile every runs
      self._cached_model_config = None  # to clear '_cached_model' when changing model (v1/v2) or settings
      self.name = "SwinIR"
      self.model_url = SWINIR_MODEL_URL
      self.model_name = "SwinIR 4x"
      self.user_path = dirname
      super().__init__()
      scalers = []
      model_files = self.find_models(ext_filter=[".pt", ".pth"])
      for model in model_files:
          if model.startswith("http"):
              name = self.model_name
          else:
              name = modelloader.friendly_name(model)
          model_data = UpscalerData(name, model, self)
          scalers.append(model_data)
      self.scalers = scalers
  
file_path: stable-diffusion-webui/extensions-builtin/SwinIR/scripts/swinir_model.py
imports: import sys
  import platform
  import numpy
  import torch
  from PIL import Image
  from tqdm import tqdm
  from modules import modelloader, devices, script_callbacks, shared
  from modules.shared import opts, state
  from swinir_model_arch import SwinIR
  from swinir_model_arch_v2 import Swin2SR
  from modules.upscaler import Upscaler, UpscalerData
label_desc: Use image node_id 1 to create a new UpscalerSwinIR object from inherited base classes: Upscaler with example: obj = UpscalerSwinIR(dirname)