code: def restore_progress(id_task):
      while id_task == current_task or id_task in pending_tasks:
          time.sleep(0.1)
  
      res = next(
          iter([x[1] for x in recorded_results if id_task == x[0]]),
          None,
      )
      if res is not None:
          return res
  
      return (
          gr.update(),
          gr.update(),
          gr.update(),
          f"Couldn't restore progress for {id_task}: results either have been discarded or never were obtained",
      )
  
file_path: stable-diffusion-webui/modules/progress.py
imports: import base64
  import io
  import time
  import gradio
  from pydantic import BaseModel, Field
  from modules.shared import opts
  import modules.shared
label_desc: Use image node_id 7 for calling a global function with example usage: restore_progress(id_task) and returns: gr,  gr,  gr,  str, id_task, str, res