class_docstr: Pipeline for video-to-video translation using Stable Diffusion with Rerender Algorithm.
  
  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.)
  
  In addition the pipeline inherits the following loading methods:
      - *Textual-Inversion*: [`loaders.TextualInversionLoaderMixin.load_textual_inversion`]
  
  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.
      controlnet ([`ControlNetModel`] or `List[ControlNetModel]`):
          Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
          as a list, the outputs from each ControlNet are added together to create one combined additional
          conditioning.
      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 details.
      feature_extractor ([`CLIPImageProcessor`]):
          Model that extracts features from generated images to be used as inputs for the `safety_checker`.
class_docstr_tok: ["Pipeline","for","video-to-video","translation","using","Stable","Diffusion","with","Rerender","Algorithm",".","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",".",")","In","addition","the","pipeline","inherits","the","following","loading","methods",":","-","*","Textual-Inversion","*",":","[","`","loaders.TextualInversionLoaderMixin.load_textual_inversion","`","]","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",".","controlnet","(","[","`","ControlNetModel","`","]","or","`","List","[","ControlNetModel","]","`",")",":","Provides","additional","conditioning","to","the","unet","during","the","denoising","process",".","If","you","set","multiple","ControlNets","as","a","list",",","the","outputs","from","each","ControlNet","are","added","together","to","create","one","combined","additional","conditioning",".","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","details",".","feature_extractor","(","[","`","CLIPImageProcessor","`","]",")",":","Model","that","extracts","features","from","generated","images","to","be","used","as","inputs","for","the","`","safety_checker","`","."]
code: def check_inputs(
      self,
      prompt,
      callback_steps,
      negative_prompt=None,
      prompt_embeds=None,
      negative_prompt_embeds=None,
      controlnet_conditioning_scale=1.0,
      control_guidance_start=0.0,
      control_guidance_end=1.0,
  ):
      if (callback_steps is None) or (
          callback_steps is not None
          and (
              not isinstance(callback_steps, int) or callback_steps <= 0
          )
      ):
          raise ValueError(
              f"`callback_steps` has to be a positive integer but is {callback_steps} of type"
              f" {type(callback_steps)}."
          )
  
      if prompt is not None and prompt_embeds is not None:
          raise ValueError(
              f"Cannot forward both `prompt`: {prompt} and `prompt_embeds`: {prompt_embeds}. Please make sure to"
              " only forward one of the two."
          )
      elif prompt is None and prompt_embeds is None:
          raise ValueError(
              "Provide either `prompt` or `prompt_embeds`. Cannot leave both `prompt` and `prompt_embeds` undefined."
          )
      elif prompt is not None and (
          not isinstance(prompt, str) and not isinstance(prompt, list)
      ):
          raise ValueError(
              f"`prompt` has to be of type `str` or `list` but is {type(prompt)}"
          )
  
      if (
          negative_prompt is not None
          and negative_prompt_embeds is not None
      ):
          raise ValueError(
              f"Cannot forward both `negative_prompt`: {negative_prompt} and `negative_prompt_embeds`:"
              f" {negative_prompt_embeds}. Please make sure to only forward one of the two."
          )
  
      if (
          prompt_embeds is not None
          and negative_prompt_embeds is not None
      ):
          if prompt_embeds.shape != negative_prompt_embeds.shape:
              raise ValueError(
                  "`prompt_embeds` and `negative_prompt_embeds` must have the same shape when passed directly, but"
                  f" got: `prompt_embeds` {prompt_embeds.shape} != `negative_prompt_embeds`"
                  f" {negative_prompt_embeds.shape}."
              )
  
      # `prompt` needs more sophisticated handling when there are multiple
      # conditionings.
      if isinstance(self.controlnet, MultiControlNetModel):
          if isinstance(prompt, list):
              logger.warning(
                  f"You have {len(self.controlnet.nets)} ControlNets and you have passed {len(prompt)}"
                  " prompts. The conditionings will be fixed across the prompts."
              )
  
      is_compiled = hasattr(
          F, "scaled_dot_product_attention"
      ) and isinstance(
          self.controlnet, torch._dynamo.eval_frame.OptimizedModule
      )
  
      # Check `controlnet_conditioning_scale`
      if (
          isinstance(self.controlnet, ControlNetModel)
          or is_compiled
          and isinstance(self.controlnet._orig_mod, ControlNetModel)
      ):
          if not isinstance(controlnet_conditioning_scale, float):
              raise TypeError(
                  "For single controlnet: `controlnet_conditioning_scale` must be type `float`."
              )
      elif (
          isinstance(self.controlnet, MultiControlNetModel)
          or is_compiled
          and isinstance(
              self.controlnet._orig_mod, MultiControlNetModel
          )
      ):
          if isinstance(controlnet_conditioning_scale, list):
              if any(
                  isinstance(i, list)
                  for i in controlnet_conditioning_scale
              ):
                  raise ValueError(
                      "A single batch of multiple conditionings are supported at the moment."
                  )
          elif isinstance(controlnet_conditioning_scale, list) and len(
              controlnet_conditioning_scale
          ) != len(self.controlnet.nets):
              raise ValueError(
                  "For multiple controlnets: When `controlnet_conditioning_scale` is specified as `list`, it must have"
                  " the same length as the number of controlnets"
              )
      else:
          assert False
  
      if len(control_guidance_start) != len(control_guidance_end):
          raise ValueError(
              f"`control_guidance_start` has {len(control_guidance_start)} elements, but `control_guidance_end` has {len(control_guidance_end)} elements. Make sure to provide the same number of elements to each list."
          )
  
      if isinstance(self.controlnet, MultiControlNetModel):
          if len(control_guidance_start) != len(self.controlnet.nets):
              raise ValueError(
                  f"`control_guidance_start`: {control_guidance_start} has {len(control_guidance_start)} elements but there are {len(self.controlnet.nets)} controlnets available. Make sure to provide {len(self.controlnet.nets)}."
              )
  
      for start, end in zip(
          control_guidance_start, control_guidance_end
      ):
          if start >= end:
              raise ValueError(
                  f"control guidance start: {start} cannot be larger or equal to control guidance end: {end}."
              )
          if start < 0.0:
              raise ValueError(
                  f"control guidance start: {start} can't be smaller than 0."
              )
          if end > 1.0:
              raise ValueError(
                  f"control guidance end: {end} can't be larger than 1.0."
              )
  
imports: import sys
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import PIL.Image
  import torch
  import torch.nn.functional
  import torchvision.transforms
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
  from diffusers.image_processor import VaeImageProcessor
  from diffusers.models import AutoencoderKL, ControlNetModel, UNet2DConditionModel
  from diffusers.models.attention_processor import Attention, AttnProcessor
  from diffusers.pipelines.controlnet.multicontrolnet import MultiControlNetModel
  from diffusers.pipelines.controlnet.pipeline_controlnet_img2img import StableDiffusionControlNetImg2ImgPipeline
  from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
  from diffusers.schedulers import KarrasDiffusionSchedulers
  from diffusers.utils import BaseOutput, deprecate, logging
  from diffusers.utils.torch_utils import is_compiled_module, randn_tensor
  from gmflow.gmflow import GMFlow
  from utils.utils import InputPadder
label_desc: Use image node_id 2 for calling the RerenderAVideoPipeline obj's underlying member method code with example usage: obj.check_inputs(prompt, callback_steps, negative_prompt, prompt_embeds, negative_prompt_embeds, controlnet_conditioning_scale, control_guidance_start, control_guidance_end) without return types