code: def ui(self, is_img2img):
      self.comps = []
      self.setting_names = []
      self.infotext_fields = []
      extra_options = (
          shared.opts.extra_options_img2img
          if is_img2img
          else shared.opts.extra_options_txt2img
      )
      elem_id_tabname = "extra_options_" + (
          "img2img" if is_img2img else "txt2img"
      )
  
      mapping = {
          k: v
          for v, k in generation_parameters_copypaste.infotext_to_setting_name_mapping
      }
  
      with gr.Blocks() as interface:
          with gr.Accordion(
              "Options", open=False, elem_id=elem_id_tabname
          ) if shared.opts.extra_options_accordion and extra_options else gr.Group(
              elem_id=elem_id_tabname
          ):
              row_count = math.ceil(
                  len(extra_options) / shared.opts.extra_options_cols
              )
  
              for row in range(row_count):
                  with gr.Row():
                      for col in range(shared.opts.extra_options_cols):
                          index = (
                              row * shared.opts.extra_options_cols + col
                          )
                          if index >= len(extra_options):
                              break
  
                          setting_name = extra_options[index]
  
                          with FormColumn():
                              comp = (
                                  ui_settings.create_setting_component(
                                      setting_name
                                  )
                              )
  
                          self.comps.append(comp)
                          self.setting_names.append(setting_name)
  
                          setting_infotext_name = mapping.get(
                              setting_name
                          )
                          if setting_infotext_name is not None:
                              self.infotext_fields.append(
                                  (comp, setting_infotext_name)
                              )
  
      def get_settings_values():
          res = [
              ui_settings.get_value_for_setting(key)
              for key in self.setting_names
          ]
          return res[0] if len(res) == 1 else res
  
      interface.load(
          fn=get_settings_values,
          inputs=[],
          outputs=self.comps,
          queue=False,
          show_progress=False,
      )
  
      return self.comps
  
file_path: stable-diffusion-webui/extensions-builtin/extra-options-section/scripts/extra_options_section.py
imports: import math
  import gradio
  from modules import scripts, shared, ui_components, ui_settings, generation_parameters_copypaste
  from modules.ui_components import FormColumn
label_desc: Use image node_id 4 for calling the ExtraOptionsSection obj's underlying member method code with example usage: obj.ui(is_img2img) and returns: self, unknown