Commit Graph

47 Commits

Author SHA1 Message Date
indigo b69eedbd54 Add Modal test environment for SCAIL-2 training/inference
A free-tier-friendly Modal app to validate the SCAIL-2 code path on real
Linux/GPU without a local GPU or the 19B checkpoint.

- modal/checks.py: device-aware (CPU/GPU auto) consolidation of the Phase 1-4
  plumbing checks using tiny random-init models + synthetic data (no checkpoint,
  no dataset): driving concat, zero-init patchify_proj widening (output-preserving),
  a FlexibleStrategy driving+mask training step + loss, and inference conditioning
  assembly. Passes on CPU locally.
- modal/app.py: builds the workspace via `uv sync` (skips CUDA-only ltx-kernels;
  attention falls back to SDPA). Functions: verify (CPU, ~free), smoke (T4, cents),
  train (A10G/A100, paid — runs the real trainer against a checkpoint + data on the
  scail-data Volume).
- modal/README.md: free-tier setup (modal setup), run commands, cost table, the
  scale-up path, and the expected preprocessed dataset layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 09:37:27 +08:00
indigo a598f89d99 Fix ltx-trainer ruff target-version and a hidden lint finding
The [tool.ruff] target-version was accidentally set to the package version
"1.1.7", which made ruff fail to parse the whole package's pyproject and
silently skip linting. Set it to "py310" to match requires-python >=3.10.

With ruff working again it flagged a too-many-branches finding in the Phase 3
SCAIL wiring: extract the driving + mask-channel loops from _process_modality
into a new _apply_scail_conditions helper. Behavior is unchanged (Phase 3 CPU
verification still passes); full `ruff check .` on the trainer now passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 21:00:45 +08:00
indigo 06c0870bbb Add SCAIL-2 animation inference pipeline (Phase 4, ltx-pipelines)
Two-stage distilled inference pipeline that animates a character from a driving
video, wiring the Phase 1-3 SCAIL-2 conditioning into a runnable CLI.

- scail_animation.py: ScailAnimationPipeline (mirrors distilled.py) plus a pure,
  testable build_scail_conditionings that assembles VideoConditionByDrivingLatent
  + VideoConditionByMaskChannels (driving appended, mask on the trailing driving
  tokens), and a load_masks helper. main() + scail_animation_arg_parser add
  --driving-video / --mask-path / --mode / --driving-strength on top of the
  standard two-stage distilled parser.
- LTXModelConfigurator now reads config `mask_conditioning_channels`, so a
  SCAIL-trained checkpoint whose config declares it builds the widened
  patchify_proj automatically — no runtime widening wrapper needed at inference.
- CLAUDE.md pipeline table row.

Verified on CPU (verify_phase4_pipeline.py): the module imports, the CLI parses
the SCAIL flags, build_scail_conditionings grows the sequence and places the mask
channels on the driving tokens (target stays zero), driving-only leaves
cond_channels None, and the configurator honors mask_conditioning_channels
(patchify_proj widened from config). End-to-end runs still need a GPU and a
SCAIL-trained checkpoint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 10:22:35 +08:00
indigo e03cc62548 Add SCAIL-2 training integration (Phase 3, ltx-trainer FlexibleStrategy)
Wire SCAIL-2 driving + in-context mask conditioning into the trainer via the
unified FlexibleStrategy, so the widened patchify_proj (Phase 2) can be trained.

- flexible.py: new DrivingConditionConfig (driving-latent concat with a RoPE
  width offset ΔW) and MaskChannelsConditionConfig (semantic masks -> per-token
  channels), added to the condition union and get_data_sources. Driving is
  prepended (cond-first, target stays at the tail for loss slicing); mask
  channels are written onto the driving tokens via Modality.cond_channels,
  reusing ltx-core encode_mask_channels. The noisy target keeps a zero mask.
- model_loader.load_transformer gains mask_conditioning_channels, widening the
  video patchify_proj with zero-init columns via a new live-module helper
  (widen_module_patchify_proj_for_mask_channels). ModelConfig exposes the field.
- trainer unfreezes patchify_proj in LoRA mode when mask channels are active
  (the new input columns are new base params LoRA cannot reach).
- configs/scail_animation_lora.yaml plus README / training-modes table rows.

Verified on CPU (verify_phase3_trainer.py): config round-trips, prepare_training
_inputs builds cond_channels [B,T,56] with the mask on the driving tokens, a tiny
widened model forwards and compute_loss returns a finite [B] loss, and the widen
helper is output-preserving at zero init. Real training needs Linux+GPU+checkpoint;
dataset preprocessing (driving latents + semantic masks) and validation-runner
wiring are left for later.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 10:09:40 +08:00
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
indigo baa6646fd1 Add SCAIL-2 driving-latent conditioning (Phase 1, inference PoC)
Port mechanisms 1+3 of SCAIL-2 (arXiv:2606.10804) to LTX-2: concatenate a
driving video latent directly into the DiT token sequence with a width-axis
RoPE offset (ΔW) so driving coords stay detached from the target video.

- New VideoConditionByDrivingLatent + DrivingMode in ltx-core conditioning,
  modeled on VideoConditionByReferenceLatent (patchify -> positions -> append
  -> attention mask). Applies ΔW width shift, aligns time to the target, and
  guards against RoPE wrap (max_pos) and target/driving shape mismatch.
- Export both from conditioning packages.
- docs/plan.md and docs/tasks.md track the phased port.

Inference-only: no weight changes. Mechanism 2 (in-context mask channels,
patchify_proj widening) and training are deferred to Phase 2+. Validated via
plumbing checks and a real (random-weight) transformer forward smoke run;
visual quality is not validated (requires Phase 2/3 finetuning).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 09:06:35 +08:00
Michael Kupchick 9377758131 Merge pull request #248 from Lightricks/pr-2026-07-07-be3b401
Public sync - 2026-07-07
2026-07-08 08:50:18 +03:00
github-actions[bot] 63fd9a4f86 Automated PR - 2026-07-07 2026-07-07 16:57:50 +00:00
Alexey Kravtsov 780984275f Merge pull request #237 from Lightricks/pr-2026-06-17-97c9503
Public sync - 2026-06-17
2026-06-17 17:26:42 +03:00
github-actions[bot] f4b06fb977 Automated PR - 2026-06-17 2026-06-17 14:21:07 +00:00
Michael Kupchick d6053703e0 Merge pull request #221 from Lightricks/pr-2026-05-28-da90e6c
Public sync - 2026-05-28
2026-05-28 18:41:33 +03:00
github-actions[bot] fe94199e5d Automated PR - 2026-05-28 2026-05-28 15:39:26 +00:00
Michael Kupchick 7dc613f80c Merge pull request #220 from Lightricks/pr-2026-05-28-c2d4340
Public sync - 2026-05-28
2026-05-28 17:27:21 +03:00
github-actions[bot] 203d4842d4 Automated PR - 2026-05-28 2026-05-28 14:26:15 +00:00
Michael Kupchick 1799988521 Merge pull request #212 from Lightricks/pr-2026-05-11-a904df5
Public sync - 2026-05-11
2026-05-11 16:16:39 +03:00
github-actions[bot] 7df34dfa83 Automated PR - 2026-05-11 2026-05-11 13:14:05 +00:00
Michael Kupchick 41d9243716 Merge pull request #201 from Lightricks/pr-2026-04-23-e9047d1 2026-04-23 16:02:43 +03:00
github-actions[bot] b604d3fab3 Automated PR - 2026-04-23 2026-04-23 12:43:54 +00:00
Michael Kupchick a2c3f24078 Merge pull request #192 from Lightricks/pr-2026-04-13-3c38708
Public sync - 2026-04-13
2026-04-13 18:30:04 +03:00
github-actions[bot] d887bbd1e0 Automated PR - 2026-04-13 2026-04-13 14:29:35 +00:00
Michael Kupchick 59ca828d5a Merge pull request #179 from Lightricks/pr-2026-03-30-9311fed
Public sync - 2026-03-30
2026-03-30 21:04:05 +03:00
github-actions[bot] f4d0c1ec0e Automated PR - 2026-03-30 2026-03-30 17:59:34 +00:00
Michael Kupchick ae855f8538 Merge pull request #159 from Lightricks/pr-2026-03-11 2026-03-11 16:49:14 +02:00
sync-bot b17ec39d6e Automated PR - 2026-03-11 2026-03-11 14:38:31 +00:00
Michael Kupchick 9e8a28e17a Merge pull request #136 from Lightricks/pr-2026-03-05
Open a PR to sync - 2026-03-05
2026-03-05 17:57:02 +02:00
sync-bot d230aec5cd Automated PR - 2026-03-05 2026-03-05 15:47:20 +00:00
Michael Kupchick 3b6d09d7b6 Merge pull request #134 from Lightricks/pr-2026-03-04
Open a PR to sync - 2026-03-04
2026-03-04 21:37:51 +02:00
sync-bot 822ce3c4b1 Automated PR - 2026-03-04 2026-03-04 19:34:46 +00:00
Michael Kupchick 28c3c73fe5 Merge pull request #111 from Lightricks/pr-2026-02-09
Open a PR to sync - 2026-02-09
2026-02-09 15:46:17 +02:00
sync-bot 4dbd99e628 Automated PR - 2026-02-09 2026-02-09 12:03:47 +00:00
Michael Kupchick 4f410820b1 Merge pull request #97 from Lightricks/pr-2026-01-29
Open a PR to sync - 2026-01-29
2026-01-29 21:30:12 +02:00
sync-bot ca1623ad2a Automated PR - 2026-01-29 2026-01-29 18:42:17 +00:00
Michael Kupchick 727c43e998 Merge pull request #73 from Lightricks/pr-2026-01-15 2026-01-15 21:26:53 +02:00
sync-bot 310103a53e Automated PR - 2026-01-15 2026-01-15 19:19:42 +00:00
Michael Kupchick bd92a5f408 Merge pull request #63 from Lightricks/pr-2026-01-13
Open a PR to sync - 2026-01-13
2026-01-13 20:14:34 +02:00
sync-bot a519c7c8f6 Automated PR - 2026-01-13 2026-01-13 13:09:02 +00:00
Michael Kupchick 391c0a2462 Merge pull request #55 from Lightricks/pr-2026-01-12
Open a PR to sync - 2026-01-12
2026-01-12 18:05:51 +02:00
sync-bot e5a15a4777 Automated PR - 2026-01-12 2026-01-12 14:14:33 +00:00
Michael Kupchick 628956009c Merge pull request #36 from Lightricks/pr-2026-01-08
Open a PR to sync - 2026-01-08
2026-01-08 17:34:58 +02:00
sync-bot ac560b4775 Automated PR - 2026-01-08 2026-01-08 15:29:32 +00:00
Michael Kupchick 7179f0d0e3 README: Change paper link to technical report PDF. 2026-01-06 18:52:15 +02:00
Michael Kupchick 662146457b README: Update video source. 2026-01-06 07:17:11 +02:00
Michael Kupchick 0188a96362 README: Embed video.
Added a video element to the README for demonstration.
2026-01-06 07:12:38 +02:00
Michael Kupchick ec09231223 README: Replace asset link.
Updated asset link in README.md
2026-01-06 07:09:57 +02:00
Michael Kupchick 5cb97a9f07 Merge pull request #1 from Lightricks/pr-2026-01-05
Open a PR to sync - 2026-01-05
2026-01-05 22:12:44 +02:00
sync-bot 9ce438b353 Automated PR - 2026-01-05 2026-01-05 20:10:38 +00:00
Michael Kupchick fc3b319d34 Initial commit. 2026-01-05 20:39:00 +02:00