{"id":20845607,"url":"https://github.com/siliconflow/dit_latte","last_synced_at":"2026-03-02T09:33:28.577Z","repository":{"id":245284033,"uuid":"809274300","full_name":"siliconflow/dit_latte","owner":"siliconflow","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-12T07:07:24.000Z","size":37149,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T07:38:27.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siliconflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-02T08:14:07.000Z","updated_at":"2024-07-12T07:07:29.000Z","dependencies_parsed_at":"2025-02-28T00:06:22.602Z","dependency_job_id":null,"html_url":"https://github.com/siliconflow/dit_latte","commit_stats":null,"previous_names":["siliconflow/dit_latte"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/siliconflow/dit_latte","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siliconflow%2Fdit_latte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siliconflow%2Fdit_latte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siliconflow%2Fdit_latte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siliconflow%2Fdit_latte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siliconflow","download_url":"https://codeload.github.com/siliconflow/dit_latte/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siliconflow%2Fdit_latte/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29997213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T02:13:25.289Z","updated_at":"2026-03-02T09:33:28.534Z","avatar_url":"https://github.com/siliconflow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Note this is a fork from: https://github.com/Vchitect/Latte\r\n\r\n## Latte: Latent Diffusion Transformer for Video Generation\u003cbr\u003e\u003csub\u003eOfficial PyTorch Implementation\u003c/sub\u003e\r\n\r\n\u003c!-- ### [Paper](https://arxiv.org/abs/2401.03048v1) | [Project Page](https://maxin-cn.github.io/latte_project/) --\u003e\r\n\r\n\u003c!-- [![arXiv](https://img.shields.io/badge/arXiv-2401.03048-b31b1b.svg)](https://arxiv.org/abs/2401.03048) --\u003e\r\n[![Arxiv](https://img.shields.io/badge/Arxiv-b31b1b.svg)](https://arxiv.org/abs/2401.03048) \r\n[![Project Page](https://img.shields.io/badge/Project-Website-blue)](https://maxin-cn.github.io/latte_project/)\r\n[![HF Demo](https://img.shields.io/static/v1?label=Demo\u0026message=OpenBayes%E8%B4%9D%E5%BC%8F%E8%AE%A1%E7%AE%97\u0026color=green)](https://openbayes.com/console/public/tutorials/UOeU0ywVxl7) \r\n\r\nThis repo contains PyTorch model definitions, pre-trained weights, and training/sampling code for our paper exploring \r\nlatent diffusion models with transformers (Latte). You can find more visualizations on our [project page](https://maxin-cn.github.io/latte_project/).\r\n\r\n\u003e [**Latte: Latent Diffusion Transformer for Video Generation**](https://maxin-cn.github.io/latte_project/)\u003cbr\u003e\r\n\u003e [Xin Ma](https://maxin-cn.github.io/), [Yaohui Wang*](https://wyhsirius.github.io/), [Xinyuan Chen](https://scholar.google.com/citations?user=3fWSC8YAAAAJ), [Gengyun Jia](https://scholar.google.com/citations?user=_04pkGgAAAAJ\u0026hl=zh-CN), [Ziwei Liu](https://liuziwei7.github.io/), [Yuan-Fang Li](https://users.monash.edu/~yli/), [Cunjian Chen](https://cunjian.github.io/), [Yu Qiao](https://scholar.google.com.hk/citations?user=gFtI-8QAAAAJ\u0026hl=zh-CN)\r\n\u003e (*Corresponding Author \u0026 Project Lead)\r\n\u003c!-- \u003e \u003cbr\u003eMonash University, Shanghai Artificial Intelligence Laboratory,\u003cbr\u003e NJUPT, S-Lab, Nanyang Technological University \r\n\r\nWe propose a novel Latent Diffusion Transformer, namely Latte, for video generation. Latte first extracts spatio-temporal tokens from input videos and then adopts a series of Transformer blocks to model video distribution in the latent space. In order to model a substantial number of tokens extracted from videos, four efficient variants are introduced from the perspective of decomposing the spatial and temporal dimensions of input videos. To improve the quality of generated videos, we determine the best practices of Latte through rigorous experimental analysis, including video clip patch embedding, model variants, timestep-class information injection, temporal positional embedding, and learning strategies. Our comprehensive evaluation demonstrates that Latte achieves state-of-the-art performance across four standard video generation datasets, i.e., FaceForensics, SkyTimelapse, UCF101, and Taichi-HD. In addition, we extend Latte to text-to-video generation (T2V) task, where Latte achieves comparable results compared to recent T2V models. We strongly believe that Latte provides valuable insights for future research on incorporating Transformers into diffusion models for video generation.\r\n\r\n ![The architecture of Latte](visuals/architecture.svg){width=20}\r\n --\u003e\r\n\r\n\u003c!--\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg src=\"visuals/architecture.svg\" width=\"650\"\u003e\r\n\u003c/div\u003e\r\n\r\nThis repository contains:\r\n\r\n* 🪐 A simple PyTorch [implementation](models/latte.py) of Latte\r\n* ⚡️ **Pre-trained Latte models** trained on FaceForensics, SkyTimelapse, Taichi-HD and UCF101 (256x256). In addition, we provide a T2V checkpoint (512x512). All checkpoints can be found [here](https://huggingface.co/maxin-cn/Latte/tree/main). \r\n\r\n* 🛸 A Latte [training script](train.py) using PyTorch DDP.\r\n--\u003e\r\n\r\n## News\r\n- (🔥 New) **May 23, 2024** 💥 **Latte-1** is released! Pre-trained model can be downloaded [here](https://huggingface.co/maxin-cn/Latte-1/tree/main/transformer). **We support both T2V and T2I**. Please run `bash sample/t2v.sh` and `bash sample/t2i.sh` respectively.\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg src=\"visuals/latteT2V.gif\" width=88%\u003e\r\n\u003c/div\u003e\r\n\r\n- (🔥 New) **Feb 24, 2024** 💥 We are very grateful that researchers and developers like our work. We will continue to update our LatteT2V model, hoping that our efforts can help the community develop. Our Latte discord channel \u003ca href=\"https://discord.gg/RguYqhVU92\" style=\"text-decoration:none;\"\u003e\r\n\u003cimg src=\"https://user-images.githubusercontent.com/25839884/218347213-c080267f-cbb6-443e-8532-8e1ed9a58ea9.png\" width=\"3%\" alt=\"\" /\u003e\u003c/a\u003e is created for discussions. Coders are welcome to contribute.\r\n\r\n- (🔥 New) **Jan 9, 2024** 💥 An updated LatteT2V model initialized with the [PixArt-α](https://github.com/PixArt-alpha/PixArt-alpha) is released, the checkpoint can be found [here](https://huggingface.co/maxin-cn/Latte-0/tree/main/transformer).\r\n\r\n- (🔥 New) **Oct 31, 2023** 💥 The training and inference code is released. All checkpoints (including FaceForensics, SkyTimelapse, UCF101, and Taichi-HD) can be found [here](https://huggingface.co/maxin-cn/Latte/tree/main). In addition, the LatteT2V inference code is provided.\r\n\r\n\r\n## Setup\r\n\r\nFirst, download and set up the repo:\r\n\r\n```bash\r\ngit clone https://github.com/Vchitect/Latte\r\ncd Latte\r\n```\r\n\r\nWe provide an [`environment.yml`](environment.yml) file that can be used to create a Conda environment. If you only want \r\nto run pre-trained models locally on CPU, you can remove the `cudatoolkit` and `pytorch-cuda` requirements from the file.\r\n\r\n```bash\r\nconda env create -f environment.yml\r\nconda activate latte\r\n```\r\n\r\n\r\n## Sampling \r\n\r\nYou can sample from our **pre-trained Latte models** with [`sample.py`](sample/sample.py). Weights for our pre-trained Latte model can be found [here](https://huggingface.co/maxin-cn/Latte).  The script has various arguments to adjust sampling steps, change the classifier-free guidance scale, etc. For example, to sample from our model on FaceForensics, you can use:\r\n\r\n```bash\r\nbash sample/ffs.sh\r\n```\r\n\r\nor if you want to sample hundreds of videos, you can use the following script with Pytorch DDP:\r\n\r\n```bash\r\nbash sample/ffs_ddp.sh\r\n```\r\n\r\nIf you want to try generating videos from text, just run `bash sample/t2v.sh`. All related checkpoints will download automatically.\r\n\r\n## Training\r\n\r\nWe provide a training script for Latte in [`train.py`](train.py). This script can be used to train class-conditional and unconditional\r\nLatte models. To launch Latte (256x256) training with `N` GPUs on the FaceForensics dataset \r\n:\r\n\r\n```bash\r\ntorchrun --nnodes=1 --nproc_per_node=N train.py --config ./configs/ffs/ffs_train.yaml\r\n```\r\n\r\nor If you have a cluster that uses slurm, you can also train Latte's model using the following scripts:\r\n\r\n ```bash\r\nsbatch slurm_scripts/ffs.slurm\r\n```\r\n\r\nWe also provide the video-image joint training scripts [`train_with_img.py`](train_with_img.py). Similar to [`train.py`](train.py) scripts, these scripts can be also used to train class-conditional and unconditional\r\nLatte models. For example, if you want to train the Latte model on the FaceForensics dataset, you can use:\r\n\r\n```bash\r\ntorchrun --nnodes=1 --nproc_per_node=N train_with_img.py --config ./configs/ffs/ffs_img_train.yaml\r\n```\r\n\r\n## Contact Us\r\n**Yaohui Wang**: [wangyaohui@pjlab.org.cn](mailto:wangyaohui@pjlab.org.cn)\r\n**Xin Ma**: [xin.ma1@monash.edu](mailto:xin.ma1@monash.edu)\r\n\r\n## Citation\r\nIf you find this work useful for your research, please consider citing it.\r\n```bibtex\r\n@article{ma2024latte,\r\n  title={Latte: Latent Diffusion Transformer for Video Generation},\r\n  author={Ma, Xin and Wang, Yaohui and Jia, Gengyun and Chen, Xinyuan and Liu, Ziwei and Li, Yuan-Fang and Chen, Cunjian and Qiao, Yu},\r\n  journal={arXiv preprint arXiv:2401.03048},\r\n  year={2024}\r\n}\r\n```\r\n\r\n\r\n## Acknowledgments\r\nLatte has been greatly inspired by the following amazing works and teams: [DiT](https://github.com/facebookresearch/DiT) and [PixArt-α](https://github.com/PixArt-alpha/PixArt-alpha), we thank all the contributors for open-sourcing.\r\n\r\n\r\n## License\r\nThe code and model weights are licensed under [LICENSE](LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiliconflow%2Fdit_latte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiliconflow%2Fdit_latte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiliconflow%2Fdit_latte/lists"}