Description
TokenFlow presents an innovative framework for consistent video editing, leveraging pre-trained text-to-image diffusion models without requiring any additional training or fine-tuning. The rapid advancements in generative AI have extended to video generation, yet current state-of-the-art video models often fall short of image models in visual quality and user control. This work introduces a method that harnesses the power of text-to-image diffusion models for text-driven video editing.
Given a source video and a target text prompt, TokenFlow generates a high-quality video that aligns with the target text while meticulously preserving the spatial layout and dynamics of the original input video. The core innovation lies in the observation that consistency in the edited video can be achieved by enforcing consistency within the diffusion feature space. This is accomplished by explicitly propagating diffusion features based on readily available inter-frame correspondences within the model. Consequently, the framework operates without the need for any training or fine-tuning and is compatible with any off-the-shelf text-to-image editing technique.
The implementation is provided in PyTorch and is the official repository for the "TokenFlow: Consistent Diffusion Features for Consistent Video Editing" paper, presented at ICLR 2024. The project demonstrates state-of-the-art editing results across a variety of real-world videos. Users can explore sample results, project details, and the underlying research through the provided links. The framework is designed for structure-preserving edits and builds upon existing image editing techniques such as Plug-and-Play, ControlNet, and SDEdit. Users are advised to ensure compatibility with their chosen base editing technique, as the LDM decoder might introduce minor jitterness depending on the original video content.
TokenFlow's Core Features
Official PyTorch implementation of TokenFlow
Enables consistent video editing using pre-trained diffusion models
No further training or fine-tuning required
Preserves spatial layout and dynamics of input videos
Achieves text-driven video editing
Enforces consistency in diffusion feature space
Utilizes inter-frame correspondences for feature propagation
Compatible with off-the-shelf text-to-image editing methods
Demonstrates state-of-the-art editing results
Supports structure-preserving edits
Works with Plug-and-Play, ControlNet, and SDEdit techniques
Getting Started with TokenFlow
Clone: Clone the TokenFlow repository from GitHub.
Install dependencies: Create a conda environment and install required packages using `pip install -r requirements.txt`.
Preprocess: Prepare your video by running `python preprocess.py` with specified data path and inversion prompt.
Configure: Create a YAML configuration file for your chosen editing method (e.g., `configs/config_pnp.yaml`).
Execute: Run the editing script, such as `python run_tokenflow_pnp.py`, using your configuration.
TokenFlow's Use Cases
- Text-driven video modification
- Structure-preserving video editing
- AI-powered video content creation
- Enhancing video quality
- Research and development in video AI





