code: def encoder_model():
      model_name = (
          "taesdxl_encoder.pth"
          if getattr(shared.sd_model, "is_sdxl", False)
          else "taesd_encoder.pth"
      )
      loaded_model = sd_vae_taesd_models.get(model_name)
  
      if loaded_model is None:
          model_path = os.path.join(
              paths_internal.models_path, "VAE-taesd", model_name
          )
          download_model(
              model_path,
              "https://github.com/madebyollin/taesd/raw/main/"
              + model_name,
          )
  
          if os.path.exists(model_path):
              loaded_model = TAESDEncoder(model_path)
              loaded_model.eval()
              loaded_model.to(devices.device, devices.dtype)
              sd_vae_taesd_models[model_name] = loaded_model
          else:
              raise FileNotFoundError("TAESD model not found")
  
      return loaded_model.encoder
  
imports: import os
  import torch
  import torch.nn
  from modules import devices, paths_internal, shared
label_desc: Use image node_id 6 for calling a global function with example usage: encoder_model() and returns: loaded_model