Skip to content

About

Official pytorch implementation of "FlashRender: Few-Step Generative Rendering via Camera-Controlled Video MeanFlow"

Topics

Resources

Stars

13 stars

Watchers

1 watching

Forks

Repository files navigation

⚡ FlashRender ⚡

Few-Step Generative Rendering via Camera-Controlled Video MeanFlow

Byeongjun Park  ·  Byung-Hoon Kim  ·  Hyungjin Chung

arXiv Project Page HuggingFace License


Input Video (left)  ·  Target Retake (right)

🔥 High-quality camera-controlled video-to-video generation in just 4 sampling steps!! 🔥

📑 Table of Contents

🔧 Setup

  1. 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
  2. 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/
    
  3. 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

🚀 Training

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.

  1. Stage 1 (train.py) — Multi-step flow-matching model (t = r)

    torchrun --nproc-per-node=8 train.py dataset_path=<path/to/dataset>
  2. Stage 2 (train_meanflow.py) — Few-step MeanFlow model, resumed from Stage 1

    torchrun --nproc-per-node=8 train_meanflow.py \
        meanflow.resume_checkpoint=models/checkpoints/epoch_20.safetensors
  3. Stage 3 (train_onpolicy.py) — On-policy flow-map distillation of the Stage 2 student

    torchrun --nproc-per-node=8 train_onpolicy.py \
        onpolicy.teacher_checkpoint=models/checkpoints/epoch_20.safetensors \
        onpolicy.student_checkpoint=models/checkpoints/meanflow_epoch_20.safetensors

🎬 Inference and Evaluation

  1. Download checkpoints (skip if you already ran download_model.py during setup)

    Stage Checkpoint file Download
    1 epoch_20.safetensors Checkpoint (Stage 1)
    2 meanflow_epoch_20.safetensors Checkpoint (Stage 2)
    3 onpolicy_epoch_5.safetensors Checkpoint (Stage 3)
  2. 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
  3. 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

🙏 Acknowledgement

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

📚 Citation

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}
}

📄 License

This project is released under the Apache License 2.0.

About

Official pytorch implementation of "FlashRender: Few-Step Generative Rendering via Camera-Controlled Video MeanFlow"

Topics

Resources

Stars

13 stars

Watchers

1 watching

Forks

Contributors

Languages