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","`","."]
docstr: Perform DDPM forward process from time t0 to t1. This is the same as adding noise with corresponding variance.
  
  Args:
      x_t0:
          Latent code at time t0.
      t0:
          Timestep at t0.
      t1:
          Timestamp at t1.
      generator (`torch.Generator` or `List[torch.Generator]`, *optional*):
          A [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make
          generation deterministic.
  
  Returns:
      x_t1:
          Forward process applied to x_t0 from time t0 to t1.
docstr_tok: ["Perform","DDPM","forward","process","from","time","t0","to","t1",".","This","is","the","same","as","adding","noise","with","corresponding","variance",".","Args",":","x_t0",":","Latent","code","at","time","t0",".","t0",":","Timestep","at","t0",".","t1",":","Timestamp","at","t1",".","generator","(","`","torch.Generator","`","or","`","List","[","torch.Generator","]","`",",","*","optional","*",")",":","A","[","`","torch.Generator","`","]","(","https",":","\/\/pytorch.org\/docs\/stable\/generated\/torch.Generator.html",")","to","make","generation","deterministic",".","Returns",":","x_t1",":","Forward","process","applied","to","x_t0","from","time","t0","to","t1","."]
code: def forward_loop(self, x_t0, t0, t1, generator):
      """
      Perform DDPM forward process from time t0 to t1. This is the same as adding noise with corresponding variance.
  
      Args:
          x_t0:
              Latent code at time t0.
          t0:
              Timestep at t0.
          t1:
              Timestamp at t1.
          generator (`torch.Generator` or `List[torch.Generator]`, *optional*):
              A [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make
              generation deterministic.
  
      Returns:
          x_t1:
              Forward process applied to x_t0 from time t0 to t1.
      """
      eps = torch.randn(
          x_t0.size(),
          generator=generator,
          dtype=x_t0.dtype,
          device=x_t0.device,
      )
      alpha_vec = torch.prod(self.scheduler.alphas[t0:t1])
      x_t1 = (
          torch.sqrt(alpha_vec) * x_t0 + torch.sqrt(1 - alpha_vec) * eps
      )
      return x_t1
  
imports: import copy
  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 diffusers.models import AutoencoderKL, UNet2DConditionModel
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipeline, StableDiffusionSafetyChecker
  from diffusers.schedulers import KarrasDiffusionSchedulers
  from diffusers.utils import BaseOutput
label_desc: Use image node_id 2 for calling the TextToVideoZeroPipeline obj's underlying member method code with example usage: obj.forward_loop(x_t0, t0, t1, generator) and returns: x_t1