FloodDiffusion: 为流动运动生成而定制的扩散强制
[Project Page] | [Paper (arXiv)]
We present FloodDiffusion, a new framework for text-driven, streaming human motion generation. Given time-varying text prompts, FloodDiffusion generates text-aligned, seamless motion sequences with real-time latency.
# Create conda environment
conda create -n motion_gen python=3.10
conda activate motion_gen
# Install PyTorch
pip install torch torchvision torchaudio
# Install dependencies
pip install -r requirements.txt
# Install Flash Attention
conda install -c nvidia cuda-toolkit
export CUDA_HOME=$CONDA_PREFIX
pip install flash-attn --no-build-isolationIf you only need to generate motions and don't plan to train or evaluate models, you can use our standalone model on Hugging Face:
This version requires no dataset downloads and works out-of-the-box for inference:
…For detailed API documentation, see the model card.
We also provide a tiny version of it which is smaller and faster ShandaAI/FloodDiffusionTiny:
from transformers import AutoModel
# Load model
model = AutoModel.from_pretrained(
"ShandaAI/FloodDiffusionTiny",
trust_remote_code=True
)Note: For training, evaluation, or using the scripts in this repository, continue with the Data Preparation section below.
To reproduce our results from scratch, follow the original data preparation pipelines:
HumanML3D:
raw_data/HumanML3D/BABEL:
raw_data/BABEL_streamed/Dependencies:
We provide all necessary data (datasets, dependencies, and pretrained models) on Hugging Face: ShandaAI/FloodDiffusionDownloads
For inference only (downloads deps/ and outputs/):
pip install huggingface_hub
python download_assets.pyFor training/evaluation (also downloads datasets in raw_data/):
pip install huggingface_hub
python download_assets.py --with-datasetThis will automatically download and extract files into the correct directories.
After downloading or preparing the data, your project should have the following structure:
Dependencies Directory:
deps/
├── t2m/ # Text-to-Motion evaluation models
│ ├── humanml3d/ # HumanML3D evaluator
│ ├── kit/ # KIT-ML evaluator
│ └── meta/ # Statistics (mean.npy, std.npy)
├── glove/ # GloVe word embeddings
│ ├── our_vab_data.npy
│ ├── our_vab_idx.pkl
│ └── our_vab_words.pkl
└── t5_umt5-xxl-enc-bf16/ # T5 text encoderDataset Directory:
…Pretrained Models Directory:
outputs/
├── vae_1d_z4_step=300000.ckpt # VAE model (1D, z_dim=4)
├── 20251106_063218_ldf/
│ └── step_step=50000.ckpt # LDF model checkpoint (HumanML3D)
├── 20251107_021814_ldf_stream/
│ └── step_step=240000.ckpt # LDF streaming model checkpoint (BABEL)
├── 20251217_023720_ldf_tiny/
│ └── step_step=60000.ckpt # LDF tiny model checkpoint
└── 20251219_01492_ldf_tiny_stream/
└── step_step=200000.ckpt # LDF tiny streaming model checkpointNote: If you downloaded the models using the script above, the paths are already correctly configured. Otherwise, update
test_ckptandtest_vae_ckptin your config files to point to your checkpoint locations.
Create configs/paths.yaml from the example:
cp configs/paths_default.yaml configs/paths.yaml
# Edit paths.yaml to point to your data directoriesvae_wan_1d.yaml - VAE training configurationldf.yaml - LDF training on HumanML3Dldf_babel.yaml - LDF training on BABELstream.yaml - Streaming generation configldf_generate.yaml - Generation-only config# Train VAE
python train_vae.py --config configs/vae_wan_1d.yaml --override train=True
# Test VAE
python train_vae.py --config configs/vae_wan_1d.yamlPrecompute VAE tokens for diffusion training:
python pretokenize_vae.py --config configs/vae_wan_1d.yaml# Train on HumanML3D
python train_ldf.py --config configs/ldf.yaml --override train=True
# Train on BABEL (streaming)
python train_ldf.py --config configs/ldf_babel.yaml --override train=True
# Test/Evaluate
python train_ldf.py --config configs/ldf.yamlpython generate_ldf.py --config configs/stream.yamlRender motion files to videos:
python visualize_motion.pyThis script:
For real-time interactive demo with streaming generation, see web_demo/README.md.
…External Dependencies:
/
├── deps/ # Model dependencies
├── outputs/ # Pretrained model checkpoints
└── raw_data/ # Motion datasetsIf you use this code in your research, please cite:
@article{cai2025flooddiffusion,
title={FloodDiffusion: Tailored Diffusion Forcing for Streaming Motion Generation},
author={Yiyi Cai, Yuhan Wu, Kunhang Li, You Zhou, Bo Zheng, Haiyang Liu},
journal={arXiv preprint arXiv:2512.03520},
year={2025}
}This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright (c) 2025 Shanda AI Research Tokyo
Note: This project includes code from third-party sources with separate licenses. See THIRD_PARTY_LICENSES.md for details.
The preprocessed datasets we provide contain extracted motion features (263-dim) and text annotations derived from HumanML3D and BABEL, which are built upon AMASS and HumanAct12. We do not distribute raw AMASS data (SMPL parameters/meshes). This follows standard practice in the motion generation research community. If you require raw motion data or plan to use it for commercial purposes, please register and agree to the licenses on the AMASS website.
暂无开放 Issues,或尚未同步最近议题。