Apply sigma to contrastive guidance to balance loss better. Prevent noise grads on images/non audio datasets. Prep for training adapters on MiniMax H3

This commit is contained in:
Jaret Burkett
2026-08-05 13:27:12 -06:00
parent 9065951da3
commit 1e1418b22c
8 changed files with 163 additions and 10 deletions

View File

@@ -942,7 +942,17 @@ class LTX2Model(BaseModel):
patch_size_t=self.pipeline.transformer_temporal_patch_size,
)
if batch.audio_latents is not None or batch.audio_tensor is not None:
# audio only trains for video batches from datasets that asked for
# it. Cached latents can carry audio after do_audio was turned off,
# and image (single frame) batches must never pick up a soundtrack.
do_audio = (
batch.dataset_config is not None
and batch.dataset_config.do_audio
and getattr(batch, "num_frames", 1) > 1
)
if do_audio and (
batch.audio_latents is not None or batch.audio_tensor is not None
):
if batch.audio_latents is not None:
# we have audio latents cached
raw_audio_latents = batch.audio_latents.to(