code: def setup_ui(self, gallery):
      self.button_replace_preview.click(
          fn=self.save_preview,
          _js="function(x, y, z){return [selected_gallery_index(), y, z]}",
          inputs=[self.edit_name_input, gallery, self.edit_name_input],
          outputs=[self.html_preview, self.html_status],
      ).then(
          fn=None,
          _js="function(name){extraNetworksRefreshSingleCard("
          + json.dumps(self.page.name)
          + ","
          + json.dumps(self.tabname)
          + ", name);}",
          inputs=[self.edit_name_input],
          outputs=[],
      )
  
imports: import datetime
  import html
  import json
  import os.path
  import gradio
  from modules import generation_parameters_copypaste, images, sysinfo, errors, ui_extra_networks
label_desc: Use image node_id 16 for calling the UserMetadataEditor obj's underlying member method code with example usage: obj.setup_ui(gallery) without return types