code: def check_tmp_file(gradio, filename):
      if hasattr(gradio, "temp_file_sets"):
          return any(
              filename in fileset for fileset in gradio.temp_file_sets
          )
  
      if hasattr(gradio, "temp_dirs"):
          return any(
              Path(temp_dir).resolve()
              in Path(filename).resolve().parents
              for temp_dir in gradio.temp_dirs
          )
  
      return False
  
file_path: stable-diffusion-webui/modules/ui_tempdir.py
imports: import os
  import tempfile
  from collections import namedtuple
  from pathlib import Path
  import gradio.components
  from PIL import PngImagePlugin
  from modules import shared
label_desc: Use image node_id 2 for calling a global function with example usage: check_tmp_file(gradio, filename) and returns: False, any, any