Professional Motion Graphics Engine for AI Video Workflows
Features | Installation | Quick Start | Documentation | Contributing
Lattice bridges the gap between professional motion graphics and AI video generation.
The AI video generation community has powerful models (Wan 2.1, AnimateDiff, MotionCtrl, VACE) but creating the conditioning data these models need — depth maps, motion trajectories, attention masks — requires jumping between multiple tools. Lattice solves this by bringing industry-standard animation tools directly into ComfyUI.
Deterministic by Design — Every frame is reproducible. Scrub to frame 50, scrub back to frame 10, scrub to frame 50 again — identical output, guaranteed. This is critical for AI video workflows.
AI-Native Export — One-click export to formats AI models actually consume: matte sequences for IP Adapter, camera trajectories for MotionCtrl, point paths for Wan Move.
Professional Tools, Zero Cost — Keyframe animation, bezier curves, particle systems, expressions, 3D cameras — the full professional toolkit, open source.
Lattice is a professional-grade motion graphics compositor built for the ComfyUI ecosystem. It brings industry-standard animation tools to AI video workflows, enabling you to create stunning motion graphics, animated text, particle systems, and 3D camera animations — then export directly to AI video models like Wan 2.1, AnimateDiff, and MotionCtrl.
| Traditional Workflow | With Lattice |
|---|---|
| Export video, re-import to AI model | Direct ComfyUI integration |
| Manual keyframe animation | AI agent creates animations from prompts |
| Static depth maps | Real-time depth-based parallax |
| Separate mask creation tools | AI segmentation (SAM) built-in |
| Complex export workflows | One-click matte/trajectory export |
Perfect for: AI video creators, motion designers, VFX artists, and content creators using Stable Diffusion video workflows.
| Main Interface | Timeline & Keyframes |
|---|---|
| Full compositor workspace | Multi-track animation timeline |
| Particle System | AI Agent |
|---|---|
| 24 built-in presets | Natural language animation |
| Metric | Value |
|---|---|
| Lines of Code | 290,000+ |
| Tests Passing | 4,275+ |
| TypeScript Errors | 0 |
| Build Warnings | 0 |
| Layer Types | 17 |
| Effects | 22 categories |
| Easing Functions | 35 |
| Camera Presets | 22 |
| Particle Presets | 24 |
See PROJECT_STATUS.md for detailed status and PRD.md for product requirements.
| Layer | Description |
|---|---|
| Image | Static images (PNG, JPG, WebP, GIF) |
| Video | Video files with frame-accurate playback |
| Solid | Solid color rectangles |
| Text | Animated text with 1000+ Google Fonts |
| Spline | Bezier curves with stroke/fill |
| Shape | Vector shapes with boolean operations |
| Particle | Deterministic particle emitters |
| Camera | 3D cameras with depth-of-field |
| Light | Point, spot, directional lights |
| Null/Control | Invisible parent for grouping |
| Precomp | Nested compositions |
| Adjustment/Effect | Effect-only layers |
| Procedural Matte | Generated masks |
| Depth | Depth map visualization |
| Normal | Normal map visualization |
| Generated | AI-generated content layers |
| Group | Layer grouping with blend modes |
wiggle(), repeatAfter(), bounce(), inertia(), elastic()| Category | Effects |
|---|---|
| Blur | Gaussian, Directional, Radial, Box, Sharpen |
| Color | Brightness/Contrast, Hue/Saturation, Levels, Curves, Glow, Drop Shadow, Color Balance, Exposure, Vibrance, Invert, Posterize, Threshold |
| Distort | Transform, Warp, Displacement Map |
| Generate | Fill, Gradient Ramp, Fractal Noise |
| Format | Use Case |
|---|---|
| Matte Sequences | IP Adapter attention masks |
| Wan Trajectories | Point-based motion control |
| MotionCtrl Poses | Camera animation data |
| CameraCtrl JSON | AnimateDiff camera control |
| Time-to-Move | Cut-and-drag motion |
| VACE Control | Video AI Composer Engine |
| PNG/WebM/MP4 | Standard video export |
# Navigate to your ComfyUI custom_nodes folder
cd ComfyUI/custom_nodes
# Clone the repository
git clone https://github.com/justinfleek/ComfyUI-Lattice-Compositor.git
# Install Python dependencies
pip install -r ComfyUI-Lattice-Compositor/requirements.txt
Restart ComfyUI. The Lattice icon will appear in your sidebar. No build step required — pre-built JavaScript files are included.
If you're using ComfyUI's portable distribution with embedded Python:
# Navigate to custom_nodes
cd "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes"
# Clone
git clone https://github.com/justinfleek/ComfyUI-Lattice-Compositor.git
# Install with embedded Python
& "C:\ComfyUI_windows_portable\python_embeded\python.exe" -m pip install -r ComfyUI-Lattice-Compositor/requirements.txt
The requirements.txt includes minimal dependencies since most are already in ComfyUI:
numpy
Pillow
scipy # For depth-to-normal conversion
For contributors or those wanting to modify the source:
# Navigate to the UI source
cd lattice-compositor/ui
# Install Node.js dependencies
npm install
# Start development server (hot reload)
npm run dev
# Opens at http://localhost:5173
# Run test suite
npm test
# Build for production (outputs to web/js/)
npm run build
Requires: Set OPENAI_API_KEY or ANTHROPIC_API_KEY environment variable before starting ComfyUI.
AI video models require frame counts following frames = (seconds × 16) + 1:
| Duration | Frames |
|---|---|
| 1 second | 17 |
| 2 seconds | 33 |
| 3 seconds | 49 |
| 5 seconds | 81 (default) |
| 10 seconds | 161 |
┌─────────────────────────────────────────────────────────────────┐
│ PRESENTATION LAYER (Vue 3.5 + TypeScript) │
│ ├── 146 Vue Components │
│ ├── PrimeVue UI Library │
│ ├── 6 Theme Gradients (Violet, Ocean, Sunset, Forest, Ember) │
│ └── Design Tokens System │
├─────────────────────────────────────────────────────────────────┤
│ STATE LAYER (Pinia 2.2) │
│ ├── compositorStore - Main project state │
│ ├── playbackStore - Timeline playback │
│ ├── historyStore - Undo/redo (50 snapshots) │
│ ├── audioStore - Audio analysis & reactivity │
│ └── assetStore - Asset management │
├─────────────────────────────────────────────────────────────────┤
│ ENGINE LAYER (Three.js r170) │
│ ├── LatticeEngine - Main rendering facade │
│ ├── MotionEngine - Deterministic frame evaluation │
│ ├── LayerManager - 17 layer implementations │
│ ├── ParticleSystem - Checkpoint-based simulation │
│ └── EffectProcessor - Canvas-based effect pipeline │
├─────────────────────────────────────────────────────────────────┤
│ SERVICE LAYER (80+ Services) │
│ ├── Animation: interpolation, easing, expressions │
│ ├── Audio: FFT analysis, beat detection, mapping │
│ ├── Particles: CPU simulation, GPU rendering │
│ ├── 3D: camera trajectories, depth parallax │
│ ├── Effects: blur, color, distort, generate │
│ └── Export: mattes, trajectories, video │
├─────────────────────────────────────────────────────────────────┤
│ BACKEND (Python + ComfyUI) │
│ ├── AI Inference: DepthAnything, SAM, NormalCrafter │
│ ├── Export: Frame sequences, trajectories │
│ └── API Routes: /lattice/* endpoints │
└─────────────────────────────────────────────────────────────────┘
For AI video generation, every frame must be reproducible. Lattice guarantees:
evaluate(frame, project)always returns identical results for identical inputs.
Math.random(), no Date.now(), no accumulation| Key | Action |
|---|---|
| Space | Play/Pause |
| Home/End | Go to start/end |
| ←/→ | Previous/Next frame |
| Shift+←/→ | Jump 10 frames |
| Ctrl+Z | Undo |
| Ctrl+Shift+Z | Redo |
| Delete | Delete selected |
| V | Selection tool |
| P | Pen tool |
| T | Text tool |
| H | Hand (pan) tool |
| Z | Zoom tool |
| ` (backtick) | HD Preview window |
| Ctrl+S | Save project |
| Ctrl+E | Export |
| Ctrl+D | Duplicate layer |
| Ctrl+Shift+D | Split layer at playhead |
| Document | Description |
|---|---|
| PRD.md | Product requirements |
| PROJECT_STATUS.md | Current status and roadmap |
| INSTALL.md | Detailed installation guide |
| SECURITY_ASSESSMENT.md | Security analysis |
| docs/ARCHITECTURE.md | System architecture |
| docs/SERVICE_API_REFERENCE.md | Service API reference |
| docs/EFFECT_PARAMETERS.md | Effect parameters reference |
See docs/ folder for technical documents and _archived/ for historical documentation.
| Feature | Requirement |
|---|---|
| AI Agent | OPENAI_API_KEY or ANTHROPIC_API_KEY env var |
| Depth Estimation | Python backend with DepthAnything model |
| Pose Estimation | Python backend with Sapiens model |
| Stem Separation | Python backend with Demucs model |
See FEATURE_AUDIT.md for complete feature-to-UI mapping.
Lattice uses clear, descriptive terminology:
| Concept | Lattice Term |
|---|---|
| Property linking | PropertyLink |
| Animation curves | CurveEditor |
| Transform origin | Origin |
| Sub-composition | NestedComp |
| View single layer | Isolate |
| Loop animation | repeatAfter |
Lattice incorporates techniques and inspiration from these outstanding projects:
Contributions are welcome! Please read CLAUDE.md for architecture details and coding conventions.
# Clone
git clone https://github.com/justinfleek/ComfyUI-Lattice-Compositor.git
cd ComfyUI-Lattice-Compositor/ui
# Install dependencies
npm install
# Development server
npm run dev
# Run tests
npm test
# Build
npm run build
MIT License — see LICENSE for details.
Built for the open-source ComfyUI community
Professional motion graphics accessible to everyone
C
65.2%
TypeScript
6.4%
Rust
6.2%
Haskell
4.9%
PureScript
4.0%
JavaScript
3.2%
Nix
2.4%
Python
1.7%
Lean
1.6%
Vue
1.5%
C++
1.1%
Professional Motion Graphics Engine for AI Video Workflows
Features | Installation | Quick Start | Documentation | Contributing
Lattice bridges the gap between professional motion graphics and AI video generation.
The AI video generation community has powerful models (Wan 2.1, AnimateDiff, MotionCtrl, VACE) but creating the conditioning data these models need — depth maps, motion trajectories, attention masks — requires jumping between multiple tools. Lattice solves this by bringing industry-standard animation tools directly into ComfyUI.
Deterministic by Design — Every frame is reproducible. Scrub to frame 50, scrub back to frame 10, scrub to frame 50 again — identical output, guaranteed. This is critical for AI video workflows.
AI-Native Export — One-click export to formats AI models actually consume: matte sequences for IP Adapter, camera trajectories for MotionCtrl, point paths for Wan Move.
Professional Tools, Zero Cost — Keyframe animation, bezier curves, particle systems, expressions, 3D cameras — the full professional toolkit, open source.
Lattice is a professional-grade motion graphics compositor built for the ComfyUI ecosystem. It brings industry-standard animation tools to AI video workflows, enabling you to create stunning motion graphics, animated text, particle systems, and 3D camera animations — then export directly to AI video models like Wan 2.1, AnimateDiff, and MotionCtrl.
| Traditional Workflow | With Lattice |
|---|---|
| Export video, re-import to AI model | Direct ComfyUI integration |
| Manual keyframe animation | AI agent creates animations from prompts |
| Static depth maps | Real-time depth-based parallax |
| Separate mask creation tools | AI segmentation (SAM) built-in |
| Complex export workflows | One-click matte/trajectory export |
Perfect for: AI video creators, motion designers, VFX artists, and content creators using Stable Diffusion video workflows.
| Main Interface | Timeline & Keyframes |
|---|---|
| Full compositor workspace | Multi-track animation timeline |
| Particle System | AI Agent |
|---|---|
| 24 built-in presets | Natural language animation |
| Metric | Value |
|---|---|
| Lines of Code | 290,000+ |
| Tests Passing | 4,275+ |
| TypeScript Errors | 0 |
| Build Warnings | 0 |
| Layer Types | 17 |
| Effects | 22 categories |
| Easing Functions | 35 |
| Camera Presets | 22 |
| Particle Presets | 24 |
See PROJECT_STATUS.md for detailed status and PRD.md for product requirements.
| Layer | Description |
|---|---|
| Image | Static images (PNG, JPG, WebP, GIF) |
| Video | Video files with frame-accurate playback |
| Solid | Solid color rectangles |
| Text | Animated text with 1000+ Google Fonts |
| Spline | Bezier curves with stroke/fill |
| Shape | Vector shapes with boolean operations |
| Particle | Deterministic particle emitters |
| Camera | 3D cameras with depth-of-field |
| Light | Point, spot, directional lights |
| Null/Control | Invisible parent for grouping |
| Precomp | Nested compositions |
| Adjustment/Effect | Effect-only layers |
| Procedural Matte | Generated masks |
| Depth | Depth map visualization |
| Normal | Normal map visualization |
| Generated | AI-generated content layers |
| Group | Layer grouping with blend modes |
wiggle(), repeatAfter(), bounce(), inertia(), elastic()| Category | Effects |
|---|---|
| Blur | Gaussian, Directional, Radial, Box, Sharpen |
| Color | Brightness/Contrast, Hue/Saturation, Levels, Curves, Glow, Drop Shadow, Color Balance, Exposure, Vibrance, Invert, Posterize, Threshold |
| Distort | Transform, Warp, Displacement Map |
| Generate | Fill, Gradient Ramp, Fractal Noise |
| Format | Use Case |
|---|---|
| Matte Sequences | IP Adapter attention masks |
| Wan Trajectories | Point-based motion control |
| MotionCtrl Poses | Camera animation data |
| CameraCtrl JSON | AnimateDiff camera control |
| Time-to-Move | Cut-and-drag motion |
| VACE Control | Video AI Composer Engine |
| PNG/WebM/MP4 | Standard video export |
# Navigate to your ComfyUI custom_nodes folder
cd ComfyUI/custom_nodes
# Clone the repository
git clone https://github.com/justinfleek/ComfyUI-Lattice-Compositor.git
# Install Python dependencies
pip install -r ComfyUI-Lattice-Compositor/requirements.txt
Restart ComfyUI. The Lattice icon will appear in your sidebar. No build step required — pre-built JavaScript files are included.
If you're using ComfyUI's portable distribution with embedded Python:
# Navigate to custom_nodes
cd "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes"
# Clone
git clone https://github.com/justinfleek/ComfyUI-Lattice-Compositor.git
# Install with embedded Python
& "C:\ComfyUI_windows_portable\python_embeded\python.exe" -m pip install -r ComfyUI-Lattice-Compositor/requirements.txt
The requirements.txt includes minimal dependencies since most are already in ComfyUI:
numpy
Pillow
scipy # For depth-to-normal conversion
For contributors or those wanting to modify the source:
# Navigate to the UI source
cd lattice-compositor/ui
# Install Node.js dependencies
npm install
# Start development server (hot reload)
npm run dev
# Opens at http://localhost:5173
# Run test suite
npm test
# Build for production (outputs to web/js/)
npm run build
Requires: Set OPENAI_API_KEY or ANTHROPIC_API_KEY environment variable before starting ComfyUI.
AI video models require frame counts following frames = (seconds × 16) + 1:
| Duration | Frames |
|---|---|
| 1 second | 17 |
| 2 seconds | 33 |
| 3 seconds | 49 |
| 5 seconds | 81 (default) |
| 10 seconds | 161 |
┌─────────────────────────────────────────────────────────────────┐
│ PRESENTATION LAYER (Vue 3.5 + TypeScript) │
│ ├── 146 Vue Components │
│ ├── PrimeVue UI Library │
│ ├── 6 Theme Gradients (Violet, Ocean, Sunset, Forest, Ember) │
│ └── Design Tokens System │
├─────────────────────────────────────────────────────────────────┤
│ STATE LAYER (Pinia 2.2) │
│ ├── compositorStore - Main project state │
│ ├── playbackStore - Timeline playback │
│ ├── historyStore - Undo/redo (50 snapshots) │
│ ├── audioStore - Audio analysis & reactivity │
│ └── assetStore - Asset management │
├─────────────────────────────────────────────────────────────────┤
│ ENGINE LAYER (Three.js r170) │
│ ├── LatticeEngine - Main rendering facade │
│ ├── MotionEngine - Deterministic frame evaluation │
│ ├── LayerManager - 17 layer implementations │
│ ├── ParticleSystem - Checkpoint-based simulation │
│ └── EffectProcessor - Canvas-based effect pipeline │
├─────────────────────────────────────────────────────────────────┤
│ SERVICE LAYER (80+ Services) │
│ ├── Animation: interpolation, easing, expressions │
│ ├── Audio: FFT analysis, beat detection, mapping │
│ ├── Particles: CPU simulation, GPU rendering │
│ ├── 3D: camera trajectories, depth parallax │
│ ├── Effects: blur, color, distort, generate │
│ └── Export: mattes, trajectories, video │
├─────────────────────────────────────────────────────────────────┤
│ BACKEND (Python + ComfyUI) │
│ ├── AI Inference: DepthAnything, SAM, NormalCrafter │
│ ├── Export: Frame sequences, trajectories │
│ └── API Routes: /lattice/* endpoints │
└─────────────────────────────────────────────────────────────────┘
For AI video generation, every frame must be reproducible. Lattice guarantees:
evaluate(frame, project)always returns identical results for identical inputs.
Math.random(), no Date.now(), no accumulation| Key | Action |
|---|---|
| Space | Play/Pause |
| Home/End | Go to start/end |
| ←/→ | Previous/Next frame |
| Shift+←/→ | Jump 10 frames |
| Ctrl+Z | Undo |
| Ctrl+Shift+Z | Redo |
| Delete | Delete selected |
| V | Selection tool |
| P | Pen tool |
| T | Text tool |
| H | Hand (pan) tool |
| Z | Zoom tool |
| ` (backtick) | HD Preview window |
| Ctrl+S | Save project |
| Ctrl+E | Export |
| Ctrl+D | Duplicate layer |
| Ctrl+Shift+D | Split layer at playhead |
| Document | Description |
|---|---|
| PRD.md | Product requirements |
| PROJECT_STATUS.md | Current status and roadmap |
| INSTALL.md | Detailed installation guide |
| SECURITY_ASSESSMENT.md | Security analysis |
| docs/ARCHITECTURE.md | System architecture |
| docs/SERVICE_API_REFERENCE.md | Service API reference |
| docs/EFFECT_PARAMETERS.md | Effect parameters reference |
See docs/ folder for technical documents and _archived/ for historical documentation.
| Feature | Requirement |
|---|---|
| AI Agent | OPENAI_API_KEY or ANTHROPIC_API_KEY env var |
| Depth Estimation | Python backend with DepthAnything model |
| Pose Estimation | Python backend with Sapiens model |
| Stem Separation | Python backend with Demucs model |
See FEATURE_AUDIT.md for complete feature-to-UI mapping.
Lattice uses clear, descriptive terminology:
| Concept | Lattice Term |
|---|---|
| Property linking | PropertyLink |
| Animation curves | CurveEditor |
| Transform origin | Origin |
| Sub-composition | NestedComp |
| View single layer | Isolate |
| Loop animation | repeatAfter |
Lattice incorporates techniques and inspiration from these outstanding projects:
Contributions are welcome! Please read CLAUDE.md for architecture details and coding conventions.
# Clone
git clone https://github.com/justinfleek/ComfyUI-Lattice-Compositor.git
cd ComfyUI-Lattice-Compositor/ui
# Install dependencies
npm install
# Development server
npm run dev
# Run tests
npm test
# Build
npm run build
MIT License — see LICENSE for details.
Built for the open-source ComfyUI community
Professional motion graphics accessible to everyone
C
65.2%
TypeScript
6.4%
Rust
6.2%
Haskell
4.9%
PureScript
4.0%
JavaScript
3.2%
Nix
2.4%
Python
1.7%
Lean
1.6%
Vue
1.5%
C++
1.1%