code: def encode_imgs(self, imgs):
      # imgs: [B, 3, H, W]
  
      imgs = 2 * imgs - 1
  
      posterior = self.image_encoder(imgs)
      latents = (
          posterior.sample() * self.image_encoder.config.scaling_factor
      )  # self.vae.config.scaling_factor==0.18215
  
      return latents
  
file_path: NeMo/nemo/collections/multimodal/modules/nerf/guidance/stablediffusion_nemo_pipeline.py
imports: import os
  import tempfile
  import torch
  import torch.nn.functional
  from omegaconf import OmegaConf
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.ldm.ddpm import LatentDiffusion
  from nemo.collections.multimodal.modules.nerf.guidance.txt2img_guidance_base import Txt2ImgGuidanceBase
  from nemo.collections.multimodal.modules.stable_diffusion.distributions.distributions import DiagonalGaussianDistribution
  from nemo.collections.nlp.parts.nlp_overrides import NLPSaveRestoreConnector
label_desc: Use image node_id 5 for calling the StableDiffusion obj's underlying member method code with example usage: obj.encode_imgs(imgs) and returns: latents