fix(processing): preserve pipeline audio across process_decode

process_decode strips video pipeline output to a flat list of frames at the
PIL early-return (processing_diffusers.py:461-465), so any output.audio is
lost before processing.process_images returns. video pipelines that produce
synchronized audio (LTX-2 audio-capable models) were getting silent mp4s on
the non-latent path.

stash output.audio on p.audio_capture before process_decode runs and let
processing read it back as a fallback when samples is a flat list.

ltx_process non-latent branch strips the (B, 2, N) batch dim with [0] so
write_audio's .T+contiguous() path produces interleaved bytes for AAC s16.
This commit is contained in:
CalamitousFelicitousness
2026-05-02 04:08:55 +01:00
parent a6870f7d27
commit 207e7d8b3b
3 changed files with 10 additions and 3 deletions
+4
View File
@@ -628,6 +628,10 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
timer.process.add('lora', lora_common.timer.total)
lora_common.timer.clear(complete=True)
# process_decode flattens video output to a frame list and drops the audio attribute;
# stash it on `p` so video pipelines can recover it after process_images returns.
if output is not None and getattr(output, 'audio', None) is not None:
p.audio_capture = output.audio
results = process_decode(p, output)
timer.process.record('decode')