code: def read_metadata(
      primary_model_name, secondary_model_name, tertiary_model_name
  ):
      metadata = {}
  
      for checkpoint_name in [
          primary_model_name,
          secondary_model_name,
          tertiary_model_name,
      ]:
          checkpoint_info = sd_models.checkpoints_list.get(
              checkpoint_name, None
          )
          if checkpoint_info is None:
              continue
  
          metadata.update(checkpoint_info.metadata)
  
      return json.dumps(metadata, indent=4, ensure_ascii=False)
  
file_path: stable-diffusion-webui/modules/extras.py
imports: import os
  import re
  import shutil
  import json
  import torch
  import tqdm
  from modules import shared, images, sd_models, sd_vae, sd_models_config, errors
  from modules.ui_common import plaintext_to_html
  import gradio
  import safetensors.torch
label_desc: Use image node_id 4 for calling a global function with example usage: read_metadata(primary_model_name, secondary_model_name, tertiary_model_name) and returns: json