class_docstr: Pipeline for image drag-and-drop editing using stochastic differential equations: https://arxiv.org/abs/2311.01410.
  Please refer to the [official repository](https://github.com/ML-GSAI/SDE-Drag) for more information.
  
  This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
  library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
  
  Args:
      vae ([`AutoencoderKL`]):
          Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
      text_encoder ([`CLIPTextModel`]):
          Frozen text-encoder. Stable Diffusion uses the text portion of
          [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), specifically
          the [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) variant.
      tokenizer (`CLIPTokenizer`):
          Tokenizer of class
          [CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
      unet ([`UNet2DConditionModel`]): Conditional U-Net architecture to denoise the encoded image latents.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `unet` to denoise the encoded image latents. Please use
          [`DDIMScheduler`].
code: def _get_img_latent(self, image, height=None, weight=None):
      data = image.convert("RGB")
      if height is not None:
          data = data.resize((weight, height))
      transform = transforms.ToTensor()
      data = transform(data).unsqueeze(0)
      data = (data * 2.0) - 1.0
      data = data.to(self.device, dtype=self.vae.dtype)
      latent = self.vae.encode(data).latent_dist.sample()
      latent = 0.18215 * latent
      return latent
  
imports: import math
  import tempfile
  from typing import List, Optional
  import numpy
  import PIL.Image
  import torch
  from accelerate import Accelerator
  from torchvision import transforms
  from tqdm.auto import tqdm
  from transformers import CLIPTextModel, CLIPTokenizer
  from diffusers import AutoencoderKL, DiffusionPipeline, DPMSolverMultistepScheduler, UNet2DConditionModel
  from diffusers.loaders import AttnProcsLayers, LoraLoaderMixin
  from diffusers.models.attention_processor import AttnAddedKVProcessor, AttnAddedKVProcessor2_0, LoRAAttnAddedKVProcessor, LoRAAttnProcessor, LoRAAttnProcessor2_0, SlicedAttnAddedKVProcessor
  from diffusers.optimization import get_scheduler
label_desc: Use image node_id 8 for calling the SdeDragPipeline obj's underlying member method code with example usage: obj._get_img_latent(image, height, weight) and returns: latent