![]() |
![]() |
![]() |
![]() |
| Input Video (left) · Target Retake (right) | |
🔥 High-quality camera-controlled video-to-video generation in just 4 sampling steps!! 🔥
-
Create the environment and download checkpoints
conda env create -f environment.yml conda activate flashrender pip install -r requirements.txt pip install flash_attn --no-build-isolation pip install --no-build-isolation git+https://github.com/mohammadasim98/met3r pip install --no-build-isolation -e vipe python download_model.py
-
Prepare the training datasets
Download MultiCamVideo and SyncCamVideo, and place them as:
<path/to/dataset>/ ├── MultiCamVideo/ │ └── train/ │ ├── f18_aperture10/ │ ├── f24_aperture5/ │ ├── f35_aperture2.4/ │ └── f50_aperture2.4/ └── SyncCamVideo/ └── train/ └── f24_aperture5/ -
Extract features
# Captioning is optional — ours is already provided in dataset/metadata.csv torchrun --nproc-per-node=8 text_captioning.py dataset_path=<path/to/dataset> torchrun --nproc-per-node=8 extract_features.py \ dataset_path=<path/to/dataset> meta_path=dataset/metadata.csv
FlashRender retakes an input video from a target camera trajectory in 4-NFE using a three-stage training recipe, run on 8 GPUs and configured through configs/base.yaml.
-
Stage 1 (
train.py) — Multi-step flow-matching model (t = r)torchrun --nproc-per-node=8 train.py dataset_path=<path/to/dataset>
-
Stage 2 (
train_meanflow.py) — Few-step MeanFlow model, resumed from Stage 1torchrun --nproc-per-node=8 train_meanflow.py \ meanflow.resume_checkpoint=models/checkpoints/epoch_20.safetensors -
Stage 3 (
train_onpolicy.py) — On-policy flow-map distillation of the Stage 2 studenttorchrun --nproc-per-node=8 train_onpolicy.py \ onpolicy.teacher_checkpoint=models/checkpoints/epoch_20.safetensors \ onpolicy.student_checkpoint=models/checkpoints/meanflow_epoch_20.safetensors
-
Download checkpoints (skip if you already ran
download_model.pyduring setup)Stage Checkpoint file Download 1 epoch_20.safetensorsCheckpoint (Stage 1) 2 meanflow_epoch_20.safetensorsCheckpoint (Stage 2) 3 onpolicy_epoch_5.safetensorsCheckpoint (Stage 3) -
Run inference
# Stage 1: multi-step checkpoint python inference.py eval.ckpt_path=models/checkpoints/epoch_20.safetensors \ eval.num_inference_steps=50 eval.inference_mode=mul \ eval.cam_type=1 eval.video_path=example_data/bear # Stage 2: MeanFlow checkpoint python inference.py eval.ckpt_path=models/checkpoints/meanflow_epoch_20.safetensors \ eval.num_inference_steps=4 eval.inference_mode=any \ eval.cam_type=1 eval.video_path=example_data/bear # Stage 3: on-policy-distilled checkpoint python inference.py eval.ckpt_path=models/checkpoints/onpolicy_epoch_5.safetensors \ eval.num_inference_steps=4 eval.inference_mode=any \ eval.cam_type=1 eval.video_path=example_data/bear
-
Evaluate a generated video (the example below evaluates the output of the final checkpoint)
python evaluate.py --data_path results/bear/onpolicy_epoch5_4NFE_cam1.mp4
This project builds on the following excellent works. Many thanks to the authors for releasing their code.
- ReDirector: Creating Any-Length Video Retakes with Rotary Camera Encoding
- ReCamMaster: Camera-Controlled Generative Rendering from A Single Video
- REPA: Representation Alignment for Generation
- VGGT: Visual Geometry Grounded Transformer
- Improved MeanFlow: On the Challenges of Fastforward Generative Models
- AnyFlow: Any-Step Video Diffusion Model with On-Policy Flow Map Distillation
- FastGen: Fast Generation from Diffusion Models
If you find this repository helpful for your project, please consider citing our work. :)
@article{park2026flashrender,
title={FlashRender: Few-Step Generative Rendering via Camera-Controlled Video MeanFlow},
author={Park, Byeongjun and Kim, Byung-Hoon and Chung, Hyungjin},
journal={arXiv preprint arXiv:2609.03563},
year={2026}
}This project is released under the Apache License 2.0.



