code: def refresh_vae_list():
      vae_dict.clear()
  
      paths = [
          os.path.join(sd_models.model_path, "**/*.vae.ckpt"),
          os.path.join(sd_models.model_path, "**/*.vae.pt"),
          os.path.join(sd_models.model_path, "**/*.vae.safetensors"),
          os.path.join(vae_path, "**/*.ckpt"),
          os.path.join(vae_path, "**/*.pt"),
          os.path.join(vae_path, "**/*.safetensors"),
      ]
  
      if shared.cmd_opts.ckpt_dir is not None and os.path.isdir(
          shared.cmd_opts.ckpt_dir
      ):
          paths += [
              os.path.join(shared.cmd_opts.ckpt_dir, "**/*.vae.ckpt"),
              os.path.join(shared.cmd_opts.ckpt_dir, "**/*.vae.pt"),
              os.path.join(
                  shared.cmd_opts.ckpt_dir, "**/*.vae.safetensors"
              ),
          ]
  
      if shared.cmd_opts.vae_dir is not None and os.path.isdir(
          shared.cmd_opts.vae_dir
      ):
          paths += [
              os.path.join(shared.cmd_opts.vae_dir, "**/*.ckpt"),
              os.path.join(shared.cmd_opts.vae_dir, "**/*.pt"),
              os.path.join(shared.cmd_opts.vae_dir, "**/*.safetensors"),
          ]
  
      candidates = []
      for path in paths:
          candidates += glob.iglob(path, recursive=True)
  
      for filepath in candidates:
          name = get_filename(filepath)
          vae_dict[name] = filepath
  
      vae_dict.update(
          dict(
              sorted(
                  vae_dict.items(),
                  key=lambda item: shared.natural_sort_key(item[0]),
              )
          )
      )
  
imports: import os
  import collections
  from dataclasses import dataclass
  from modules import paths, shared, devices, script_callbacks, sd_models, extra_networks, lowvram, sd_hijack, hashes
  import glob
  from copy import deepcopy
label_desc: Use image node_id 8 for calling a global function with example usage: refresh_vae_list() without return types