code: def image2latent(self, image_path):
      image = Image.open(image_path).convert("RGB")
      image = np.array(image)
      image = torch.from_numpy(image).float() / 127.5 - 1
      image = image.permute(2, 0, 1).unsqueeze(0).to(self.device)
      latents = self.vae.encode(image)["latent_dist"].mean
      latents = latents * 0.18215
      return latents
  
imports: import inspect
  import os
  import numpy
  import torch
  import torch.nn.functional
  from PIL import Image
  from torch.optim.adam import Adam
  from tqdm import tqdm
  from diffusers import StableDiffusionPipeline
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
label_desc: Use image node_id 3 for calling the NullTextPipeline obj's underlying member method code with example usage: obj.image2latent(image_path) and returns: latents