Skip to content

atherion005-byte/Lux

Repository files navigation

Lux Video Generation Model

A Next-Generation AI Video Generation System

Lux is an advanced AI video generation model built from scratch, designed to compete with state-of-the-art systems like Seedance 2.0 and Sora 2. It features a Diffusion Transformer (DiT) architecture with multi-modal input support, native audio-video synchronization, and physics-aware generation.


Key Capabilities

  • Multi-Modal Input: Text, image, video, and audio conditioning
  • High Resolution: Up to 1080p output with multiple aspect ratios (16:9, 9:16, 4:3, 1:1, 21:9)
  • Extended Duration: Generate videos up to 20+ seconds
  • Native Audio: Synchronized audio-video joint generation with lip-sync
  • Physics-Aware: Enhanced motion realism through physics-informed training
  • Character Consistency: Stable identity preservation across frames and shots
  • Reference System: Replicate motion, style, camera movements from reference content
  • Multi-Shot Storytelling: Coherent narrative across multiple shots
  • Fast Generation: Optimized for consumer GPU hardware

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Lux Video Generation                      │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐    │
│  │  Text     │  │  Image   │  │  Video   │  │  Audio   │    │
│  │  Encoder  │  │  Encoder │  │  Encoder │  │  Encoder │    │
│  │  (T5/CLIP)│  │  (CLIP)  │  │  (3D-VAE)│  │  (Whisper)│   │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘    │
│       │              │              │              │          │
│       └──────────────┴──────┬───────┴──────────────┘          │
│                             │                                 │
│                   ┌─────────▼─────────┐                      │
│                   │  Multi-Modal      │                      │
│                   │  Fusion Module    │                      │
│                   └─────────┬─────────┘                      │
│                             │                                 │
│                   ┌─────────▼─────────┐                      │
│                   │  Diffusion        │                      │
│                   │  Transformer      │                      │
│                   │  (DiT Core)       │                      │
│                   └─────────┬─────────┘                      │
│                             │                                 │
│              ┌──────────────┼──────────────┐                 │
│              │              │              │                  │
│    ┌─────────▼────┐  ┌─────▼──────┐  ┌───▼────────┐        │
│    │  3D Causal   │  │  Audio     │  │  Physics   │         │
│    │  VAE Decoder │  │  Decoder   │  │  Refinement│         │
│    └──────────────┘  └────────────┘  └────────────┘         │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Hardware Requirements

Minimum (Training with optimizations):

  • 2x NVIDIA GPUs with 8GB+ VRAM each (e.g., RTX 3070 Ti + RTX 5060)
  • 32GB+ System RAM
  • 500GB+ SSD storage
  • CUDA 12.0+

Recommended (Full training):

  • 4x NVIDIA A100 80GB or equivalent
  • 256GB+ System RAM
  • 2TB+ NVMe SSD

Installation

# Clone and setup
cd Lux
pip install -e .

# Download pre-trained components from Hugging Face
python scripts/download_models.py

# Prepare training data
python scripts/prepare_data.py --data_dir datasets/

# Start training
python scripts/train.py --config configs/training_config.yaml

# Generate videos
python scripts/generate.py --prompt "A golden retriever running through a meadow"

# Launch web UI
python -m lux_video_gen.ui.gradio_app

Project Structure

Lux/
├── lux_video_gen/           # Main package
│   ├── configs/             # Configuration files
│   ├── core/                # Core building blocks (attention, embeddings, etc.)
│   ├── models/              # Model architectures (DiT, VAE, encoders)
│   ├── data/                # Data loading and processing
│   ├── training/            # Training loop, schedulers, losses
│   ├── inference/           # Inference pipeline, sampling
│   ├── ui/                  # Gradio web interface
│   └── utils/               # Utilities (memory, distributed, logging)
├── scripts/                 # Training and generation scripts
├── configs/                 # YAML configuration files
├── checkpoints/             # Model checkpoints
├── datasets/                # Training data
└── outputs/                 # Generated outputs

Training

Lux uses a multi-stage training approach:

  1. Stage 1 - VAE Pre-training: Train the 3D Causal VAE on video data
  2. Stage 2 - DiT Pre-training: Train the Diffusion Transformer on text-video pairs
  3. Stage 3 - Multi-Modal Fine-tuning: Add image, video, and audio conditioning
  4. Stage 4 - Quality Fine-tuning: Physics-aware refinement and quality enhancement
  5. Stage 5 - Audio Joint Training: Audio-video synchronization training

License

Apache 2.0

Acknowledgments

Built with components from the Hugging Face ecosystem including Transformers, Diffusers, and Accelerate.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors