code: def _get_submodels_for_export_sam(model, variant):
      models_for_export = {}
  
      if variant == "monolith":
          models_for_export["model"] = model
      else:
          # We rather use the model patcher to patch their forward method.
          models_for_export["vision_encoder"] = model
          models_for_export["prompt_encoder_mask_decoder"] = model
  
      return models_for_export
  
imports: import copy
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
  import torch
  from packaging import version
  from transformers.models.speecht5.modeling_speecht5 import SpeechT5HifiGan
  from transformers.utils import is_tf_available, is_torch_available
  from ...utils import DIFFUSERS_MINIMUM_VERSION, ORT_QUANTIZE_MINIMUM_VERSION, check_if_diffusers_greater, is_diffusers_available, logging
  from ...utils.import_utils import _diffusers_version
  from ..tasks import TasksManager
  from .constants import ONNX_DECODER_NAME, ONNX_DECODER_WITH_PAST_NAME, ONNX_ENCODER_NAME
label_desc: Use image node_id 8 for calling a global function with example usage: _get_submodels_for_export_sam(model, variant) and returns: models_for_export