Skip to content
GitHub

Configuration

Configuration options for lexigram-multimedia-video.


Configuration lives on two BaseConfig classes:

Classconfig_sectionPurpose
VideoConfig"multimedia_video"Generation subsystem (backend, base URLs, API secrets, ComfyUI knobs)
VideoProcessingConfig"multimedia_video_processing"ffmpeg processing pipeline (nested under VideoConfig.processing)

As a subsystem of the lexigram-multimedia umbrella, config is nested under the multimedia: key in application.yaml with prefix LEX_MULTIMEDIA__VIDEO__. Or pass a VideoConfig directly to VideoModule.configure(...).

VideoModule.configure()VideoConfig(backend="local-http") — generation against a local server at http://localhost:5004, processing enabled when the ffmpeg binary is on PATH.


multimedia:
video:
backend: "comfyui"
comfyui_base_url: "http://localhost:8188"
comfyui_checkpoint: "svd_xt_1_1.safetensors"
processing:
ffmpeg_binary: "ffmpeg"
max_concurrent_jobs: 4
temp_dir: "/var/tmp/lexigram"
timeout: 300.0
from lexigram.multimedia.video import VideoModule
from lexigram.multimedia.video.config import VideoConfig, VideoProcessingConfig
VideoModule.configure(
config=VideoConfig(
backend="comfyui",
comfyui_base_url="http://localhost:8188",
processing=VideoProcessingConfig(max_concurrent_jobs=4),
)
)

OptionTypeDefaultDescription
backendLiteral["local-http", "runway", "openai", "wan22", "cogvideox", "svd", "comfyui"]"local-http"Generation backend selected at registration
local_http_base_urlstr"http://localhost:5004"Local reference server base URL
runway_api_key_secret_namestr"runway_api_key"Secret name resolved via AsyncSecretStoreProtocol for Runway
openai_api_key_secret_namestr"openai_api_key"Secret name for the OpenAI gateway
openai_modelstr"sora-2"Default model sent as payload["model"] (VideoRequest.model overrides)
openai_base_urlstr"https://api.openai.com"OpenAI-compatible base URL (gateway routing)
wan22_base_urlstr"http://localhost:5200"Wan2.2 reference server
cogvideox_base_urlstr"http://localhost:5201"CogVideoX reference server
svd_base_urlstr"http://localhost:5202"SVD reference server
comfyui_base_urlstr"http://localhost:8188"ComfyUI server
comfyui_checkpointstr"svd_xt_1_1.safetensors"Checkpoint name filled into the workflow
comfyui_workflow_pathstr | NoneNoneCustom workflow JSON template (default: bundled workflows/default_svd.json)
comfyui_fpsint6Frames-per-second placeholder
comfyui_motion_bucket_idint127SVD motion bucket placeholder
comfyui_poll_intervalfloat1.0History poll interval in seconds
timeoutfloat | NoneNoneOverall request timeout; None → each backend’s own default
processingVideoProcessingConfigdefault factoryNested ffmpeg pipeline config
OptionTypeDefaultDescription
ffmpeg_binarystr"ffmpeg"ffmpeg executable (ffprobe is derived from its name)
max_concurrent_jobsint2Semaphore cap on concurrent ffmpeg jobs
temp_dirstr | NoneNoneWorkdir root for materialized inputs/outputs
timeoutfloat300.0Per-job ffmpeg timeout in seconds (kills the process)

Backend constructor mapping (VideoGenerationProvider.register())

Section titled “Backend constructor mapping (VideoGenerationProvider.register())”
backendClassKey construction args
"local-http"LocalHttpVideoProviderbase_url=local_http_base_url
"runway"RunwayVideoProviderapi_key from secret runway_api_key_secret_name
"openai"OpenAIVideoProviderapi_key from secret openai_api_key_secret_name, model=openai_model, base_url=openai_base_url
"wan22"Wan22VideoProviderbase_url=wan22_base_url
"cogvideox"CogVideoXVideoProviderbase_url=cogvideox_base_url
"svd"SVDVideoProviderbase_url=svd_base_url
"comfyui"ComfyUiVideoProviderbase_url, checkpoint, workflow_path, fps, motion_bucket_id, poll_interval
anything elseraises ProviderNotInstalledError

timeout is forwarded only when set (_TimeoutKwargs); otherwise provider defaults apply: local-http/runway/openai 60.0, wan22/cogvideox 180.0, svd 120.0, comfyui 120.0. All constructors also receive optional retry/circuit_breaker.


VariableDescription
LEX_MULTIMEDIA__VIDEO__BACKENDBackend selection
LEX_MULTIMEDIA__VIDEO__LOCAL_HTTP_BASE_URLLocal server URL
LEX_MULTIMEDIA__VIDEO__RUNWAY_API_KEY_SECRET_NAMESecret name for Runway key
LEX_MULTIMEDIA__VIDEO__OPENAI_API_KEY_SECRET_NAMESecret name for OpenAI key
LEX_MULTIMEDIA__VIDEO__OPENAI_MODELDefault OpenAI gateway model
LEX_MULTIMEDIA__VIDEO__OPENAI_BASE_URLOpenAI-compatible base URL
LEX_MULTIMEDIA__VIDEO__WAN22_BASE_URLWan2.2 server URL
LEX_MULTIMEDIA__VIDEO__COGVIDEOX_BASE_URLCogVideoX server URL
LEX_MULTIMEDIA__VIDEO__SVD_BASE_URLSVD server URL
LEX_MULTIMEDIA__VIDEO__COMFYUI_BASE_URLComfyUI URL
LEX_MULTIMEDIA__VIDEO__COMFYUI_CHECKPOINTComfyUI checkpoint
LEX_MULTIMEDIA__VIDEO__COMFYUI_WORKFLOW_PATHCustom workflow JSON path
LEX_MULTIMEDIA__VIDEO__COMFYUI_FPSWorkflow fps
LEX_MULTIMEDIA__VIDEO__COMFYUI_MOTION_BUCKET_IDWorkflow motion bucket
LEX_MULTIMEDIA__VIDEO__COMFYUI_POLL_INTERVALPoll interval seconds
LEX_MULTIMEDIA__VIDEO__TIMEOUTRequest timeout
LEX_MULTIMEDIA__VIDEO__PROCESSING__FFMPEG_BINARYffmpeg binary
LEX_MULTIMEDIA__VIDEO__PROCESSING__MAX_CONCURRENT_JOBSConcurrency cap
LEX_MULTIMEDIA__VIDEO__PROCESSING__TEMP_DIRWorkdir root
LEX_MULTIMEDIA__VIDEO__PROCESSING__TIMEOUTPer-job ffmpeg timeout
Terminal window
export LEX_PROFILE=production
export LEX_MULTIMEDIA__VIDEO__BACKEND=runway
export LEX_MULTIMEDIA__VIDEO__PROCESSING__MAX_CONCURRENT_JOBS=4

Keys are resolved by name at registration:

# Secrets stored under name "runway_api_key" → RunwayVideoProvider(api_key=...)
# Secrets stored under name "openai_api_key" → OpenAIVideoProvider(api_key=...)

No key → api_key="" and _credential_resolved=False; the health check then reports DEGRADED for that provider. A 401 at call time raises VideoGenerationAuthenticationError.

module = VideoModule.stub()
# VideoConfig(backend="local-http"), real module — safe for boot smoke tests.
  • HTTP backends check GET /health (ComfyUI uses GET /system_stats) — 200 → HEALTHY, else DEGRADED.
  • Runway/OpenAI: HEALTHY only when _credential_resolved (an API key was found).

The umbrella imports this subsystem via lexigram.multimedia.subsystems (video) and lexigram.multimedia.modules (video); the compound config there nests under multimedia: / video:.


  • ✅ Keep config minimal — backend + one base URL per deployment.
  • ✅ Store API keys in the secrets backend; reference them by name — never commit keys.
  • ✅ Give processing.timeout headroom over your longest encode.
  • ✅ Isolate each reference server in its own venv (torch is heavy).
  • ❌ Don’t rely on timeout: null semantics — set it explicitly if your generation SDK is slow.
  • ❌ Don’t set comfyui_workflow_path to an unreadable/unreachable path — the provider reads it at request time.