This repository is a training framework for diffusion models (image and video generation) using DeepSpeed pipeline parallelism. It supports over 25 model architectures including SDXL, Flux, HunyuanVideo, Cosmos, Wan2.1, and many others. The framework is designed for efficient training on limited GPU memory through techniques like block swapping (offloading intermediate layers to CPU), activation checkpointing, and fp8/quantization. It provides a unified pipeline interface with custom optimizers (Automagic, AdamW8bitKahan, GenericOptim with multiple advanced modes) and a comprehensive caching system for precomputed latents and text embeddings. The architecture is centered around the `train.py` entry point, which expects a TOML configuration file and throws pipeline layers across GPUs. Each model is implemented as a subclass of `BasePipeline` or `ComfyPipeline`, defining `to_layers()` for sequential partitioning and `prepare_inputs()` for data preprocessing. The system integrates deeply with PEFT for LoRA/LoKr adapter training and supports multi-modal data (images, videos, audio) via a unified media preprocessor. A sophisticated caching layer using SQLite metadata and binary shards avoids duplicate computations across multi-GPU runs. While primarily an application training pipeline, the repository contains research-oriented components such as custom attention wrappers, advanced optimizers with subspace momentum and polar-express updates, and experimental projection methods (GaLore, SRHT, top-k norm). The code heavily patches external libraries (ComfyUI, DeepSpeed, PEFT) to enable training features these libraries do not natively support, which introduces maintenance risk but demonstrates deep engineering skill. The framework is actively maintained with frequent commits, a detailed model support matrix, and example configurations for each supported architecture.