falaw.operations.render#
Beat / shot / scene rendering with caching.
The directorial workflow only works if a single IR edit causes only the affected parts to re-render. Each renderer here:
Computes a content hash from the IR (
beat_content_hash/shot_content_hash) plus the relevant identity anchors.Stores the result in
falaw.cachekeyed by that hash.Returns a small dict with
url,cache_hit, andhashso the scene renderer can build a manifest.
Outputs:
render_beat— TTS (using the speaker’s voice) → lipsync to the speaker’s reference image. Returns a video URL.render_shot— a still or short clip of the visual frame (storyboard or i2v depending on quality).render_scene— orchestrates beats and shots, returns a manifest dict that can be persisted next to the Scene file.
Functions
|
Yield |
|
Return where |
|
Render one Beat to a lipsynced video. |
|
Render every shot and beat. |
|
Render a Shot as a still (default) or a short clip. |
- falaw.operations.render.iter_render_scene(scene, *, tts_quality='balanced', lipsync_quality='high', shot_quality='balanced', shots_as_video=False, force=False, concurrency=1)[source]#
Yield
(kind, result)pairs as each shot/beat finishes.kind∈{"shot", "beat"}. Withconcurrency=1results arrive in submission order (shots before beats). Withconcurrency > 1they arrive in completion order (use the"shot_id"/"beat_id"keys to re-key by identity).Cache hits are immediate: a fully-cached scene yields all results in close succession even at
concurrency=1.
- falaw.operations.render.manifest_path_for(scene, *, dir=None)[source]#
Return where
render_scene’s manifest would be saved by default.- Return type:
- falaw.operations.render.render_beat(beat, character, *, tts_quality='balanced', lipsync_quality='high', tts_model_id=None, avatar_model_id=None, force=False)[source]#
Render one Beat to a lipsynced video. Returns a small manifest dict.
- Parameters:
tts_model_id (
Optional[str]) – Override the TTS model. When provided, takes precedence over the character’s voice.model_id and overtts_quality-basedpick_model. Use this to force a specific TTS engine for one beat (e.g. eleven-v3 for emotional delivery, multilingual-v2 for consistency).avatar_model_id (
Optional[str]) – Override the avatar/lipsync model (e.g."fal-ai/bytedance/omnihuman/v1.5"to bypass the defaultai-avatarwhich is known to hang).
- Return type:
- falaw.operations.render.render_scene(scene, *, tts_quality='balanced', lipsync_quality='high', shot_quality='balanced', shots_as_video=False, force=False, concurrency=1)[source]#
Render every shot and beat. Returns a manifest dict.
concurrencycontrols how many shots/beats run in parallel against fal. The work is HTTP-bound, so a thread pool is enough. Default1preserves serial behavior. Useiter_render_scene()instead if you want results yielded as each unit completes (for live UI updates).- Return type: