OnlyFlow: Optical Flow based Motion Conditioning for Video Diffusion Models
21
stars
2
commits
Python
primary language
Jul 27, 2026
updated
This repository is the official implementation of OnlyFlow, published at the CVPR 2025 Workshops.
This main branch contains the codes and model for OnlyFlow implemented on AnimateDiff v3.
OnlyFlow: Optical Flow based Motion Conditioning for Video Diffusion Models
Mathis Koroglu, Hugo Caselles-Dupré, Guillaume Jeanneret Sanmiguel, Matthieu Cord

conda env create -f envs/environment-cuda.yaml
conda activate cameractrl
use environment-cpu.yaml for CPU only.
We provide a custom diffusers compatible OnlyFlowPipeline for inference.
Exemple usage is shown in inference/generate.py
The diffusers pipeline has been modified using our own Diffusers library fork to accomodate the following changes:
Here are examples of videos created by the model, with from left to right:

Download the dataset as described in the Dataset section.
Update the below paths to data in the config presets of configs/presets/*/*.yaml
dataset:
shards: ${oc.env:PWD}/../webvid/webvid_desc.json
Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files. Adjust the parameters according to your needs and your hardware.
Then, launch the model training using slurm integrated multiprocess launcher:
sbatch training/slurm/long-slurm/submit-a100.slurm
or torchrun:
sbatch training/slurm/long-slurm/submit-a100.slurm
Note that all our code has been tested on a single node with 8 A100 GPUs. The scripts, their arguments and presets have been designed to work with jean zay computer's slurm scheduler and environment.
or directly using our distributed launching script and specify the distributed settings as environment variables:
./training/dist_run.sh training/train.py +presets=zay/v100-4
We provide our pretrained checkpoint of the OnlyFlow model in HuggingFace.
This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.
We thank AnimateDiff for their codes and models. We thank CameraCtrl for their codes and templates that we used in this project.
This project was provided with computing HPC & AI and storage resources by GENCI at IDRIS thanks to the grant 2024-AD011014329R1 on the supercomputer Jean Zay’s V100 & A100 partitions.
@InProceedings{Koroglu_2025_CVPR,
author = {Koroglu, Mathis and Caselles-Dupr\'e, Hugo and Jeanneret, Guillaume and Cord, Matthieu},
title = {OnlyFlow: Optical Flow based Motion Conditioning for Video Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2025},
pages = {6280-6290}
}
2 commits
Python
96.1%
Shell
3.9%
OnlyFlow: Optical Flow based Motion Conditioning for Video Diffusion Models
21
stars
2
commits
Python
primary language
Jul 27, 2026
updated
This repository is the official implementation of OnlyFlow, published at the CVPR 2025 Workshops.
This main branch contains the codes and model for OnlyFlow implemented on AnimateDiff v3.
OnlyFlow: Optical Flow based Motion Conditioning for Video Diffusion Models
Mathis Koroglu, Hugo Caselles-Dupré, Guillaume Jeanneret Sanmiguel, Matthieu Cord

conda env create -f envs/environment-cuda.yaml
conda activate cameractrl
use environment-cpu.yaml for CPU only.
We provide a custom diffusers compatible OnlyFlowPipeline for inference.
Exemple usage is shown in inference/generate.py
The diffusers pipeline has been modified using our own Diffusers library fork to accomodate the following changes:
Here are examples of videos created by the model, with from left to right:

Download the dataset as described in the Dataset section.
Update the below paths to data in the config presets of configs/presets/*/*.yaml
dataset:
shards: ${oc.env:PWD}/../webvid/webvid_desc.json
Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files. Adjust the parameters according to your needs and your hardware.
Then, launch the model training using slurm integrated multiprocess launcher:
sbatch training/slurm/long-slurm/submit-a100.slurm
or torchrun:
sbatch training/slurm/long-slurm/submit-a100.slurm
Note that all our code has been tested on a single node with 8 A100 GPUs. The scripts, their arguments and presets have been designed to work with jean zay computer's slurm scheduler and environment.
or directly using our distributed launching script and specify the distributed settings as environment variables:
./training/dist_run.sh training/train.py +presets=zay/v100-4
We provide our pretrained checkpoint of the OnlyFlow model in HuggingFace.
This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.
We thank AnimateDiff for their codes and models. We thank CameraCtrl for their codes and templates that we used in this project.
This project was provided with computing HPC & AI and storage resources by GENCI at IDRIS thanks to the grant 2024-AD011014329R1 on the supercomputer Jean Zay’s V100 & A100 partitions.
@InProceedings{Koroglu_2025_CVPR,
author = {Koroglu, Mathis and Caselles-Dupr\'e, Hugo and Jeanneret, Guillaume and Cord, Matthieu},
title = {OnlyFlow: Optical Flow based Motion Conditioning for Video Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2025},
pages = {6280-6290}
}
2 commits
Python
96.1%
Shell
3.9%