百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

FloodDiffusion

> 编程语言
开源

FloodDiffusion: 为流动运动生成而定制的扩散强制

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

FloodDiffusion: 为流动运动生成而定制的扩散强制

FloodDiffusion: Tailored Diffusion Forcing for Streaming Motion Generation

[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.

Features

  • Streaming Generation: Support for continuous motion generation with text condition changes
  • Latent Diffusion Forcing: Efficient generation using compressed latent space with diffusion
  • ⚡ Real-time Capable: Optimized for streaming inference with ~50 FPS model output

Installation

Environment Setup

bash
# 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-isolation

Quick Inference (No Data Required)

If you only need to generate motions and don't plan to train or evaluate models, you can use our standalone model on Hugging Face:

ShandaAI/FloodDiffusion

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:

python
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.

Data Preparation

Prepare Data from Original Sources

To reproduce our results from scratch, follow the original data preparation pipelines:

HumanML3D:

  • Follow the instructions in the HumanML3D repository
  • Extract 263D motion features using their processing pipeline
  • Place the processed data in raw_data/HumanML3D/

BABEL:

  • Download from the BABEL website
  • Process the motion sequences to extract 263D features
  • For streaming generation, segment and process according to the frame-level annotations
  • Place the processed data in raw_data/BABEL_streamed/

Dependencies:

  • Download T5 encoder weights from Hugging Face
  • Download T2M evaluation models from the text-to-motion repository
  • Download GloVe embeddings

Quick Start: Download Preprocessed Data (Recommended)

We provide all necessary data (datasets, dependencies, and pretrained models) on Hugging Face: ShandaAI/FloodDiffusionDownloads

For inference only (downloads deps/ and outputs/):

bash
pip install huggingface_hub
python download_assets.py

For training/evaluation (also downloads datasets in raw_data/):

bash
pip install huggingface_hub
python download_assets.py --with-dataset

This will automatically download and extract files into the correct directories.

Directory Structure

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 encoder

Dataset 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 checkpoint

Note: If you downloaded the models using the script above, the paths are already correctly configured. Otherwise, update test_ckpt and test_vae_ckpt in your config files to point to your checkpoint locations.

Configuration

Create configs/paths.yaml from the example:

bash
cp configs/paths_default.yaml configs/paths.yaml
# Edit paths.yaml to point to your data directories

Available Configs

  • vae_wan_1d.yaml - VAE training configuration
  • ldf.yaml - LDF training on HumanML3D
  • ldf_babel.yaml - LDF training on BABEL
  • stream.yaml - Streaming generation config
  • ldf_generate.yaml - Generation-only config

Training

1. Train VAE (Motion Encoder)

bash
# 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.yaml

2. Pretokenize Dataset

Precompute VAE tokens for diffusion training:

bash
python pretokenize_vae.py --config configs/vae_wan_1d.yaml

3. Train Latent Diffusion Forcing (Flood Diffusion)

bash
# 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.yaml

Generation

Interactive Generation

bash
python generate_ldf.py --config configs/stream.yaml

Visualization

Render motion files to videos:

bash
python visualize_motion.py

This script:

  • Reads 263D motion features from disk
  • Renders to MP4 videos with skeleton visualization
  • Supports batch processing of directories

Web Real-time Demo

For real-time interactive demo with streaming generation, see web_demo/README.md.

Model Architecture

VAE (Variational Autoencoder)

  • Input: T × 263 motion features
  • Latent: (T/4) × 4 tokens
  • Architecture: Causal encoder and decoder based on WAN2.2

LDF (Latent Diffusion Forcing)

  • Backbone: DiT based on WAN2.2
  • Text Encoder: T5
  • Diffusion Schedule: Triangular noise schedule
  • Streaming: Autoregressive latent generation

Project Structure

…

External Dependencies:

/
├── deps/                           # Model dependencies
├── outputs/                        # Pretrained model checkpoints
└── raw_data/                       # Motion datasets

Update History

  • 2025/12/8: Added EMA smoothing option for joint positions during rendering
  • 2025/12/24: Added tiny models that can be trained on 5090 GPU

Citation

If you use this code in your research, please cite:

bibtex
@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}
}

License

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.

Acknowledgments

  • HumanML3D - Dataset
  • text-to-motion - Evaluation metrics
  • BABEL - Dataset for streaming motion generation
  • AMASS - Source motion capture data
  • PyTorch Lightning - Training framework
  • VideoPose3D - Quaternion operations code
  • Hugging Face Transformers - T5 model implementation
  • Alibaba Wan Team - WAN model architecture and components

Data License Notice

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· 6 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythontext-to-motion

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言