Quickstart
Get up and running with the multimedia generation umbrella in minutes.
Install
Section titled “Install”uv add lexigram-multimedialexigram-multimedia pulls in lexigram, lexigram-contracts, and all seven sibling
extension packages (lexigram-multimedia-tts, -music, -video, -image, -upscale,
-interpolate, -beat) plus lexigram-tasks and lexigram-storage.
Backend features are opt-in per subsystem — install the extra for the backend you need:
uv add "lexigram-multimedia-tts[elevenlabs,openai]"uv add "lexigram-multimedia-music[ace-step-server]"uv add "lexigram-multimedia-video[wan22-server,cogvideox-server]"With zero extras, the umbrella uses the default in-process/local-http backends.
Basic Usage
Section titled “Basic Usage”import asyncio
from lexigram import Applicationfrom lexigram.contracts.multimedia import TTSProvider, TTSRequestfrom lexigram.multimedia import MultimediaConfig, MultimediaModule
async def main() -> None: config = MultimediaConfig(cache_results=False) app = Application(name="my-media-app") app.add_module(MultimediaModule.configure(config=config))
await app.start()
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 a URI if asset.has_uri: print(f"Generated audio: {asset.uri}")
await app.stop()
asyncio.run(main())Note:
MultimediaModule.configure()with no arguments is zero-config — it constructs a defaultMultimediaConfig()internally. Use no-arg for the fastest path.
What Just Happened
Section titled “What Just Happened”MultimediaModule.configure()returns aDynamicModuleowning oneMultimediaProviderand exporting all seven subsystem protocols (TTSProvider,MusicProvider,VideoProvider,ImageProvider,UpscaleProvider,InterpolationProvider,BeatAnalysisProvider).- On
app.start(),MultimediaProvider.register()binds each sub-provider (AudioTTSProvider,AudioMusicProvider,VideoGenerationProvider,ImageGenerationProvider,UpscaleGenerationProvider,InterpolationGenerationProvider,BeatAnalysisGenerationProvider) and delegates to theirregister()— that is what putsTTSProviderinto the container. - On
boot(), the provider cleanly resolves optionalBlobStoreProtocol,CacheBackendProtocol, andEventBusProtocolso nothing breaks when those subsystems are absent, then wires the task queue. container.resolve(TTSProvider)returns the concrete TTS backend. Callinggenerate()returnsResult[MediaAsset, MultimediaError]— never raises for expected failures.
Next Steps
Section titled “Next Steps”- Guide — the accessor model, sync vs queued jobs, timeline composition
- How-Tos — TTS, music, video, upscale, interpolate, beat, compose recipes
- Configuration — the
multimedia:config tree and env vars - Architecture — provider wiring and extension points