[Project Page] [arXiv]
UniEdit supports both video motion editing in the time axis (i.e., from playing guitar to eating or waving) and various video appearance editing scenarios (i.e., stylization, rigid/non-rigid object replacement, background modification).
Abstract: Recent advances in text-guided video editing have showcased promising results in appearance editing (e.g., stylization). However, video motion editing in the temporal dimension (e.g., from eating to waving), which distinguishes video editing from image editing, is underexplored. In this work, we present UniEdit, a tuning-free framework that supports both video motion and appearance editing by harnessing the power of a pre-trained text-to-video generator within an inversion-then-generation framework. To realize motion editing while preserving source video content, based on the insights that temporal and spatial self-attention layers encode inter-frame and intra-frame dependency respectively, we introduce auxiliary motion-reference and reconstruction branches to produce text-guided motion and source features respectively. The obtained features are then injected into the main editing path via temporal and spatial self-attention layers. Extensive experiments demonstrate that UniEdit covers video motion editing and various appearance editing scenarios, and surpasses the state-of-the-art methods.
Features:
- Versatile: supports both video motion editing and various video appearance editing scenarios.
- Tuning-free: no training or optimization required.
- Flexibility: compatible with off-the-shelf T2V models.
Please visit the project webpage to see more results and information.
The code runs on Python 3.11.3 with Pytorch 2.0.1.
git clone https://github.com/JianhongBai/UniEdit.git
cd UniEdit
pip install -r requirements.txt
LaVie: Our work primarily builds on the text-to-video generation framework LaVie, so we need to first download pretrained models according to its guidance here.
We utilize foreground/background segmentation masks to further enhance the performance of UniEdit, we can use SAM to generate the corresponding segmentation masks.
Last, you can perform video appearance or motion editing with following commands:
python uniedit_a.py
python uniedit_m.py
We express our gratitude for the awesome research works LaVie, MasaCtrl! Thanks for the valuable work!
@article{bai2024uniedit,
title={UniEdit: A Unified Tuning-Free Framework for Video Motion and Appearance Editing},
author={Bai, Jianhong and He, Tianyu and Wang, Yuchi and Guo, Junliang and Hu, Haoji and Liu, Zuozhu and Bian, Jiang},
journal={arXiv preprint arXiv:2402.13185},
year={2024}
}