Zihan-Su / Self_Gradient_Forcing_Plus
git clone https://github.com/Zihan-Su/Self_Gradient_Forcing_Plus.git
Autoregressive video generation with decoupled context-writing and denoising parameters, enabling up to 24-hour generation from 5s training windows.
+0
stars, 24h · #34,575
+~0
stars, 7 days · #35,050
+211
stars, 30 days · #2,386
215
★ total
10
forks · 3 open issues
Star history (as recorded here)
LanguagePython
LicenseApache-2.0
Created2026-10-07 (15d ago)
Last push2d ago
Watchers7
OwnerUser
Links
- GitHub: github.com/Zihan-Su/Self_Gradient_Forcing_Plus
- Homepage: https://zihan-su.github.io/self-gradient-forcing-plus
- Releases · Issues · Hacker News mentions
README excerpt
# Self Gradient Forcing Plus ### Decoupling Gradient Flows for Autoregressive Video Generation Zihan Su 1,2* , Junhao Zhuang 2*† , Yaowei Li 2 , Siwen Lu 1 , Haoran Li 2 , Lingen Li 3 , Haoyu Wu 2 Weiyang Jin 2 , Songchun Zhang 2 , Haoyang Huang 2 , Chun Yuan 1† , Zeyue Xue 2 , Nan Duan 2 1 Tsinghua University 2 Joy Future Academy, JD 3 The Chinese University of Hong Kong * Equal contribution. † Corresponding authors. ⭐ If Self Gradient Forcing Plus is useful for your research, please consider starring this repository. ## 🔥 News - **2026-10-20**: We release our blog Streaming Video Generation: Past and Future, tracing the evolution of autoregressive video generation. We hope it offers useful insights to the community. - **2026-10-9**: We release the code for reproducing the gradient-conflict phenomena observed at the SGF and teacher-forcing initialization checkpoints. See the reproduction guide. In fact, beyond Wan2.1-1.3B, we have also observed this phenomenon in LTX-2.5. - **2026-10-7**: Paper, model checkpoints, inference scripts, and training code are publicly released. ## 🎬 Video Comparisons Left to right: **Self Forcing · Self Gradient Forcing · Self Gradient Forcing Plus**. More videos are available on our project page. **By the train window** https://github.com/user-attachments/assets/1fd94100-b832-4202-80ad-de5c8158f86d **A tiny monster, a candle** https://github.com/user-attachments/assets/af3fb848-2927-4b46-b9f6-8d62bd1dd31f ## 🧠 Method Overview We uncover conflicting gradients between context writing and denoising in SGF. These gradients partially cancel on shared parameters, motivating separate optimization. SGF+ separates context-writing and denoising parameters to resolve conflicting gradient updates, improving autoregressive video generation and enabling rollouts of up to 24 hours from only 5s training windows. ## 🛠️ Installation The environment follows the SGF setup. [code] Run the following commands from the repository root. ## ⬇️ Download Weights [code] The script uses the Hugging Face CLI command `hf` by default. Set `HF_CLI=huggingface-cli` if your environment still uses the older command name. It downloads: - Wan base models to `wan_models/Wan2.1-T2V-1.3B` and `wan_models/Wan2.1-T2V-14B`. - Causal-Forcing AR initialization checkpoints to `checkpoints/init/chunkwise/ar_diffusion.pt` and `checkpoints/init/framewise/ar_diffusion.pt`. - Released SGF+ inference checkpoints to `hf_weights/chunkwise/model.pt` and `hf_weights/framewise/model.pt`. - The training prompt list to `prompts/vidprom_filtered_extended.txt`. Run `hf auth login` first if authentication is required. ## 🚀 Inference The default prompt file is `prompts/test_prompt.txt` with 8 prompts. The launcher uses 8 GPUs when at least 8 GPUs are visible; otherwise it falls back to single-GPU serial inference. By default it generates `963` latent frames, which decode to about 240 seconds of video at 16 fps. The inference script takes the release setting name