code: def create_refresh_button(
      refresh_component, refresh_method, refreshed_args, elem_id
  ):
      refresh_components = (
          refresh_component
          if isinstance(refresh_component, list)
          else [refresh_component]
      )
  
      label = None
      for comp in refresh_components:
          label = getattr(comp, "label", None)
          if label is not None:
              break
  
      def refresh():
          refresh_method()
          args = (
              refreshed_args()
              if callable(refreshed_args)
              else refreshed_args
          )
  
          for k, v in args.items():
              for comp in refresh_components:
                  setattr(comp, k, v)
  
          return (
              [gr.update(**(args or {})) for _ in refresh_components]
              if len(refresh_components) > 1
              else gr.update(**(args or {}))
          )
  
      refresh_button = ToolButton(
          value=refresh_symbol,
          elem_id=elem_id,
          tooltip=f"{label}: refresh" if label else "Refresh",
      )
      refresh_button.click(
          fn=refresh, inputs=[], outputs=refresh_components
      )
      return refresh_button
  
file_path: stable-diffusion-webui/modules/ui_common.py
imports: import json
  import html
  import os
  import platform
  import sys
  import gradio
  import subprocess
  from modules import call_queue, shared
  from modules.generation_parameters_copypaste import image_from_url_text
  import modules.images
  from modules.ui_components import ToolButton
  import modules.generation_parameters_copypaste
label_desc: Use image node_id 5 for calling a global function with example usage: create_refresh_button(refresh_component, refresh_method, refreshed_args, elem_id) and returns: refresh_button, unknown