https://github.com/compvis/maskflow

MaskFlow: Discrete Flows For Flexible and Efficient Long Video Generation

https://github.com/compvis/maskflow

Science Score: 33.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

MaskFlow: Discrete Flows For Flexible and Efficient Long Video Generation

Basic Info
Statistics
  • Stars: 24
  • Watchers: 3
  • Forks: 3
  • Open Issues: 1
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

MaskFlow: Discrete Flows for Flexible and Efficient Long Video Generation

This repository represents the official implementation of the paper titled "[MaskFlow: Discrete Flows for Flexible and Efficient Long Video Generation".

Website Paper License visitors

Michael Fuest, Vincent Tao Hu, Bjrn Ommer

teaser

TLDR

MaskFlow is a chunkwise autoregressive approach to long video generation that uses frame-level masking and confidence-based heuristic sampling to produce seamless, high-quality video sequences efficiently. Instead of generating entire videos at once, MaskFlow generates overlapping chunks of frames, where each new chunk is conditioned on previously generated frames to ensure temporal consistency. During training, the model learns to reconstruct partially masked frames, making it naturally suited for extending video sequences while maintaining coherence. The frame-level masking strategy aligns perfectly with chunkwise generation, enabling the model to handle different levels of corruption while ensuring smooth transitions. To further speed up inference, we incorporate confidence-based heuristic sampling, selectively unmasking only the most confidently predicted tokens at each step. This approach allows MaskFlow to generate long videos with greater flexibility and efficiency than traditional methods..

Citation

Please cite our paper:

bibtex @InProceedings{fuest2025maskflow, title={MaskFlow: Discrete Flows for Flexible and Efficient Long Video Generation}, author={Michael Fuest and Vincent Tao Hu and Bjrn Ommer}, booktitle = {Arxiv}, year={2025} }

:whitecheckmark: Updates

  • Mar. 4th, 2025: Training code released.
  • Feb. 16th, 2025: Arxiv released.

Training

FaceForensics

bash CUDA_VISIBLE_DEVICES=0,1,2,3 accelerate launch --num_processes 4 --num_machines 1 --multi_gpu --main_process_ip 127.0.0.1 --main_process_port 8868 train_acc_vq.py model=dlatte_xl2 compile=pre mixed_precision=fp16 dynamic.scheduling_matrix=full_sequence dynamic=maskflow dynamic.scheduler=sigmoid dynamic.time_cond=1 dynamic.mask_ce=1 input_tensor_type=btwh tokenizer=sd_vq_f8 data=ffs_indices data.sample_fid_every=50_000 data.batch_size=2 data.sample_fid_bs=1 data.sample_fid_n=10_0 data.sample_fid_every=400_000 data.sample_vis_n=1 data.sample_vis_every=50_000 data.num_workers_per_gpu=12 ckpt_every=200_000 data.train_steps=400_000 dynamic.reweigh_loss=snr dynamic.cum_snr_decay=0.8 dynamic.snr_clip=6.0 dynamic.use_fused_snr=1 dynamic.objective=pred_x0 dynamic.noise_level=random_all tokenizer.latent_size=32 dynamic.sampler=mgm dynamic.sampling_timesteps=20 dynamic.n_context_frames=2 dynamic.sampling_window_stride=12 dynamic.sampling_horizon=16 dynamic.sampling_timesteps=20

DMLab

bash CUDA_VISIBLE_DEVICES=0,1,2,3 accelerate launch --num_processes 4 --num_machines 1 --multi_gpu --main_process_ip 127.0.0.1 --main_process_port 8868 train_acc_vq.py model=dlatte_b2 compile=pre mixed_precision=fp16 dynamic.scheduling_matrix=full_sequence dynamic=maskflow dynamic.scheduler=sigmoid dynamic.time_cond=1 dynamic.mask_ce=1 input_tensor_type=btwh tokenizer=sd_vq_f8 data=dmlab_indices data.sample_fid_every=50_000 data.batch_size=3 data.sample_fid_bs=1 data.sample_fid_n=10_0 data.sample_fid_every=400_000 data.sample_vis_n=1 data.sample_vis_every=50_000 data.num_workers_per_gpu=12 ckpt_every=200_000 data.train_steps=400_000 dynamic.reweigh_loss=snr dynamic.cum_snr_decay=0.8 dynamic.snr_clip=6.0 dynamic.use_fused_snr=1 dynamic.objective=pred_x0 dynamic.noise_level=random_all tokenizer.latent_size=32 dynamic.sampler=mgm dynamic.sampling_timesteps=20 dynamic.n_context_frames=2 dynamic.sampling_window_stride=12 dynamic.sampling_horizon=16 dynamic.sampling_timesteps=20

Evaluation

FaceForensics

bash TODO

DMLab

bash TODO

Weights

TODO

Dataset Preparation

TODO

License

This work is licensed under the Apache License, Version 2.0 (as defined in the LICENSE).

By downloading and using the code and model you agree to the terms in the LICENSE.

License

Owner

  • Name: CompVis - Computer Vision and Learning LMU Munich
  • Login: CompVis
  • Kind: organization
  • Email: assist.mvl@lrz.uni-muenchen.de
  • Location: Germany

Computer Vision and Learning research group at Ludwig Maximilian University of Munich (formerly Computer Vision Group at Heidelberg University)

GitHub Events

Total
  • Watch event: 23
  • Push event: 25
  • Fork event: 3
  • Create event: 1
Last Year
  • Watch event: 23
  • Push event: 25
  • Fork event: 3
  • Create event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 5
  • Total Committers: 2
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.2
Past Year
  • Commits: 5
  • Committers: 2
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.2
Top Committers
Name Email Commits
Michael Fuest g****h@m****e 4
Tao Hu d****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago


Dependencies

ldm/environment.yaml pypi
  • albumentations ==0.4.3
  • einops ==0.3.0
  • imageio ==2.9.0
  • imageio-ffmpeg ==0.4.2
  • omegaconf ==2.1.1
  • opencv-python ==4.1.2.30
  • pudb ==2019.2
  • pytorch-lightning ==1.4.2
  • streamlit >=0.73.1
  • test-tube >=0.7.5
  • torch-fidelity ==0.3.0
  • transformers ==4.3.1
ldm/setup.py pypi
  • numpy *
  • torch *
  • tqdm *
requirements.txt pypi
  • absl-py *
  • accelerate *
  • av ==13.1.0
  • blobfile *
  • click *
  • colorama *
  • decord *
  • diffusers *
  • einops *
  • fairscale *
  • gluonts ==0.13.1
  • h5py *
  • hydra-core *
  • imageio *
  • internetarchive *
  • lightning *
  • loguru *
  • lpips *
  • matplotlib *
  • ml_collections *
  • moviepy *
  • omegaconf *
  • open_clip-torch *
  • opencv-python *
  • pandas *
  • pyrealsense2 *
  • pytorch_lightning *
  • pytorchvideo *
  • pyzmq *
  • rotary_embedding_torch *
  • scikit-learn *
  • timm *
  • torch ==2.5.0
  • torch-fidelity *
  • torchdiffeq *
  • torchmetrics *
  • torchvision ==0.20.0
  • tqdm *
  • transformers *
  • wandb *
  • wandb-osh ==1.2.1
  • webdataset *
  • xformers *
utils/dgm_eval/setup.py pypi
  • numpy ==1.23.3
  • open_clip_torch ==2.19.0
  • opencv-python ==4.6.0.66
  • pandas ==1.5.3
  • pillow ==9.2.0
  • scikit-image ==0.19.3
  • scikit-learn ==1.1.3
  • scipy ==1.9.3
  • timm ==0.8.19.dev0
  • torch >=2.0.0
  • torchvision >=0.2.2
  • transformers ==4.26.0
  • xformers ==0.0.18