Commit Graph

16 Commits

Author SHA1 Message Date
indigo 110adc781e Add SCAIL-2 in-context mask channels (Phase 2, plumbing + zero-init surgery)
Port mechanism 2 of SCAIL-2 (arXiv:2606.10804) to LTX-2: extra per-token
in-context conditioning channels (1 environment switch + K=6 character binding
slots) concatenated onto the latent before the first projection.

Faithful temporal encoding for LTX's VAE (temporal factor 8): each latent frame
stacks its 8 pixel sub-frames along the channel dim, giving 8*(K+1)=56 channels
(vs the paper's 4*(K+1)=28 on Wan 2.1).

Plumbing (backward compatible; cond_channels=None leaves every existing pipeline
unchanged):
- LatentState/Modality gain an optional cond_channels field (patchified [B,T,C]).
- LTXModel(mask_conditioning_channels=0) config-gates a widened patchify_proj;
  TransformerArgsPreprocessor concatenates cond_channels (or zero-pads) before it.
- tools.clear_conditioning trims it; token-appending conditioning items
  (reference video/audio, driving, keyframe) extend it via extend_cond_channels.

New:
- VideoConditionByMaskChannels: encodes (K+1) pixel masks -> 56 channels, written
  onto the trailing driving tokens (noisy target stays all-zero, per the paper).
- widen_patchify_proj_for_mask_channels: zero-init checkpoint surgery so a
  converted model reproduces the base output exactly until finetuned.

Verified (CPU, random weights): backward compat, zero-init widened forward is
bit-identical to baseline for any cond_channels, and the driving+mask pipeline
forwards without crashing with correct placement/clipping. Visual quality
requires Phase 3 finetuning; Replacement-mode z_ref height shift still deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 09:50:27 +08:00
github-actions[bot] 63fd9a4f86 Automated PR - 2026-07-07 2026-07-07 16:57:50 +00:00
github-actions[bot] f4b06fb977 Automated PR - 2026-06-17 2026-06-17 14:21:07 +00:00
github-actions[bot] fe94199e5d Automated PR - 2026-05-28 2026-05-28 15:39:26 +00:00
github-actions[bot] 203d4842d4 Automated PR - 2026-05-28 2026-05-28 14:26:15 +00:00
github-actions[bot] 7df34dfa83 Automated PR - 2026-05-11 2026-05-11 13:14:05 +00:00
github-actions[bot] b604d3fab3 Automated PR - 2026-04-23 2026-04-23 12:43:54 +00:00
github-actions[bot] d887bbd1e0 Automated PR - 2026-04-13 2026-04-13 14:29:35 +00:00
github-actions[bot] f4d0c1ec0e Automated PR - 2026-03-30 2026-03-30 17:59:34 +00:00
sync-bot d230aec5cd Automated PR - 2026-03-05 2026-03-05 15:47:20 +00:00
sync-bot 822ce3c4b1 Automated PR - 2026-03-04 2026-03-04 19:34:46 +00:00
sync-bot 4dbd99e628 Automated PR - 2026-02-09 2026-02-09 12:03:47 +00:00
sync-bot ca1623ad2a Automated PR - 2026-01-29 2026-01-29 18:42:17 +00:00
sync-bot e5a15a4777 Automated PR - 2026-01-12 2026-01-12 14:14:33 +00:00
sync-bot ac560b4775 Automated PR - 2026-01-08 2026-01-08 15:29:32 +00:00
sync-bot 9ce438b353 Automated PR - 2026-01-05 2026-01-05 20:10:38 +00:00