Skip to content
GitHub

Configuration

Configuration options for lexigram-multimedia — the umbrella config plus per-subsystem trees.


Loaded from the multimedia: section of application.yaml. Environment variable prefix: LEX_MULTIMEDIA__.

MultimediaConfig (extends lexigram.config.BaseConfig) declares config_section = "multimedia", so framework config loading maps the YAML/evn-tree to this dataclass. The seven subsystem configs are nested dataclasses — each sibling package owns its own config model and its own defaults; the umbrella simply composes them.

multimedia:
storage_path_prefix: "multimedia/"
cache_results: false
tts:
backend: "local-http"
music:
backend: "local-http"
video:
backend: "local-http"
image:
backend: "local-http"
upscale:
backend: "real-esrgan"
interpolate:
backend: "rife"
beat:
backend: "librosa"

from lexigram.multimedia import MultimediaConfig, MultimediaModule
module = MultimediaModule.configure(
config=MultimediaConfig(
storage_path_prefix="media/",
cache_results=True,
)
)
app.add_module(module)

Calling MultimediaModule.configure() with no arguments builds the same default configs.


FieldTypeDefaultDescription
ttsTTSConfigTTSConfig()TTS subsystem config (lexigram-multimedia-tts)
musicMusicConfigMusicConfig()Music generation config (lexigram-multimedia-music)
videoVideoConfigVideoConfig()Video generation + processing config (lexigram-multimedia-video)
imageImageConfigImageConfig()Image generation config (lexigram-multimedia-image)
upscaleUpscaleConfigUpscaleConfig()Upscale config (lexigram-multimedia-upscale)
interpolateInterpolationConfigInterpolationConfig()Frame interpolation config (lexigram-multimedia-interpolate)
beatBeatAnalysisConfigBeatAnalysisConfig()Beat analysis config (lexigram-multimedia-beat)
storage_path_prefixstr"multimedia/"Blob-storage key prefix for generated assets
cache_resultsboolFalseCache accessor generate() results in the cache backend

Each nested config carries its backend selector; the full field list lives in each sibling package’s docs.

SubsystemFieldTypeDefaultDescription
ttsbackendstr"local-http"local-http, elevenlabs, openai, chatterbox, kokoro, f5-tts, piper
ttselevenlabs_voice_idstr | NonenullRequired for the elevenlabs backend
musicbackendstr"local-http"local-http, stability-audio, ace-step, stable-audio-open
videobackendstr"local-http"local-http, runway, openai, wan22, cogvideox, svd, comfyui
videoprocessing.max_concurrent_jobsint2FFmpeg processing concurrency limit
imagebackendstr"local-http"local-http, stability, openai, comfyui
upscalebackendstr"real-esrgan"real-esrgan or hat
interpolatebackendstr"rife"RIFE frame-interpolation backend
beatbackendstr"librosa"librosa (in-process) or madmom (reference server)
beatlibrosa_sample_rateint22050Sample rate for the librosa backend
beatmadmom_base_urlstr"http://localhost:5600"Madmom reference-server URL

The env var name is the config path in SCREAMING tokens joined by __ under LEX_MULTIMEDIA__. Nested subsystem fields prefix with the subsystem name.

VariableDescription
LEX_MULTIMEDIA__STORAGE_PATH_PREFIXBlob storage prefix for assets (multimedia/)
LEX_MULTIMEDIA__CACHE_RESULTSEnable result caching (true/false)
LEX_MULTIMEDIA__TTS__BACKENDTTS backend name
LEX_MULTIMEDIA__TTS__ELEVENLABS_VOICE_IDElevenLabs voice id
LEX_MULTIMEDIA__MUSIC__BACKENDMusic backend name
LEX_MULTIMEDIA__VIDEO__BACKENDVideo backend name
LEX_MULTIMEDIA__IMAGE__BACKENDImage backend name
LEX_MULTIMEDIA__UPSCALE__BACKENDUpscale backend name
LEX_MULTIMEDIA__INTERPOLATE__BACKENDInterpolation backend name
LEX_MULTIMEDIA__BEAT__BACKENDBeat backend name (librosa/madmom)
LEX_MULTIMEDIA__BEAT__MADMOM_BASE_URLMadmom server URL
Terminal window
LEX_MULTIMEDIA__TTS__BACKEND=elevenlabs \
LEX_MULTIMEDIA__TTS__ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM \
LEX_MULTIMEDIA__VIDEO__BACKEND=local-http \
LEX_MULTIMEDIA__CACHE_RESULTS=true \
python -m my_app

A subsystem installed standalone uses its own prefix instead — e.g. LEX_MULTIMEDIA_BEAT__BACKEND (see the beat package’s Configuration doc).


from lexigram.multimedia import MultimediaConfig, MultimediaModule
from lexigram.multimedia.tts.config import TTSConfig
from lexigram.multimedia.beat.config import BeatAnalysisConfig
app.add_module(
MultimediaModule.configure(
config=MultimediaConfig(
tts=TTSConfig(backend="elevenlabs", elevenlabs_voice_id="21m00Tcm4TlvDq8ikWAM"),
beat=BeatAnalysisConfig(backend="madmom", madmom_base_url="http://10.0.0.5:5600"),
storage_path_prefix="prod/media/",
)
)
)

Every subsystem can also be wired on its own with its own module — the umbrella is never required:

from lexigram.multimedia.beat.module import BeatAnalysisModule
from lexigram.multimedia.beat.config import BeatAnalysisConfig
app.add_module(BeatAnalysisModule.configure(config=BeatAnalysisConfig(backend="librosa")))
# Stubs all installed subsystems; no servers, no network
app.add_module(MultimediaModule.stub())

stub() imports each core subsystem’s .stub() module (AudioTTSModule.stub(...), AudioMusicModule.stub(...), …) and also loads any non-core modules discovered via the lexigram.multimedia.modules entry-point group.


  • Keep the umbrella config minimal; override only what your deployment differs on.
  • Prefer environment variables for secrets and per-environment switches (LEX_MULTIMEDIA__TTS__BACKEND=elevenlabs), YAML for structure.
  • Never hardcode API keys in application.yaml — subsystem configs accept *_api_key_secret_name fields that reference secrets-manager entries.
  • Enable cache_results only when a cache backend is present; otherwise the flag is inert.
  • Give every environment its own storage_path_prefix to avoid cross-env asset collisions.