lexigram-multimedia
Multimedia generation umbrella for Lexigram Framework — TTS, music, video, image, upscale, interpolation, and beat analysis in one DI module.
Overview
lexigram-multimedia is the orchestration layer for the Lexigram multimedia subsystem. It wires seven independent generation packages (lexigram-multimedia-tts, lexigram-multimedia-music, lexigram-multimedia-video, lexigram-multimedia-image, lexigram-multimedia-upscale, lexigram-multimedia-interpolate, lexigram-multimedia-beat) through the framework's DI container and entry-point discovery, and exposes a single MultimediaModule for application composition. Generated assets are normalized into blob storage (MediaAsset with bytes or URI), and long-running jobs are submitted to the task queue.
Full documentation: docs.lexigram.dev
Install
uv add lexigram-multimedia
# Subsystem extras (per backend, e.g. torch-based reference servers)
uv add "lexigram-multimedia-tts[elevenlabs,openai]"
uv add "lexigram-multimedia-music[ace-step-server]"
uv add "lexigram-multimedia-video[wan22-server,cogvideox-server]"
Quick Start
from lexigram import Application
from lexigram.di.module import Module, module
from lexigram.multimedia import MultimediaModule
from lexigram.contracts.multimedia import TTSProvider, TTSRequest
@module(imports=[MultimediaModule.configure()])
class AppModule(Module):
pass
async def main() -> None:
async with Application.boot(modules=[AppModule]) as app:
tts = await app.container.resolve(TTSProvider)
result = await tts.generate(TTSRequest(text="Hello from Lexigram"))
if result.is_ok():
asset = result.unwrap() # MediaAsset — bytes or URI in blob storage
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Configuration
Zero-config usage: Call
MultimediaModule.configure()with no arguments to use defaults. Default backends:local-httpfor TTS, music, video, and image;librosafor beat analysis;rifefor frame interpolation;real-esrganfor upscaling.
Option 1 — YAML file
# application.yaml
multimedia:
tts:
backend: "elevenlabs"
elevenlabs_voice_id: "21m00Tcm4TlvDq8ikWAM"
music:
backend: "stable-audio-open"
video:
backend: "local-http"
storage_path_prefix: "multimedia/"
cache_results: true
Option 2 — Profiles + Environment Variables
export LEX_PROFILE=production
export LEX_MULTIMEDIA__TTS__BACKEND=elevenlabs
export LEX_MULTIMEDIA__STORAGE_PATH_PREFIX=multimedia/
Option 3 — Python
from lexigram.multimedia import MultimediaModule, MultimediaConfig
from lexigram.multimedia.tts.config import TTSConfig
MultimediaModule.configure(
config=MultimediaConfig(
tts=TTSConfig(backend="elevenlabs", elevenlabs_voice_id="21m00Tcm4TlvDq8ikWAM"),
cache_results=True,
)
)
Config reference
| Field | Default | Env var | Description |
|---|---|---|---|
tts |
TTSConfig() |
LEX_MULTIMEDIA__TTS__* |
TTS subsystem config |
music |
MusicConfig() |
LEX_MULTIMEDIA__MUSIC__* |
Music generation config |
video |
VideoConfig() |
LEX_MULTIMEDIA__VIDEO__* |
Video generation + processing config |
image |
ImageConfig() |
LEX_MULTIMEDIA__IMAGE__* |
Image generation config |
upscale |
UpscaleConfig() |
LEX_MULTIMEDIA__UPSCALE__* |
Image/video upscale config |
interpolate |
InterpolationConfig() |
LEX_MULTIMEDIA__INTERPOLATE__* |
Frame interpolation config |
beat |
BeatAnalysisConfig() |
LEX_MULTIMEDIA__BEAT__* |
Beat analysis config |
storage_path_prefix |
"multimedia/" |
LEX_MULTIMEDIA__STORAGE_PATH_PREFIX |
Blob storage key prefix for generated assets |
cache_results |
False |
LEX_MULTIMEDIA__CACHE_RESULTS |
Cache generation results in the cache backend |
Module Factory Methods
| Method | Description |
|---|---|
MultimediaModule.configure(config) |
Configure with all seven subsystems wired |
MultimediaModule.stub() |
Stub module for testing — discovers installed subsystem stubs via lexigram.multimedia.modules entry points |
Key Features
- One module, seven subsystems — TTS, music, video, image, upscale, interpolation, and beat analysis wired through DI
- Entry-point discovery — subsystem providers register via
lexigram.multimedia.subsystems; no manual wiring SubsystemAccessor— single accessor to generate any media type (generate(request) -> Result[MediaAsset, MultimediaError])VideoAccessor/ComposeAccessor/BeatAccessor— video processing, timeline composition, and beat analysis with dedicated accessors- Async job submission —
submit()dispatches generation to the task queue with idempotency and generation events - Blob-backed assets — results normalized into
MediaAsset(bytes or URI) vialexigram-storage
Testing
from lexigram import Application
from lexigram.multimedia import MultimediaModule
async def test_boot():
async with Application.boot(modules=[MultimediaModule.stub()]) as app:
assert app.container is not None
Key Source Files
| File | What it contains |
|---|---|
src/lexigram/multimedia/__init__.py |
Public API: MultimediaModule, MultimediaProvider, MultimediaConfig, accessors, Timeline |
src/lexigram/multimedia/module.py |
MultimediaModule.configure() and MultimediaModule.stub() |
src/lexigram/multimedia/config.py |
MultimediaConfig — nested subsystem configs + storage/cache options |
src/lexigram/multimedia/di/provider.py |
MultimediaProvider — registers and boots the seven sub-providers |
src/lexigram/multimedia/accessors/ |
SubsystemAccessor, VideoAccessor, ComposeAccessor, BeatAccessor |
src/lexigram/multimedia/timeline/ |
Timeline, TimelineRenderTask — timeline composition |
src/lexigram/multimedia/types.py |
JobHandle and accessor types |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lexigram_multimedia-0.1.5004.tar.gz.
File metadata
- Download URL: lexigram_multimedia-0.1.5004.tar.gz
- Upload date:
- Size: 43.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbc4eff15d1eba368bc7a4df4939b9cb9a12953cb1d8c038c5e670e2b20c763d
|
|
| MD5 |
123201da5250df1470e5010182853571
|
|
| BLAKE2b-256 |
5b2eda35877504880eb35de2f4a19efc525379d7317f9e51437f514270bb8eee
|
File details
Details for the file lexigram_multimedia-0.1.5004-py3-none-any.whl.
File metadata
- Download URL: lexigram_multimedia-0.1.5004-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a70dbe6c6a9082210306c8450001951552d5dfe822fdec6bc145ea75e42ceee
|
|
| MD5 |
72e2c97cfd270c2cee33f87d6bb0ff2c
|
|
| BLAKE2b-256 |
b38361928db612dfebc7028dd7f5779c99c1dccdbcb4fd2c16f584bccc661b0c
|