multimedia-generation
Skill1 starsChanged 3 months agoMITView on GitHub
Use when generating audio, video, or images in a Lexigram application — TTS, music, video, image, upscale, interpolate, beat analysis, or timeline composition
In this repository17 other files it gives its agents.
- ai-subsystem-quickstartSkill
- auth-and-securitySkill
- caching-patternsSkill
- cli-code-generationSkill
- cli-config-and-inspectSkill
- cli-database-operationsSkill
- cli-project-scaffoldingSkill
- configuration-managementSkill
- creating-providers-and-modulesSkill
- database-repository-patternSkill
- events-and-messagingSkill
- lexigram-uiSkill
- real-time-webSkill
- resilience-patternsSkill
- testing-with-lexigramSkill
- using-result-and-error-codesSkill
- web-controllers-and-routingSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Always check asset.has_uri / asset.has_bytes — ElevenLabs/OpenAI return raw bytes.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Multimedia Generation
Overview
lexigram-multimedia wires seven subsystems into one DI graph: TTS, music, video, image, upscale, interpolate, and beat analysis. One module and one nested config tree; protocols for direct calls, accessors for storage, caching, events, and idempotent jobs.
Setup
uv add lexigram-multimedia
# backends are opt-in per subsystem
uv add "lexigram-multimedia-tts[elevenlabs,openai]"
uv add "lexigram-multimedia-video[svd-server]" # extras: runway, openai, cogvideox-server, svd-serverWith zero extras the umbrella uses the default local-http backends. Installing an extra only adds dependencies — you also set the subsystem's backend: config value to select it (wan22/cogvideox/comfyui are URL-configured GPU-side installs with no extra).
Module Registration
from lexigram.app.base import Application
from lexigram.multimedia import MultimediaConfig, MultimediaModule
app = Application(name="media-app")
app.add_module(MultimediaModule.configure(
config=MultimediaConfig(cache_results=True)
))
await app.start()MultimediaModule.configure() with no arguments is zero-config.
Resolve a Protocol
from lexigram.contracts.multimedia import TTSProvider, TTSRequest
tts = await app.container.resolve(TTSProvider)
result = await tts.generate(TTSRequest(text="Hello from Lexigram"))
if result.is_ok():
asset = result.unwrap() # MediaAsset — has_bytes OR has_uri
if asset.has_uri:
print(asset.uri)Always check asset.has_uri / asset.has_bytes — ElevenLabs/OpenAI return raw bytes; hosted backends return URIs.
Accessors
Accessors add storage normalization, result caching, generation events, and idempotent submission. They are properties on the MultimediaProvider, reachable via app.providers:
provider = next(p for p in app.providers if p.name == "multimedia")
result = await provider.image.generate(ImageRequest(prompt="mountain at dawn"))Queued Jobs
from lexigram.contracts.multimedia import TTSRequest
handle = await provider.tts.submit(
TTSRequest(text="Long narration for a video"),
idempotency_key="narration-v1",
)
print(handle.job_id, handle.status, handle.is_duplicate)submit() dispatches to lexigram-tasks, deduplicated by idempotency_key; the task handler normalizes the finished asset to URI-backed storage.
Timeline Composition
from lexigram.contracts.multimedia import SubtitleCue, TransitionSpec
from lexigram.multimedia import Timeline
timeline = Timeline()
timeline.add_clip(clip_a)
timeline.add_clip(clip_b, transition_in=TransitionSpec(kind="crossfade", duration=0.4))
timeline.add_captions([SubtitleCue(start=0.0, end=2.0, text="Intro")])
timeline.set_music(bgm, duck_under_narration=True)
result = await provider.compose.render(timeline) # runs inline (not queued)
handle = await provider.compose.submit_render(timeline) # queuedConfig
multimedia:
cache_results: true
storage_path_prefix: multimedia/
tts:
backend: local-http
music:
backend: local-httpEach subsystem has its own sub-config; the backend: value selects which implementation runs.
Subsystem Reference
| Accessor | Protocol | Request |
.tts | TTSProvider | TTSRequest |
.music | MusicProvider | MusicRequest |
.video | VideoProvider / VideoProcessor | VideoRequest, Trim, Concat |
.image | ImageProvider | ImageRequest |
.upscale | UpscaleProvider | UpscaleRequest |
.interpolate | InterpolationProvider | InterpolationRequest |
.beat | BeatAnalysisProvider | BeatAnalysisRequest |
Common Mistakes
- Checking neither
has_urinorhas_bytes— providers differ in asset shape - Expecting
submit()to work withoutlexigram-tasksandlexigram-storage - Importing sibling subsystem packages directly — resolve protocols from the container
- Calling
unwrap()on aResultwithout anis_ok()guard - Installing GPU/remote backends you don't need —
librosa(beat) runs in-process;local-httpbackends expect a locally started server on their default port
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

