def __call__(
        self,
        prompt: str,
        video_path: str,
        guidance_scale: float,
        num_inference_steps: int,
        skip_frames_start: int,
        skip_frames_end: int,
        frame_sample_step: Optional[int],
        max_num_frames: int,
        width: int,
        height: int,
        seed: int,
    ):
        """
        Performs DDIM inversion on a video to reconstruct it with a new prompt.

        Args:
            prompt (`str`): The text prompt to guide the reconstruction.
            video_path (`str`): Path to the input video file.
            guidance_scale (`float`): Scale for classifier-free guidance.
            num_inference_steps (`int`): Number of denoising steps.
            skip_frames_start (`int`): Number of frames to skip from the beginning of the video.
            skip_frames_end (`int`): Number of frames to skip from the end of the video.
            frame_sample_step (`Optional[int]`): Step size for sampling frames. If None, all frames are used.
            max_num_frames (`int`): Maximum number of frames to process.
            width (`int`): Width of the output video frames.
            height (`int`): Height of the output video frames.
            seed (`int`): Random seed for reproducibility.

        Returns:
            `CogVideoXDDIMInversionOutput`: Contains the inverse latents and reconstructed latents.
        """
        if not self.transformer.config.use_rotary_positional_embeddings:
            raise NotImplementedError("This script supports CogVideoX 5B model only.")
        video_frames = get_video_frames(
            video_path=video_path,
            width=width,
            height=height,
            skip_frames_start=skip_frames_start,
            skip_frames_end=skip_frames_end,
            max_num_frames=max_num_frames,
            frame_sample_step=frame_sample_step,
        ).to(device=self.device)
        video_latents = self.encode_video_frames(video_frames=video_frames)
        inverse_latents = self.sample(
            latents=video_latents,
            scheduler=self.inverse_scheduler,
            prompt="",
            num_inference_steps=num_inference_steps,
            guidance_scale=guidance_scale,
            generator=torch.Generator(device=self.device).manual_seed(seed),
        )
        with OverrideAttnProcessors(transformer=self.transformer):
            recon_latents = self.sample(
                latents=torch.randn_like(video_latents),
                scheduler=self.scheduler,
                prompt=prompt,
                num_inference_steps=num_inference_steps,
                guidance_scale=guidance_scale,
                generator=torch.Generator(device=self.device).manual_seed(seed),
                reference_latents=reversed(inverse_latents),
            )
        return CogVideoXDDIMInversionOutput(
            inverse_latents=inverse_latents,
            recon_latents=recon_latents,
        )

        Performs DDIM inversion on a video to reconstruct it with a new prompt.

        Args:
            prompt (`str`): The text prompt to guide the reconstruction.
            video_path (`str`): Path to the input video file.
            guidance_scale (`float`): Scale for classifier-free guidance.
            num_inference_steps (`int`): Number of denoising steps.
            skip_frames_start (`int`): Number of frames to skip from the beginning of the video.
            skip_frames_end (`int`): Number of frames to skip from the end of the video.
            frame_sample_step (`Optional[int]`): Step size for sampling frames. If None, all frames are used.
            max_num_frames (`int`): Maximum number of frames to process.
            width (`int`): Width of the output video frames.
            height (`int`): Height of the output video frames.
            seed (`int`): Random seed for reproducibility.

        Returns:
            `CogVideoXDDIMInversionOutput`: Contains the inverse latents and reconstructed latents.
        
examples/community/cogvideox_ddim_inversion.py