code: def on_ui_settings():
      import gradio as gr
  
      shared.opts.add_option(
          "SWIN_tile",
          shared.OptionInfo(
              192,
              "Tile size for all SwinIR.",
              gr.Slider,
              {"minimum": 16, "maximum": 512, "step": 16},
              section=("upscaling", "Upscaling"),
          ),
      )
      shared.opts.add_option(
          "SWIN_tile_overlap",
          shared.OptionInfo(
              8,
              "Tile overlap, in pixels for SwinIR. Low values = visible seam.",
              gr.Slider,
              {"minimum": 0, "maximum": 48, "step": 1},
              section=("upscaling", "Upscaling"),
          ),
      )
      if (
          int(torch.__version__.split(".")[0]) >= 2
          and platform.system() != "Windows"
      ):  # torch.compile() require pytorch 2.0 or above, and not on Windows
          shared.opts.add_option(
              "SWIN_torch_compile",
              shared.OptionInfo(
                  False,
                  "Use torch.compile to accelerate SwinIR.",
                  gr.Checkbox,
                  {"interactive": True},
                  section=("upscaling", "Upscaling"),
              ).info("Takes longer on first run"),
          )
  
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 3 for calling a global function with example usage: on_ui_settings() without return types