code: def initialize_sampler(model, sampler_type):
      if sampler_type == "DDIM":
          sampler = DDIMSampler(model)
      elif sampler_type == "PLMS":
          sampler = PLMSSampler(model)
      else:
          raise ValueError(
              f"Sampler {sampler_type} is not supported for {cls.__name__}"
          )
      return sampler
  
file_path: NeMo/examples/multimodal/text_to_image/controlnet/controlnet_infer.py
imports: import os
  import time
  import cv2
  import einops
  import torch
  from PIL import Image
  from nemo.collections.multimodal.models.text_to_image.controlnet import get_preprocessing_function
  from nemo.collections.multimodal.models.text_to_image.controlnet.controlnet import MegatronControlNet
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers.ddim import DDIMSampler
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers.plms import PLMSSampler
  from nemo.collections.multimodal.parts.utils import setup_trainer_and_model_for_inference
  from nemo.core.config import hydra_runner
label_desc: Use image node_id 3 for calling a global function with example usage: initialize_sampler(model, sampler_type) and returns: sampler