[ICLR 2026] NewtonGen: Physics-Consistent and Controllable Text-to-Video Generation via Neural Newtonian Dynamics
146
stars
29
commits
Python
primary language
Jun 9, 2026
updated
This repository is the official implementation of NewtonGen.
[ICLR 2026] NewtonGen: Physics-Consistent and Controllable Text-to-Video Generation via Neural Newtonian Dynamics
Yu Yuan, Xijun Wang, Tharindu Wickremasinghe, Zeeshan Nadir, Bole Ma, Stanley H. Chan

conda create -n newtongen python=3.10
conda activate newtongen
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1
git clone https://github.com/pandayuanyu/NewtonGen.git
cd NewtonGen
pip install -r requirements.txt
One more step: you need to move the folder git under where you install package rp, we can check the location of rp by
pip show rp
Once finished, you can see the path like virtual_envs/newtongen/lib/python3.10/site-packages/rp/git/CommonSource/
There are 3 types of weights you need to download/prepare.
learned_dynamicsLinear motions (uniform motion, acceleration, deceleration, 3D motion, slope sliding, parabolic motion)
Use inference_Linear_withprompts.py since the object can be treated as a whole when rendering optical flow.
Other motions (rotation, size changing, parabolic motion with rotation, damped oscillation)
These require separate handling because different parts of the object move in different directions. Each has its own inference script.
Set all the MODEL_PATH, sample_path=sample_path, output_mp4_path and other roots to your own ones in the inference_xx.py.
We have provided the well-trained NND weights at folder learned_dynamics.
Change the Z0 dict in config_list according to your need. Tips: set the size-related s l larger will have a better visual effect.
config_list = [
dict(
z0=[6.9901, 9.3459, 5.558, -4.8493, 0.0, 0.0, 1.0, 2.0, 2.0], # x y vx vy theta omega s l a
DT=0.02, # delta time between each 2 frames
METER_PER_PX=0.05, # world size: 360*0.05 = 18m
chosen_shape="circle", # the nearest shape of the object
output_name="set_a"
),
]
python inference_xx.py
Run the scripts in folder data_simulation. We also provide some simulated samples in the folder.
You can also write other motions' simulators following our pipeline or collect high-fps real-world videos by yourself.
Run the script in folder physical_encoder. For Circular Motion and Damped Oscillation, please use phys_encoder_circular_oscillation.py, all other motions, please use phys_encoder.py.
Before you start NND training, set the dynamics_batch, other root paths, and hyper-parameters in the train.py,
python train.py
You can prepare validation Physical States Labels from upper step 1, or you can ignore the validation part in the train.py.
We calculated the Physical Invariance Score (PIS) for evaluation.
The code is in the evaluation_PIS folder. First run sam2_pipeline.py to get masks, then use masked_physical_features_pis.py.
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 Go-with-the-Flow for their amazing jobs.
If you feel this project helpful/insightful, please cite our paper:
@article{Yuan_2025_NewtonGen,
title={{NewtonGen}: Physics-Consistent and Controllable Text-to-Video Generation via Neural Newtonian Dynamics},
author={Yuan, Yu and Wang, Xijun and Wickremasinghe, Tharindu and Nadir, Zeeshan and Ma, Bole and Chan, Stanley H.},
journal={arXiv preprint arXiv:2509.21309},
year={2025}
}
If you have any questions or comments, feel free to contact me through email (mryuanyu@outlook.com). Suggestions and collaborations are also highly welcome!
29 commits
Python
92.4%
Jupyter Notebook
7.6%
[ICLR 2026] NewtonGen: Physics-Consistent and Controllable Text-to-Video Generation via Neural Newtonian Dynamics
146
stars
29
commits
Python
primary language
Jun 9, 2026
updated
This repository is the official implementation of NewtonGen.
[ICLR 2026] NewtonGen: Physics-Consistent and Controllable Text-to-Video Generation via Neural Newtonian Dynamics
Yu Yuan, Xijun Wang, Tharindu Wickremasinghe, Zeeshan Nadir, Bole Ma, Stanley H. Chan

conda create -n newtongen python=3.10
conda activate newtongen
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1
git clone https://github.com/pandayuanyu/NewtonGen.git
cd NewtonGen
pip install -r requirements.txt
One more step: you need to move the folder git under where you install package rp, we can check the location of rp by
pip show rp
Once finished, you can see the path like virtual_envs/newtongen/lib/python3.10/site-packages/rp/git/CommonSource/
There are 3 types of weights you need to download/prepare.
learned_dynamicsLinear motions (uniform motion, acceleration, deceleration, 3D motion, slope sliding, parabolic motion)
Use inference_Linear_withprompts.py since the object can be treated as a whole when rendering optical flow.
Other motions (rotation, size changing, parabolic motion with rotation, damped oscillation)
These require separate handling because different parts of the object move in different directions. Each has its own inference script.
Set all the MODEL_PATH, sample_path=sample_path, output_mp4_path and other roots to your own ones in the inference_xx.py.
We have provided the well-trained NND weights at folder learned_dynamics.
Change the Z0 dict in config_list according to your need. Tips: set the size-related s l larger will have a better visual effect.
config_list = [
dict(
z0=[6.9901, 9.3459, 5.558, -4.8493, 0.0, 0.0, 1.0, 2.0, 2.0], # x y vx vy theta omega s l a
DT=0.02, # delta time between each 2 frames
METER_PER_PX=0.05, # world size: 360*0.05 = 18m
chosen_shape="circle", # the nearest shape of the object
output_name="set_a"
),
]
python inference_xx.py
Run the scripts in folder data_simulation. We also provide some simulated samples in the folder.
You can also write other motions' simulators following our pipeline or collect high-fps real-world videos by yourself.
Run the script in folder physical_encoder. For Circular Motion and Damped Oscillation, please use phys_encoder_circular_oscillation.py, all other motions, please use phys_encoder.py.
Before you start NND training, set the dynamics_batch, other root paths, and hyper-parameters in the train.py,
python train.py
You can prepare validation Physical States Labels from upper step 1, or you can ignore the validation part in the train.py.
We calculated the Physical Invariance Score (PIS) for evaluation.
The code is in the evaluation_PIS folder. First run sam2_pipeline.py to get masks, then use masked_physical_features_pis.py.
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 Go-with-the-Flow for their amazing jobs.
If you feel this project helpful/insightful, please cite our paper:
@article{Yuan_2025_NewtonGen,
title={{NewtonGen}: Physics-Consistent and Controllable Text-to-Video Generation via Neural Newtonian Dynamics},
author={Yuan, Yu and Wang, Xijun and Wickremasinghe, Tharindu and Nadir, Zeeshan and Ma, Bole and Chan, Stanley H.},
journal={arXiv preprint arXiv:2509.21309},
year={2025}
}
If you have any questions or comments, feel free to contact me through email (mryuanyu@outlook.com). Suggestions and collaborations are also highly welcome!
29 commits
Python
92.4%
Jupyter Notebook
7.6%