code: def reload_vae_weights(sd_model=None, vae_file=unspecified):
      if not sd_model:
          sd_model = shared.sd_model
  
      checkpoint_info = sd_model.sd_checkpoint_info
      checkpoint_file = checkpoint_info.filename
  
      if vae_file == unspecified:
          vae_file, vae_source = resolve_vae(checkpoint_file).tuple()
      else:
          vae_source = "from function argument"
  
      if loaded_vae_file == vae_file:
          return
  
      if sd_model.lowvram:
          lowvram.send_everything_to_cpu()
      else:
          sd_model.to(devices.cpu)
  
      sd_hijack.model_hijack.undo_hijack(sd_model)
  
      load_vae(sd_model, vae_file, vae_source)
  
      sd_hijack.model_hijack.hijack(sd_model)
      script_callbacks.model_loaded_callback(sd_model)
  
      if not sd_model.lowvram:
          sd_model.to(devices.device)
  
      print("VAE weights loaded.")
      return sd_model
  
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 19 for calling a global function with example usage: reload_vae_weights(sd_model, vae_file) and returns: sd_model