code: def encode_prompt(
      cond_stage_model, prompt, unconditional_guidance_scale, batch_size
  ):
      c = cond_stage_model.encode(batch_size * [prompt])
      if unconditional_guidance_scale != 1.0:
          uc = cond_stage_model.encode(batch_size * [""])
      else:
          uc = None
      return c, uc
  
file_path: NeMo/nemo/collections/multimodal/parts/stable_diffusion/pipeline.py
imports: import os
  import pickle
  import time
  import torch
  from PIL import Image
  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.para_ddim import ParaDDIMSampler
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers.plms import PLMSSampler
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers.sampler_dpm import DPMSolverSampler
  from nemo.collections.multimodal.parts.stable_diffusion.utils import DataParallelWrapper
label_desc: Use image node_id 1 for calling a global function with example usage: encode_prompt(cond_stage_model, prompt, unconditional_guidance_scale, batch_size) and returns: c,  uc