code: def setup_dialog(button_show, dialog, *, button_close=None):
      """Sets up the UI so that the dialog (gr.Box) is invisible, and is only shown when buttons_show is clicked, in a fullscreen modal window."""
  
      dialog.visible = False
  
      button_show.click(
          fn=lambda: gr.update(visible=True),
          inputs=[],
          outputs=[dialog],
      ).then(
          fn=None,
          _js="function(){ popupId('" + dialog.elem_id + "'); }",
      )
  
      if button_close:
          button_close.click(fn=None, _js="closePopup")
  
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 6 for calling a global function with example usage: setup_dialog(button_show, dialog) without return types