code: def update_generation_info(generation_info, html_info, img_index):
      try:
          generation_info = json.loads(generation_info)
          if img_index < 0 or img_index >= len(
              generation_info["infotexts"]
          ):
              return html_info, gr.update()
          return (
              plaintext_to_html(
                  generation_info["infotexts"][img_index]
              ),
              gr.update(),
          )
      except Exception:
          pass
      # if the json parse or anything else fails, just return the old html_info
      return html_info, gr.update()
  
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 1 for calling a global function with example usage: update_generation_info(generation_info, html_info, img_index) and returns: html_info,  gr, plaintext_to_html,  gr, html_info,  gr