* Public `VideoGenerator.generate_video(**kwargs)` was silently dropping
every LTX-2 audio-conditioning kwarg (`audio_num_frames`,
`ltx2_audio_clean_latent`, `ltx2_audio_denoise_mask`,
`video_position_offset_sec`, `ltx2_audio_latents`).
`SamplingParam.update()` `logger.error`'d on unknown fields and
continued, so `apply_audio()` for continuation segments was
effectively a no-op: audio was generated for the default num_frames
duration and `ltx2_audio_latents` was never carried forward across
segments.
* The downstream symptom on Dreamverse was a confusing ffmpeg
"frame writer failed: [Errno 32] Broken pipe" on segment 2: trimmed
audio ended ~1.7s before trimmed video, ffmpeg `-shortest` closed
stdin, the writer thread's next `proc.stdin.write(...)` hit EPIPE.
* Port the FastVideo-internal routing block into public:
- `_BATCH_EXTRA_PASSTHROUGH_KEYS` enumerates the 5 LTX-2 audio kwargs.
- `_generate_video_impl` extracts them from `**kwargs` BEFORE
`sampling_param.update()` and stashes as `kwargs["_extra_overrides"]`.
- `_generate_single_video` pops `_extra_overrides` and copies into
`batch.extra` so `ltx2_denoising` / `ltx2_refine` see them.
- Surface `output_batch.extra["ltx2_audio_latents"]` in the result
dict so `Dreamverse._derive_next_audio_latents` can carry latents
across segments.
* Convert `SamplingParam.update()` to raise `ValueError` on unknown
keys instead of `logger.error`-and-continue. Future contributors who
add a pipeline-specific kwarg without registering it will hit a loud
failure pointing at `_BATCH_EXTRA_PASSTHROUGH_KEYS` rather than
debug a broken-pipe-shaped symptom hours later.
* Add `fastvideo/tests/api/test_extra_overrides_routing.py` (7 tests)
pinning the passthrough-key set, the strict-update contract, and the
error-message hint at the right routing mechanism.
Verified end-to-end on GPU 4 with the dreamverse-deploy skill: segment 2
streams 22 av chunks / 3.8MB clean, no BrokenPipeError, `Cached audio
latents shape=(1, 8, 126, 16)` log line confirms latents now carry.
185/185 fastvideo/tests/api/ tests pass.
Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
Replaces the T2V-only stub with the full internal port:
* resolve_ltx2_images / _resize_and_center_crop / CRF re-encode
* load_ltx2_conditioning_image + load_ltx2_conditioning_video_clip
* _extract_video_latent / _insert_conditioning_latent
* build_ltx2_image_conditioning composes (clean_latent, denoise_mask)
from images + video clips + continuation latents (stage1 vs stage2)
— returns None for plain T2V
ForwardBatch + SamplingParam gain the missing fields the builder
reads (ltx2_images, ltx2_image_crf, ltx2_conditioning_latent_stage1/2,
ltx2_video_conditions). generate_video kwargs flow through
sampling_param.update -> ForwardBatch(**shallow_asdict(...)) so
Dreamverse's ltx2_image_crf=0.0 and continuation latents land on the
batch correctly.
68/68 LTX-2 tests still green.
Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
Internal FastVideo declares two LTX-2 SamplingParam variants:
LTX2SamplingParam (mod=3.0/rescale=0.7/stg=1.0 — full LTX-2) and
LTX2DistilledSamplingParam (mod=1.0/rescale=0.0/stg=0.0). Dreamverse
production runs against LTX2-Distilled-Diffusers, so the distilled
defaults are what the runtime should land on.
The public package only has the single SamplingParam class, and its
class-level defaults for these knobs were the *full* LTX-2 values.
Result: when Dreamverse (or any other consumer) called
``SamplingParam.from_pretrained("FastVideo/LTX2-Distilled-Diffusers")``,
the LTX2_DISTILLED preset's defaults dict didn't override these
fields (it didn't list them) so they fell through to the class
defaults — silently picking up *full*-model CFG / modality / rescale /
STG instead of the distilled ones. Streamed video output diverged
from the internal-ui reference.
Switch the class defaults to the distilled values (1.0 / 0.0 / 0.0).
The LTX2_BASE preset already overrides them explicitly to 3.0/0.7/1.0
in its ``defaults`` dict, so users selecting the full-LTX-2 preset
keep the full-model behavior.
The numerical alignment harness still reproduces the same 42.72 dB
PSNR / 52.87% exact pixel match because that test pinned the values
explicitly via legacy kwargs; this fix moves the *default* path on
the public side onto the same numerical track.
Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>