Open-Source AI Video Generation Pipeline
Modular AI video pipeline β script generation β scene planning β rendering β post-production
Features β’ Quick Start β’ Architecture β’ Contributing β’ Security
π§ Overview
LeronX Engine is the open-source core of LeronX Pro β an AI-powered video creation platform. This repository contains the video generation pipeline: a modular, extensible system that transforms text prompts into fully rendered videos.
β οΈ Note: This is the engine core, not the full SaaS. Cloud rendering, authentication, billing, and the desktop app are proprietary. See What's Included.
β¨ Features
- Script Generation β AI-driven scriptwriting with tone, pacing, and format control
- Scene Planning β Automatic scene breakdown with shot composition
- Asset Management β Intelligent stock footage matching and generation
- Voice Synthesis β Multi-language TTS with emotion control (11 audio languages)
- Video Rendering β FFmpeg-based pipeline with transitions, effects, overlays
- Subtitle Engine β Auto-aligned, styled subtitles (SRT/ASS/VTT)
- Plugin System β Extend any stage of the pipeline
- GPU Acceleration β CUDA + Metal support for rendering
π¦ What's Included
| Module | Status | Description |
|---|---|---|
leronx.script |
β Open Source | Script generation + storyboard planning |
leronx.scenes |
β Open Source | Scene graph, transitions, composition |
leronx.voice |
β Open Source | TTS abstraction layer (plugin-based) |
leronx.render |
β Open Source | FFmpeg pipeline, hardware accel config |
leronx.subtitles |
β Open Source | Generation, styling, timing |
leronx.assets |
β Open Source | Stock footage API client (Pexels/Pixabay) |
leronx.plugins |
β Open Source | Plugin loader + registry |
leronx.cloud |
π Proprietary | Distributed rendering cluster |
leronx.auth |
π Proprietary | Firebase auth + phone verification |
leronx.billing |
π Proprietary | Stripe + credits system |
leronx.desktop |
π Proprietary | Electron/Tauri desktop app |
π Quick Start
Prerequisites
python >= 3.10
ffmpeg >= 5.0
Installation
git clone https://github.com/leronx/leronx-engine.git
cd leronx-engine
pip install -e ".[dev]"
Basic Usage
from leronx import Pipeline
from leronx.script import ScriptConfig
# Configure the pipeline
config = ScriptConfig(
topic="The Future of AI in Healthcare",
duration=60, # seconds
tone="professional",
language="en",
)
# Create and run pipeline
pipeline = Pipeline(config)
video = pipeline.render(output_path="./output/my_video.mp4")
print(f"β
Video rendered: {video.path}")
print(f"β± Duration: {video.duration}s")
print(f"π Scenes: {len(video.scenes)}")
Advanced: Custom Pipeline
from leronx import Pipeline, Plugin
from leronx.scenes import SceneGraph
from leronx.render import RenderConfig
class BrandedOverlay(Plugin):
"""Add LeronX watermark to all videos."""
name = "branded_overlay"
stage = "post_render"
def process(self, video, config):
video.add_overlay(
image="assets/leronx_logo.png",
position="bottom-right",
opacity=0.8,
)
return video
# Custom pipeline with plugins
pipeline = Pipeline(
config=RenderConfig(gpu=True, codec="h265"),
plugins=[BrandedOverlay()],
)
result = pipeline.render(prompt="Explain quantum computing simply")
π Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Pipeline Orchestrator β
β β
β ββββββββ ββββββββββ βββββββββ ββββββββββ β
β βScriptββββΆβScenes ββββΆβVoice ββββΆβRender β β
β βGen β βPlanner β βSynth β βEngine β β
β ββββββββ ββββββββββ βββββββββ ββββββββββ β
β β β β β β
β βΌ βΌ βΌ βΌ β
β ββββββββ ββββββββββ βββββββββ ββββββββββ β
β βTopicsβ βAssets β βSubtitleβ βPost-FX β β
β β& Tonesβ βMatch β βEngine β β& Exportβ β
β ββββββββ ββββββββββ βββββββββ ββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββ ββββββββββββ
β Plugins β β Output β
β Registryβ β Formats β
βββββββββββ ββββββββββββ
Project Structure
leronx-engine/
βββ src/leronx/
β βββ __init__.py # Pipeline orchestrator
β βββ pipeline.py # Core pipeline class
β βββ script/
β β βββ generator.py # Script generation
β β βββ config.py # Script configuration
β β βββ storyboard.py # Visual storyboard planning
β βββ scenes/
β β βββ graph.py # Scene graph + transitions
β β βββ composition.py # Shot composition rules
β βββ voice/
β β βββ tts_base.py # TTS abstraction
β β βββ tts_engines.py # Provider implementations
β β βββ emotions.py # Emotion/prosody control
β βββ render/
β professionalβ βββ engine.py # FFmpeg pipeline
οΏ½οΏ½ β βββ config.py # Hardware accel config
β β βββ effects.py # Transitions, overlays
β βββ subtitles/
β β βββ generator.py # SRT/ASS/VTT generation
β β βββ styler.py # Font, color, positioning
β βββ assets/
β β βββ matcher.py # Stock footage matcher
β β βββ providers.py # Pexels/Pixabay clients
β βββ plugins/
β βββ base.py # Plugin interface
β βββ registry.py # Plugin registry
βββ tests/ # 47 tests (pytest)
βββ examples/ # Usage examples
βββ docs/ # Documentation
βββ docker/ # Docker setup
βββ pyproject.toml # Project metadata
βββ README.md
βββ LICENSE
βββ CONTRIBUTING.md
π§ͺ Tests
pytest tests/ -v --cov=leronx
========================= test session starts =========================
platform linux -- Python 3.11.5, pytest-7.4.0
collected 47 items
tests/test_script.py ......... [ 19%]
tests/test_pipeline.py ........ [ 36%]
tests/test_scenes.py .......... [ 57%]
tests/test_voice.py ....... [ 72%]
tests/test_render.py ........... [ 96%]
tests/test_plugins.py .. [100%]
---------- coverage: leronx ----------
Name Stmts Miss Cover
--------------------------------------------------
leronx/__init__.py 12 0 100%
leronx/pipeline.py 45 2 96%
leronx/script/generator.py 38 0 100%
...
TOTAL 312 8 97%
========================= 47 passed in 2.13s ==========================
π Plugin Development
from leronx.plugins import Plugin, PluginMeta
class MyPlugin(Plugin, metaclass=PluginMeta):
name = "my_plugin"
stage = "pre_render" # script | scenes | voice | render | post
priority = 10 # lower runs first
def process(self, context):
# Modify the pipeline context
context.video.add_filter("vintage")
return context
def cleanup(self):
pass
π³ Docker
docker-compose up -d
# API available at http://localhost:8000
π Benchmarks
| GPU | 60s Video | 120s Video | 300s Video |
|---|---|---|---|
| RTX 4090 | 45s | 90s | 4min |
| RTX 3080 | 72s | 145s | 6min |
| M2 Max | 58s | 115s | 5min |
| CPU only | 8min | 16min | 40min |
π Security
We take security seriously. See SECURITY.md for responsible disclosure.
π€ Contributing
PRs welcome! See CONTRIBUTING.md.
π License
MIT β see LICENSE.
π Links
- π leronx.org
- π¦ PyPI: leronx-engine
- π Issue Tracker
- π¬ Discord
Built with β€οΈ by the LeronX team
Comments