SuperAPIAI Directory

Warp-as-History

github.com · AI developer platforms

Warp-as-History is a camera-controlled video generation project proposed by researchers from Shanghai Jiao Tong University, Shanghai AI Laboratory, and other institutions, with authors Yifan Wang and Tong He. Its core idea is "video history is not just context": by using the warp information of historical frames as a condition, it enables control over camera motion during video generation and can generalize from a single training video. The project code is open-sourced on GitHub (https://github.com/yyfz/Warp-as-History),构建于 built on the Helios video generation model, and introduces components such as Pi3X camera pose estimation and TAEHV lightweight video VAE.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Purpose

Warp-as-History is a code repository for camera-controlled video generation. Its goal is to generate videos with controllable camera motion based on an input image, a text prompt, and a specified camera trajectory or pre-rendered warped video. The project emphasizes "Generalizable from One Training Video," meaning that controllable generation of camera motion can be achieved with only a small amount of training data.

Main Capabilities

  • Supports two conditioning modes: camera control and pre-rendered warp.
  • Supports online/autoregressive generation, allowing camera poses or warp video frames to be input chunk by chunk to continuously generate new video segments.
  • Provides a browser-based interactive Web real-time demo, including two presets:normal(standard high-quality mode) and efficient_realtime(low-latency real-time mode).
  • Provides two sets of weights: standard LoRA and efficient real-time LoRA (visible_lora_state_step1000_efficient_patchmid.pt).
  • Supports LoRA training scripts, allowing you to train standard LoRA or efficient real-time LoRA yourself.
  • When neither camera poses nor warp video are provided, the pipeline falls back to the original Helios process.

Usage

Environment Installation: First install PyTorch according to your own CUDA/driver setup (the example is CUDA 12.4), then install the project dependencies.third_party/Pi3 is a git submodule; if it was not cloned along with the rest, run git submodule update --init --recursive。xformers and flash-attn are optional components; the default code path uses PyTorch native attention.

Model Download: The required models must be downloaded in advance, including Helios-Distilled (default)BestWishYsh/Helios-Distilled、Pi3X yyfz233/Pi3X, Warp-as-History LoRA (default)yyfz233/warp-as-history; optional ones also include efficient real-time LoRA and Helios-Mid (for training only).

Inference: The demo CSV underdata/demo contains the input image paths, prompts, and camera_poses_path or pre-rendered warp_video_path. By default, checkpoints/warp-as-history/visible_lora_state_step1000.safetensorsis loaded; use --no_lora。camera_poses_path only in ablation experiments. In the .npz file pointed to by camera_poses , the entries should be OpenCV c2w poses with shape [T, 4, 4]. When both warp_video_path and camera_poses_path are provided, inference uses the pre-rendered warp video. When --output is not specified, output goes to runs/<csv_stem>.mp4。--num_frames 33 is only used for short smoke tests.camera_control_translation_scale controls the online warp translation scale, default 0.1.

Autoregressive Generation: First initialize the state once, then input camera or warp data chunk by chunk;generate_next_chunk returns the newly generated video frames and the next state. For camera control, the first chunk should provide window poses; subsequent chunks may provide window new poses (the pipeline will prepend the previous boundary pose) or window + 1 poses including the boundary pose. When using pre-rendered warp conditioning, initialize with conditioning_type="warp" , and each call passes through warp_video Pass in exactly window warp frames, optional warp_visibility_mask.

Web real-time demo: After uploading the first frame, entering a prompt, selecting the translation and rotation buttons and clicking Start, the server maintains autoregressive state between multiple Starts, and the generated mp4 is by default written to runs/web_realtime_demo or runs/web_realtime_demo_efficient_realtime。efficient_realtime presets use the released low-latency LoRA, and adopt patch_mid, [1,1,1] inference steps, disabled first-block upscaling,matmul_precision=high, disabled progress bar, visible-token threshold 0.6,target_fill camera warp,camera_pi3_pixel_limit=130000、camera_mesh_samples_per_axis=2, full TAEHV VAE and other configurations.

Real-time / H200 deployment: oriented toward the low-latency efficient_realtime path. One must first refer to the upstream Helios performance settings and confirm that the base Helios pipeline reaches about 20 FPS in the environment; use the FlashAttention 3 kernels for Hopper/H200-class GPUs recommended by the Helios repository; change the pyramid inference steps from [2,2,2] to [1,1,1] and disable first-block upscaling. The TAEHV code is located in third_party/taehv, and the corresponding checkpoint needs to be downloaded; the web demo requires no additional flags,--preset efficient_realtime will automatically enable the full TAEHV VAE; command-line inference can optionally enable it.--camera_realtime_fast_warp will switch to the real-time warp preset.

Training: The repository provides a preview sampling training batch, as well as scripts for training standard LoRA and efficient real-time LoRA. The training script will output train_config.json、train_loss.json、visible_lora_state.pt, and when --save_every is enabled, output stepwise checkpoints.

Applicable scenarios

Applicable to research and experimental scenarios that need to generate video based on specified camera trajectories or warp conditions, including camera-controlled video generation research that generalizes from a single training video, autoregressive/online video generation experiments, and low-latency real-time camera-controlled video generation demos.

Limitations and notes

  • Performance data is measured on a clean single-GPU environment, Helios-Distilled, BF16, 384x640, 33 frames (unless otherwise stated). The VRAM usage of pre-rendered warp inference is basically the same as that of the original Helios pipeline; online camera inference is higher because Pi3X and the camera warp renderer need to reside simultaneously with Helios. Helios's low-VRAM group-offloading mode is a different configuration and is not included in this table.
  • If an explicit lora_path is passed but camera_poses or warp_videois not provided, an error will be raised, because the WAH LoRA weights are defined only for the Warp-as-History condition.
  • Warrp debug is available only when camera_poses or warp_video is provided.
  • LoRA weights are released under CC BY-NC 4.0, strictly for non-commercial use. The Warp-as-History code owned by this repository is licensed under Apache-2.0. The Helios code and weights follow the upstream Helios license, the Pi3X code and weights follow the upstream Pi3 license, and the TAEHV code is introduced under the MIT license. Some training/inference examples are derived from a publicly available video in the DAVIS Challenge dataset; the original DAVIS data is not within the scope of this repository's license and must be obtained from the DAVIS official website and follow its terms.
  • Specific information such as fees, pricing, and platform support is not yet provided.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools