Free-Lunch Long Video Generation via Layer-Adaptive O.O.D Correction

Jiahao Tian, Chenxi Song, Wei Cheng, Chi Zhang
3/26/2026
cs.CVcs.AI

Official code: Westlake-AGI-Lab/FreeLOC (17 stars, Apache-2.0, last commit 2026-03-24).

Abstract

Generating long videos using pre-trained video diffusion models, which are typically trained on short clips, presents a significant challenge. Directly applying these models for long-video inference often leads to a notable degradation in visual quality. This paper identifies that this issue primarily stems from two out-of-distribution (O.O.D) problems: frame-level relative position O.O.D and context-length O.O.D. To address these challenges, we propose FreeLOC, a novel training-free, layer-adaptive framework that introduces two core techniques: Video-based Relative Position Re-encoding (VRPR) for frame-level relative position O.O.D, a multi-granularity strategy that hierarchically re-encodes temporal relative positions to align with the model's pre-trained distribution, and Tiered Sparse Attention (TSA) for context-length O.O.D, which preserves both local detail and long-range dependencies by structuring attention density across different temporal scales. Crucially, we introduce a layer-adaptive probing mechanism that identifies the sensitivity of each transformer layer to these O.O.D issues, allowing for the selective and efficient application of our methods. Extensive experiments demonstrate that our approach significantly outperforms existing training-free methods, achieving state-of-the-art results in both temporal consistency and visual quality. Code is available at https://github.com/Westlake-AGI-Lab/FreeLOC.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[CVPR 2026] Official Implementation of Free-Lunch Long Video Generation via Layer-Adaptive O.O.D Correction

170Shell, PythonMar 23, 20267 months agoApache-2.0

Similar Papers

Cite this paper

@article{tian2026freelunch,
  title  = {Free-Lunch Long Video Generation via Layer-Adaptive O.O.D Correction},
  author = {Jiahao Tian and Chenxi Song and Wei Cheng and Chi Zhang},
  year   = {2026},
  eprint = {2603.25209},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.25209v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.25209.svg)](https://codeofpaper.com/paper/2603.25209)

Discussion