code: def restore_old_hires_fix_params(res):
      """for infotexts that specify old First pass size parameter, convert it into
      width, height, and hr scale"""
  
      firstpass_width = res.get("First pass size-1", None)
      firstpass_height = res.get("First pass size-2", None)
  
      if shared.opts.use_old_hires_fix_width_height:
          hires_width = int(res.get("Hires resize-1", 0))
          hires_height = int(res.get("Hires resize-2", 0))
  
          if hires_width and hires_height:
              res["Size-1"] = hires_width
              res["Size-2"] = hires_height
              return
  
      if firstpass_width is None or firstpass_height is None:
          return
  
      firstpass_width, firstpass_height = int(firstpass_width), int(
          firstpass_height
      )
      width = int(res.get("Size-1", 512))
      height = int(res.get("Size-2", 512))
  
      if firstpass_width == 0 or firstpass_height == 0:
          (
              firstpass_width,
              firstpass_height,
          ) = processing.old_hires_fix_first_pass_dimensions(
              width, height
          )
  
      res["Size-1"] = firstpass_width
      res["Size-2"] = firstpass_height
      res["Hires resize-1"] = width
      res["Hires resize-2"] = height
  
imports: from __future__ import annotations
  import base64
  import io
  import json
  import os
  import re
  import gradio
  from modules.paths import data_path
  from modules import shared, ui_tempdir, script_callbacks, processing
  from PIL import Image
label_desc: Use image node_id 11 for calling a global function with example usage: restore_old_hires_fix_params(res) without return types