class_docstr: Pipeline for zero-shot text-to-video generation using Stable Diffusion.
  
  This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods
  implemented for all pipelines (downloading, 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 ([clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14)).
      tokenizer (`CLIPTokenizer`):
          A [`~transformers.CLIPTokenizer`] to tokenize text.
      unet ([`UNet2DConditionModel`]):
          A [`UNet3DConditionModel`] to denoise the encoded video latents.
      scheduler ([`SchedulerMixin`]):
          A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
          [`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
      safety_checker ([`StableDiffusionSafetyChecker`]):
          Classification module that estimates whether generated images could be considered offensive or harmful.
          Please refer to the [model card](https://huggingface.co/runwayml/stable-diffusion-v1-5) for more details
          about a model's potential harms.
      feature_extractor ([`CLIPImageProcessor`]):
          A [`CLIPImageProcessor`] to extract features from generated images; used as inputs to the `safety_checker`.
class_docstr_tok: ["Pipeline","for","zero-shot","text-to-video","generation","using","Stable","Diffusion",".","This","model","inherits","from","[","`","DiffusionPipeline","`","]",".","Check","the","superclass","documentation","for","the","generic","methods","implemented","for","all","pipelines","(","downloading",",","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","(","[","clip-vit-large-patch14","]","(","https",":","\/\/huggingface.co\/openai\/clip-vit-large-patch14",")",")",".","tokenizer","(","`","CLIPTokenizer","`",")",":","A","[","`","~transformers.CLIPTokenizer","`","]","to","tokenize","text",".","unet","(","[","`","UNet2DConditionModel","`","]",")",":","A","[","`","UNet3DConditionModel","`","]","to","denoise","the","encoded","video","latents",".","scheduler","(","[","`","SchedulerMixin","`","]",")",":","A","scheduler","to","be","used","in","combination","with","`","unet","`","to","denoise","the","encoded","image","latents",".","Can","be","one","of","[","`","DDIMScheduler","`","]",",","[","`","LMSDiscreteScheduler","`","]",",","or","[","`","PNDMScheduler","`","]",".","safety_checker","(","[","`","StableDiffusionSafetyChecker","`","]",")",":","Classification","module","that","estimates","whether","generated","images","could","be","considered","offensive","or","harmful",".","Please","refer","to","the","[","model","card","]","(","https",":","\/\/huggingface.co\/runwayml\/stable-diffusion-v1-5",")","for","more","details","about","a","model","'s","potential","harms",".","feature_extractor","(","[","`","CLIPImageProcessor","`","]",")",":","A","[","`","CLIPImageProcessor","`","]","to","extract","features","from","generated","images",";","used","as","inputs","to","the","`","safety_checker","`","."]
code: def prepare_latents(
      self,
      batch_size,
      num_channels_latents,
      height,
      width,
      dtype,
      device,
      generator,
      latents=None,
  ):
      shape = (
          batch_size,
          num_channels_latents,
          height // self.vae_scale_factor,
          width // self.vae_scale_factor,
      )
      if isinstance(generator, list) and len(generator) != batch_size:
          raise ValueError(
              f"You have passed a list of generators of length {len(generator)}, but requested an effective batch"
              f" size of {batch_size}. Make sure the batch size matches the length of the generators."
          )
  
      if latents is None:
          latents = randn_tensor(
              shape, generator=generator, device=device, dtype=dtype
          )
      else:
          latents = latents.to(device)
  
      # scale the initial noise by the standard deviation required by the scheduler
      latents = latents * self.scheduler.init_noise_sigma
      return latents
  
imports: import copy
  import inspect
  from dataclasses import dataclass
  from typing import Callable, List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  import torch.nn.functional
  from torch.nn.functional import grid_sample
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
  from ...image_processor import VaeImageProcessor
  from ...loaders import LoraLoaderMixin, TextualInversionLoaderMixin
  from ...models import AutoencoderKL, UNet2DConditionModel
  from ...models.lora import adjust_lora_scale_text_encoder
  from ...schedulers import KarrasDiffusionSchedulers
  from ...utils import USE_PEFT_BACKEND, BaseOutput, logging, scale_lora_layers, unscale_lora_layers
  from ...utils.torch_utils import randn_tensor
  from ..pipeline_utils import DiffusionPipeline
  from ..stable_diffusion import StableDiffusionSafetyChecker
label_desc: Use image node_id 5 for calling the TextToVideoZeroPipeline obj's underlying member method code with example usage: obj.prepare_latents(batch_size, num_channels_latents, height, width, dtype, device, generator, latents) and returns: latents