FLATTEN: optical FLow-guided ATTENtion for consistent text-to-video editing

Yuren Cong, Mengmeng Xu, Christian Simon, Shoufa Chen, Jiawei Ren +5 more
2/12/2026

No official code found. Best implementation: yrcong/flatten (212 stars, Apache-2.0, last commit 2024-05-24).

Abstract

Text-to-video editing aims to edit the visual appearance of a source video conditional on textual prompts. A major challenge in this task is to ensure that all frames in the edited video are visually consistent. Most recent works apply advanced text-to-image diffusion models to this task by inflating 2D spatial attention in the U-Net into spatio-temporal attention. Although temporal context can be added through spatio-temporal attention, it may introduce some irrelevant information for each patch and therefore cause inconsistency in the edited video. In this paper, for the first time, we introduce optical flow into the attention module in the diffusion model's U-Net to address the inconsistency issue for text-to-video editing. Our method, FLATTEN, enforces the patches on the same flow path across different frames to attend to each other in the attention module, thus improving the visual consistency in the edited videos. Additionally, our method is training-free and can be seamlessly integrated into any diffusion-based text-to-video editing methods and improve their visual consistency. Experiment results on existing text-to-video editing benchmarks show that our proposed method achieves the new state-of-the-art performance. In particular, our method excels in maintaining the visual consistency in the edited videos.

View on arXivView PDF

Code Implementations(1)

yrcong/flattenCommunity79%
Apache-2.0

Pytorch Implementation of FLATTEN: optical FLow-guided ATTENtion for consistent text-to-video editing (ICLR 2024)

2127Shell, PythonOct 5, 20232 years agoApache-2.0
diffusion-modelsiclr2024video-editingvideo-generation

Cite this paper

@article{cong2026flatten,
  title  = {FLATTEN: optical FLow-guided ATTENtion for consistent text-to-video editing},
  author = {Yuren Cong and Mengmeng Xu and Christian Simon and Shoufa Chen and Jiawei Ren and Yanping Xie and Juan-Manuel Pérez-Rúa and Bodo Rosenhahn and Tao Xiang and Sen He},
  year   = {2026},
  eprint = {2310.05922},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2310.05922},
  journal = {ICLR 2023 2023}
}

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/2310.05922.svg)](https://codeofpaper.com/paper/2310.05922)

Discussion