Skip to content

Free, open-source AI video generator for Mac. Run LTX-2.5 and MiniMax H3 (Hailuo) locally on Apple Silicon: text-to-video and image-to-video with sound, lip-sync, character LoRA training, songs from lyrics (YuE2) and image editing (Qwen-Image-Edit). One-click install via Pinokio. Offline: no cloud, no API key, no NVIDIA GPU.

release(v4.19.0): Hailuo H3 learns keyframes, extend, lip-sync and sound; trained characters work again

mrbizarro742353298649
diff --git a/.gitignore b/.gitignore
index ea62870..67bc804 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,6 +74,13 @@ ltx-2-mlx/
# nested inside a vendored tree.
/minimax-h3-mlx
/minimax-h3-mlx/
+# Read-only sparse clones of other LTX-2 trainers (Lightricks' official
+# ltx-trainer, ostris ai-toolkit), kept next to the code so the #62 trainer
+# comparison in the PR #89 investigation log (tanis2000/Phosphene, branch
+# issue-62, docs/ISSUE_62_VALERIOSAN_2026-09-30.md) can be re-checked line
+# by line. Separate git repos with their own licences; never ours to commit.
+/reference_trainers
+/reference_trainers/
.venv
.venv/
diff --git a/README.md b/README.md
index 9400383..7c202d1 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
</p>
-> **Current release: v4.18.0.** **Your gallery plays itself, and your audio goes where it is needed.** **Play all** shows every output full size, one after another: each clip plays once, each photo stays as long as you choose (1-10 s), a song plays to its end, and the controls fade away while it runs. Any audio in Outputs has **Use this audio for...**: Lip-sync, a Music video, the soundtrack of an image-to-video clip, or a Music Studio cover - no trip to Finder. **Enhance knows your LoRAs**: it reads each active LoRA's guide or creator notes and puts back a trigger word the rewrite left out. A CivitAI LoRA download shows its percentage and can be **cancelled**, and toast messages show their words again (since 4.17.0 they appeared empty). 4.17.5: renders that recover when macOS stops the GPU on M1/M2. 4.17.0: estimates for your Mac, faces kept in portrait and phone photos, Lip-sync as a Video mode, and a much bigger Editor. Press Update in Pinokio, then restart. Full notes on the [releases page](https://github.com/mrbizarro/Phosphene/releases).
+> **Current release: v4.19.0.** **Hailuo H3 grows up, and trained characters look like themselves again.** On Hailuo H3: **Keyframes** (an end frame, first + last, or stills at exact moments), **Extend** any clip, **Lip-sync** a face to your own voice or song, **Add sound** to a silent clip, smoother 10-15 s shots (each window carries the end of the last one, picture and sound), and **Fast HD**. Characters and voices trained in Phosphene since June were saved with their numbers in the wrong order and carried no likeness; new trainings save correctly and **Update repairs the ones you already have** (found by @tanis2000, #62). **Extend no longer wears your clip down** round after round: the part you already had is delivered untouched and only the new part is encoded (#48). 4.18.0: Play all, Use this audio for..., LoRA-aware Enhance. Press Update in Pinokio, then restart. Full notes on the [releases page](https://github.com/mrbizarro/Phosphene/releases).
## Overview
@@ -67,8 +67,8 @@ Text-to-video, image-to-video, and audio-to-video, all delivered as MP4 with joi
| | [**LTX-Video 2.5**](https://github.com/Lightricks/LTX-Video) | [**Hailuo H3**](https://github.com/MiniMax-AI) (MiniMax-H3 FL2VA) |
|---|---|---|
| **How you get it** | The base install (27.5 GB) | One click in the Pinokio sidebar (75 GB) |
-| **Modes** | Text, image, keyframes, extend, audio-to-video, character | Text and image |
-| **Character LoRAs** | Yes — trained in-panel, face + voice | Not yet |
+| **Modes** | Text, image, keyframes, extend, audio-to-video, character | Text, image, keyframes (end frame, first + last, timed), extend, lip-sync to your audio, add sound to a silent clip |
+| **Character LoRAs** | Yes — trained in-panel, face + voice | Imported H3 LoRAs (no in-panel training yet) |
| **Memory** | Every tier in the table above; the surface adapts | 36 GB+ on the compact Q8 engine (the install builds it); 60 GB+ also runs the full bf16 engine |
| **Best at** | Breadth: every workflow the panel offers, plus your own trained faces | Dialogue: joint video + spoken lines + sound, from one prompt |
| **Weights licence** | [LTX-2.x Community License](LICENSES/LTX-2.x-Community-License.md) (Lightricks) | MiniMax Community License — territory restrictions apply |
diff --git a/VERSION b/VERSION
index b30c4dc..a69aa5a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.18.0
+4.19.0
diff --git a/data/fleet_timings.json b/data/fleet_timings.json
index d74564e..6ac922f 100644
--- a/data/fleet_timings.json
+++ b/data/fleet_timings.json
@@ -1,5 +1,5 @@
{
- "built_at": "2026-10-06T09:56:04Z",
+ "built_at": "2026-10-08T10:44:50Z",
"levels": {
"cell": {
"cells": {
@@ -57,6 +57,12 @@
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
+ "h3|i2v|draft_10s|243.0|M3 Ultra|512.0|fast": {
+ "n": 12,
+ "p25_sec": 390.0,
+ "p50_sec": 510.0,
+ "p75_sec": 675.0
+ },
"h3|i2v|draft_10s|243.0|M4 Max|128.0|fast": {
"n": 3,
"p25_sec": 600.0,
@@ -75,6 +81,12 @@
"p50_sec": 420.0,
"p75_sec": 420.0
},
+ "h3|i2v|draft_10s|243.0|M4 Pro|48.0|fast": {
+ "n": 3,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
"h3|i2v|draft_10s|243.0|M5 Max|128.0|fast": {
"n": 10,
"p25_sec": 120.0,
@@ -322,10 +334,10 @@
"p75_sec": 750.0
},
"h3|i2v|draft_5s|124.0|M3 Ultra|512.0|fast": {
- "n": 20,
+ "n": 31,
"p25_sec": 90.0,
"p50_sec": 90.0,
- "p75_sec": 120.0
+ "p75_sec": 240.0
},
"h3|i2v|draft_5s|124.0|M4 Max|128.0|fast": {
"n": 8,
@@ -363,6 +375,12 @@
"p50_sec": 75.0,
"p75_sec": 90.0
},
+ "h3|i2v|draft_5s|124.0|M5 Max|48.0|best": {
+ "n": 3,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 120.0
+ },
"h3|i2v|draft_5s|124.0|M5 Max|48.0|fast": {
"n": 3,
"p25_sec": 60.0,
@@ -382,7 +400,7 @@
"p75_sec": 420.0
},
"h3|i2v|draft_5s|124.0|M5 Pro|64.0|fast": {
- "n": 29,
+ "n": 30,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -454,10 +472,10 @@
"p75_sec": 1800.0
},
"h3|i2v|high_10s|243.0|M4 Max|128.0|fast": {
- "n": 19,
+ "n": 27,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
- "p75_sec": 1800.0
+ "p75_sec": 1200.0
},
"h3|i2v|high_10s|243.0|M4 Max|48.0|best": {
"n": 7,
@@ -472,7 +490,7 @@
"p75_sec": 2400.0
},
"h3|i2v|high_10s|243.0|M4 Max|64.0|fast": {
- "n": 100,
+ "n": 110,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -496,7 +514,7 @@
"p75_sec": 1200.0
},
"h3|i2v|high_10s|243.0|M5 Pro|48.0|fast": {
- "n": 22,
+ "n": 36,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -520,7 +538,7 @@
"p75_sec": 2400.0
},
"h3|i2v|high_15s|362.0|M4 Max|128.0|fast": {
- "n": 682,
+ "n": 713,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -532,10 +550,10 @@
"p75_sec": 1200.0
},
"h3|i2v|high_15s|362.0|M5 Max|64.0|best": {
- "n": 4,
+ "n": 5,
"p25_sec": 1800.0,
"p50_sec": 1800.0,
- "p75_sec": 1950.0
+ "p75_sec": 2400.0
},
"h3|i2v|high_15s|362.0|M5 Max|64.0|fast": {
"n": 3,
@@ -604,7 +622,7 @@
"p75_sec": 600.0
},
"h3|i2v|high_3s|73.0|M5 Max|128.0|fast": {
- "n": 30,
+ "n": 51,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -616,7 +634,7 @@
"p75_sec": 300.0
},
"h3|i2v|high_3s|73.0|M5 Pro|48.0|fast": {
- "n": 131,
+ "n": 135,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
@@ -664,7 +682,7 @@
"p75_sec": 1800.0
},
"h3|i2v|high_5s|124.0|M2 Ultra|64.0|fast": {
- "n": 22,
+ "n": 23,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -694,15 +712,15 @@
"p75_sec": 300.0
},
"h3|i2v|high_5s|124.0|M3 Ultra|512.0|best": {
- "n": 16,
- "p25_sec": 1650.0,
- "p50_sec": 2400.0,
+ "n": 20,
+ "p25_sec": 1800.0,
+ "p50_sec": 3600.0,
"p75_sec": 3600.0
},
"h3|i2v|high_5s|124.0|M3 Ultra|512.0|fast": {
- "n": 5,
+ "n": 12,
"p25_sec": 900.0,
- "p50_sec": 1200.0,
+ "p50_sec": 1050.0,
"p75_sec": 1200.0
},
"h3|i2v|high_5s|124.0|M3 Ultra|96.0|best": {
@@ -718,8 +736,8 @@
"p75_sec": 420.0
},
"h3|i2v|high_5s|124.0|M4 Max|128.0|fast": {
- "n": 78,
- "p25_sec": 900.0,
+ "n": 109,
+ "p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 900.0
},
@@ -748,7 +766,7 @@
"p75_sec": 1800.0
},
"h3|i2v|high_5s|124.0|M4 Max|64.0|fast": {
- "n": 153,
+ "n": 160,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -766,9 +784,9 @@
"p75_sec": 1200.0
},
"h3|i2v|high_5s|124.0|M5 Max|128.0|fast": {
- "n": 77,
+ "n": 99,
"p25_sec": 180.0,
- "p50_sec": 240.0,
+ "p50_sec": 300.0,
"p75_sec": 300.0
},
"h3|i2v|high_5s|124.0|M5 Pro|48.0|best": {
@@ -778,7 +796,7 @@
"p75_sec": 600.0
},
"h3|i2v|high_5s|124.0|M5 Pro|48.0|fast": {
- "n": 447,
+ "n": 558,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -802,7 +820,7 @@
"p75_sec": 2400.0
},
"h3|i2v|native_10s|243.0|M5 Max|128.0|fast": {
- "n": 12,
+ "n": 15,
"p25_sec": 1200.0,
"p50_sec": 1800.0,
"p75_sec": 1800.0
@@ -837,6 +855,12 @@
"p50_sec": 600.0,
"p75_sec": 600.0
},
+ "h3|i2v|native_3s|73.0|M5 Max|128.0|fast": {
+ "n": 6,
+ "p25_sec": 375.0,
+ "p50_sec": 900.0,
+ "p75_sec": 1200.0
+ },
"h3|i2v|native_5s|124.0|M1 Max|64.0|best": {
"n": 14,
"p25_sec": 5400.0,
@@ -880,7 +904,7 @@
"p75_sec": 2400.0
},
"h3|i2v|native_5s|124.0|M5 Max|128.0|fast": {
- "n": 12,
+ "n": 13,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 900.0
@@ -1018,13 +1042,13 @@
"p75_sec": 750.0
},
"h3|i2v|standard_10s|243.0|M4 Max|64.0|best": {
- "n": 49,
+ "n": 50,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"h3|i2v|standard_10s|243.0|M4 Max|64.0|fast": {
- "n": 144,
+ "n": 155,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -1252,9 +1276,9 @@
"p75_sec": 600.0
},
"h3|i2v|standard_5s|124.0|M2 Ultra|64.0|fast": {
- "n": 4,
+ "n": 5,
"p25_sec": 240.0,
- "p50_sec": 270.0,
+ "p50_sec": 240.0,
"p75_sec": 300.0
},
"h3|i2v|standard_5s|124.0|M3 Max|128.0|best": {
@@ -1318,9 +1342,9 @@
"p75_sec": 1125.0
},
"h3|i2v|standard_5s|124.0|M4 Max|128.0|fast": {
- "n": 6,
+ "n": 13,
"p25_sec": 300.0,
- "p50_sec": 360.0,
+ "p50_sec": 300.0,
"p75_sec": 420.0
},
"h3|i2v|standard_5s|124.0|M4 Max|64.0|fast": {
@@ -1336,13 +1360,13 @@
"p75_sec": 600.0
},
"h3|i2v|standard_5s|124.0|M5 Max|128.0|best": {
- "n": 99,
+ "n": 101,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
"h3|i2v|standard_5s|124.0|M5 Max|48.0|best": {
- "n": 8,
+ "n": 9,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -1522,7 +1546,7 @@
"p75_sec": 180.0
},
"h3|t2v|draft_15s|362.0|M5 Pro|64.0|fast": {
- "n": 10,
+ "n": 12,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -1588,7 +1612,7 @@
"p75_sec": 420.0
},
"h3|t2v|draft_3s|73.0|M3 Ultra|512.0|fast": {
- "n": 13,
+ "n": 14,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 45.0
@@ -1659,6 +1683,18 @@
"p50_sec": 45.0,
"p75_sec": 60.0
},
+ "h3|t2v|draft_3s|73.0|M5 Max|36.0|best": {
+ "n": 3,
+ "p25_sec": 60.0,
+ "p50_sec": 60.0,
+ "p75_sec": 60.0
+ },
+ "h3|t2v|draft_3s|73.0|M5 Max|36.0|fast": {
+ "n": 4,
+ "p25_sec": 41.2,
+ "p50_sec": 45.0,
+ "p75_sec": 48.8
+ },
"h3|t2v|draft_3s|73.0|M5 Max|48.0|best": {
"n": 5,
"p25_sec": 90.0,
@@ -1750,9 +1786,9 @@
"p75_sec": 1200.0
},
"h3|t2v|draft_5s|124.0|M3 Ultra|256.0|best": {
- "n": 10,
- "p25_sec": 240.0,
- "p50_sec": 240.0,
+ "n": 22,
+ "p25_sec": 180.0,
+ "p50_sec": 180.0,
"p75_sec": 240.0
},
"h3|t2v|draft_5s|124.0|M3 Ultra|512.0|best": {
@@ -1785,6 +1821,12 @@
"p50_sec": 210.0,
"p75_sec": 285.0
},
+ "h3|t2v|draft_5s|124.0|M4 Max|36.0|fast": {
+ "n": 3,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 360.0
+ },
"h3|t2v|draft_5s|124.0|M4 Max|64.0|best": {
"n": 15,
"p25_sec": 300.0,
@@ -1852,8 +1894,8 @@
"p75_sec": 60.0
},
"h3|t2v|draft_5s|124.0|M5 Pro|64.0|best": {
- "n": 9,
- "p25_sec": 240.0,
+ "n": 10,
+ "p25_sec": 255.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
@@ -2074,8 +2116,8 @@
"p75_sec": 420.0
},
"h3|t2v|high_5s|124.0|M5 Max|36.0|best": {
- "n": 4,
- "p25_sec": 1050.0,
+ "n": 11,
+ "p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
@@ -2307,6 +2349,12 @@
"p50_sec": 3600.0,
"p75_sec": 4050.0
},
+ "h3|t2v|standard_15s|362.0|M2 Max|96.0|fast": {
+ "n": 3,
+ "p25_sec": 1800.0,
+ "p50_sec": 2400.0,
+ "p75_sec": 3900.0
+ },
"h3|t2v|standard_15s|362.0|M4 Pro|48.0|best": {
"n": 10,
"p25_sec": 2400.0,
@@ -2356,10 +2404,10 @@
"p75_sec": 900.0
},
"h3|t2v|standard_3s|73.0|M1 Max|64.0|best": {
- "n": 4,
+ "n": 5,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 675.0
+ "p75_sec": 900.0
},
"h3|t2v|standard_3s|73.0|M1 Max|64.0|fast": {
"n": 7,
@@ -2500,9 +2548,9 @@
"p75_sec": 2250.0
},
"h3|t2v|standard_5s|124.0|M3 Ultra|512.0|fast": {
- "n": 22,
+ "n": 26,
"p25_sec": 120.0,
- "p50_sec": 510.0,
+ "p50_sec": 360.0,
"p75_sec": 600.0
},
"h3|t2v|standard_5s|124.0|M3 Ultra|96.0|best": {
@@ -2518,13 +2566,13 @@
"p75_sec": 900.0
},
"h3|t2v|standard_5s|124.0|M4 Max|128.0|fast": {
- "n": 30,
+ "n": 35,
"p25_sec": 240.0,
- "p50_sec": 300.0,
+ "p50_sec": 240.0,
"p75_sec": 420.0
},
"h3|t2v|standard_5s|124.0|M4 Max|36.0|best": {
- "n": 5,
+ "n": 6,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -2560,7 +2608,7 @@
"p75_sec": 1050.0
},
"h3|t2v|standard_5s|124.0|M5 Max|128.0|best": {
- "n": 17,
+ "n": 18,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -2632,13 +2680,13 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|121.0|M4 Pro|48.0|any": {
- "n": 17,
+ "n": 19,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 600.0
+ "p75_sec": 510.0
},
"ltx|a2v|balanced|121.0|M4|32.0|any": {
- "n": 51,
+ "n": 54,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -2650,9 +2698,9 @@
"p75_sec": 105.0
},
"ltx|a2v|balanced|129.0|M4 Pro|48.0|any": {
- "n": 5,
+ "n": 6,
"p25_sec": 420.0,
- "p50_sec": 420.0,
+ "p50_sec": 510.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|129.0|M5 Max|128.0|any": {
@@ -2662,10 +2710,10 @@
"p75_sec": 105.0
},
"ltx|a2v|balanced|137.0|M4 Pro|48.0|any": {
- "n": 4,
- "p25_sec": 390.0,
+ "n": 6,
+ "p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 465.0
+ "p75_sec": 420.0
},
"ltx|a2v|balanced|137.0|M5 Max|128.0|any": {
"n": 10,
@@ -2674,10 +2722,16 @@
"p75_sec": 120.0
},
"ltx|a2v|balanced|145.0|M4 Pro|48.0|any": {
- "n": 10,
+ "n": 12,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 555.0
+ "p75_sec": 600.0
+ },
+ "ltx|a2v|balanced|145.0|M4|32.0|any": {
+ "n": 5,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
},
"ltx|a2v|balanced|145.0|M5 Max|128.0|any": {
"n": 4,
@@ -2692,7 +2746,7 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|153.0|M4 Pro|48.0|any": {
- "n": 5,
+ "n": 8,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -2716,7 +2770,7 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|169.0|M4|32.0|any": {
- "n": 8,
+ "n": 12,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -2728,27 +2782,27 @@
"p75_sec": 120.0
},
"ltx|a2v|balanced|177.0|M4 Pro|48.0|any": {
- "n": 4,
+ "n": 6,
"p25_sec": 420.0,
- "p50_sec": 420.0,
- "p75_sec": 465.0
+ "p50_sec": 510.0,
+ "p75_sec": 600.0
},
"ltx|a2v|balanced|193.0|M4 Pro|48.0|any": {
- "n": 5,
+ "n": 8,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 600.0
+ "p75_sec": 900.0
},
"ltx|a2v|balanced|193.0|M4|32.0|any": {
- "n": 4,
+ "n": 8,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|201.0|M4 Pro|48.0|any": {
- "n": 4,
+ "n": 8,
"p25_sec": 600.0,
- "p50_sec": 750.0,
+ "p50_sec": 600.0,
"p75_sec": 900.0
},
"ltx|a2v|balanced|209.0|M4 Pro|48.0|any": {
@@ -2769,6 +2823,12 @@
"p50_sec": 900.0,
"p75_sec": 900.0
},
+ "ltx|a2v|balanced|241.0|M4|32.0|any": {
+ "n": 3,
+ "p25_sec": 900.0,
+ "p50_sec": 900.0,
+ "p75_sec": 900.0
+ },
"ltx|a2v|balanced|49.0|M4|32.0|any": {
"n": 9,
"p25_sec": 300.0,
@@ -2812,10 +2872,10 @@
"p75_sec": 300.0
},
"ltx|a2v|balanced|73.0|M5 Max|128.0|any": {
- "n": 3,
- "p25_sec": 37.5,
+ "n": 5,
+ "p25_sec": 45.0,
"p50_sec": 45.0,
- "p75_sec": 45.0
+ "p75_sec": 420.0
},
"ltx|a2v|balanced|73.0|M5 Pro|48.0|any": {
"n": 8,
@@ -2883,6 +2943,12 @@
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|a2v|high|121.0|M1 Pro|16.0|any": {
+ "n": 3,
+ "p25_sec": 330.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|a2v|high|121.0|M1 Ultra|64.0|any": {
"n": 6,
"p25_sec": 240.0,
@@ -2974,10 +3040,10 @@
"p75_sec": 1800.0
},
"ltx|a2v|high|169.0|M1 Pro|16.0|any": {
- "n": 6,
- "p25_sec": 330.0,
+ "n": 8,
+ "p25_sec": 390.0,
"p50_sec": 420.0,
- "p75_sec": 420.0
+ "p75_sec": 465.0
},
"ltx|a2v|high|169.0|M2 Max|96.0|any": {
"n": 7,
@@ -3040,10 +3106,10 @@
"p75_sec": 420.0
},
"ltx|a2v|high|193.0|M1 Pro|16.0|any": {
- "n": 16,
+ "n": 23,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 465.0
+ "p75_sec": 600.0
},
"ltx|a2v|high|193.0|M4 Pro|48.0|any": {
"n": 5,
@@ -3052,8 +3118,8 @@
"p75_sec": 1800.0
},
"ltx|a2v|high|193.0|M5 Pro|48.0|any": {
- "n": 8,
- "p25_sec": 390.0,
+ "n": 15,
+ "p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
@@ -3064,7 +3130,7 @@
"p75_sec": 900.0
},
"ltx|a2v|high|217.0|M1 Pro|16.0|any": {
- "n": 17,
+ "n": 28,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -3088,8 +3154,8 @@
"p75_sec": 900.0
},
"ltx|a2v|high|241.0|M1 Pro|16.0|any": {
- "n": 5,
- "p25_sec": 420.0,
+ "n": 8,
+ "p25_sec": 555.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -3184,7 +3250,7 @@
"p75_sec": 2400.0
},
"ltx|a2v|high|433.0|M4 Pro|24.0|any": {
- "n": 70,
+ "n": 76,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1800.0
@@ -3238,7 +3304,13 @@
"p75_sec": 900.0
},
"ltx|a2v|high|721.0|M2 Max|64.0|any": {
- "n": 6,
+ "n": 9,
+ "p25_sec": 1200.0,
+ "p50_sec": 1200.0,
+ "p75_sec": 1200.0
+ },
+ "ltx|a2v|high|73.0|M1 Max|64.0|any": {
+ "n": 5,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -3489,6 +3561,12 @@
"p50_sec": 5400.0,
"p75_sec": 5400.0
},
+ "ltx|extend|balanced|241.0|M4 Pro|64.0|any": {
+ "n": 4,
+ "p25_sec": 1800.0,
+ "p50_sec": 1800.0,
+ "p75_sec": 1800.0
+ },
"ltx|extend|high|121.0|M5 Max|128.0|any": {
"n": 3,
"p25_sec": 1050.0,
@@ -3526,11 +3604,17 @@
"p75_sec": 90.0
},
"ltx|i2v|balanced|105.0|M4 Pro|48.0|any": {
- "n": 4,
- "p25_sec": 285.0,
+ "n": 5,
+ "p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|i2v|balanced|113.0|M2 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|113.0|M4 Max|36.0|any": {
"n": 18,
"p25_sec": 120.0,
@@ -3544,13 +3628,13 @@
"p75_sec": 60.0
},
"ltx|i2v|balanced|121.0|M1 Max|32.0|any": {
- "n": 43,
+ "n": 44,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|i2v|balanced|121.0|M1 Max|64.0|any": {
- "n": 301,
+ "n": 303,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -3592,13 +3676,13 @@
"p75_sec": 600.0
},
"ltx|i2v|balanced|121.0|M2 Max|32.0|any": {
- "n": 142,
+ "n": 143,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
},
"ltx|i2v|balanced|121.0|M2 Max|64.0|any": {
- "n": 111,
+ "n": 117,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -3634,8 +3718,8 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M2|16.0|any": {
- "n": 8,
- "p25_sec": 825.0,
+ "n": 10,
+ "p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 900.0
},
@@ -3652,7 +3736,7 @@
"p75_sec": 330.0
},
"ltx|i2v|balanced|121.0|M3 Max|36.0|any": {
- "n": 41,
+ "n": 46,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
@@ -3670,8 +3754,8 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|121.0|M3 Pro|18.0|any": {
- "n": 15,
- "p25_sec": 270.0,
+ "n": 17,
+ "p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
},
@@ -3694,10 +3778,10 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M3|16.0|any": {
- "n": 5,
+ "n": 6,
"p25_sec": 420.0,
- "p50_sec": 420.0,
- "p75_sec": 600.0
+ "p50_sec": 510.0,
+ "p75_sec": 825.0
},
"ltx|i2v|balanced|121.0|M3|24.0|any": {
"n": 3,
@@ -3712,7 +3796,7 @@
"p75_sec": 420.0
},
"ltx|i2v|balanced|121.0|M4 Max|36.0|any": {
- "n": 381,
+ "n": 383,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -3730,7 +3814,7 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|121.0|M4 Pro|24.0|any": {
- "n": 142,
+ "n": 151,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -3748,8 +3832,8 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|121.0|M4|16.0|any": {
- "n": 89,
- "p25_sec": 300.0,
+ "n": 104,
+ "p25_sec": 390.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -3772,19 +3856,19 @@
"p75_sec": 90.0
},
"ltx|i2v|balanced|121.0|M5 Max|36.0|any": {
- "n": 3,
- "p25_sec": 52.5,
+ "n": 5,
+ "p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 60.0
},
"ltx|i2v|balanced|121.0|M5 Max|48.0|any": {
- "n": 12,
+ "n": 14,
"p25_sec": 60.0,
"p50_sec": 90.0,
- "p75_sec": 97.5
+ "p75_sec": 90.0
},
"ltx|i2v|balanced|121.0|M5 Max|64.0|any": {
- "n": 73,
+ "n": 76,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 60.0
@@ -3802,13 +3886,13 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M5 Pro|64.0|any": {
- "n": 178,
+ "n": 179,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M5|16.0|any": {
- "n": 31,
+ "n": 33,
"p25_sec": 180.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -3831,6 +3915,12 @@
"p50_sec": 120.0,
"p75_sec": 120.0
},
+ "ltx|i2v|balanced|137.0|M4 Pro|48.0|any": {
+ "n": 4,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|145.0|M3 Max|64.0|any": {
"n": 131,
"p25_sec": 240.0,
@@ -3844,7 +3934,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|145.0|M4 Pro|48.0|any": {
- "n": 102,
+ "n": 107,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -3868,7 +3958,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|161.0|M4 Pro|48.0|any": {
- "n": 3,
+ "n": 9,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -3916,7 +4006,7 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|169.0|M2 Ultra|64.0|any": {
- "n": 55,
+ "n": 118,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -3928,10 +4018,10 @@
"p75_sec": 1200.0
},
"ltx|i2v|balanced|169.0|M3 Max|36.0|any": {
- "n": 7,
- "p25_sec": 210.0,
+ "n": 8,
+ "p25_sec": 225.0,
"p50_sec": 240.0,
- "p75_sec": 270.0
+ "p75_sec": 300.0
},
"ltx|i2v|balanced|169.0|M3 Max|64.0|any": {
"n": 76,
@@ -3970,13 +4060,13 @@
"p75_sec": 240.0
},
"ltx|i2v|balanced|169.0|M4 Pro|24.0|any": {
- "n": 8,
+ "n": 11,
"p25_sec": 180.0,
"p50_sec": 180.0,
- "p75_sec": 285.0
+ "p75_sec": 300.0
},
"ltx|i2v|balanced|169.0|M4 Pro|48.0|any": {
- "n": 55,
+ "n": 61,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -3988,10 +4078,10 @@
"p75_sec": 600.0
},
"ltx|i2v|balanced|169.0|M4|16.0|any": {
- "n": 5,
+ "n": 7,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 900.0
+ "p75_sec": 1050.0
},
"ltx|i2v|balanced|169.0|M4|24.0|any": {
"n": 106,
@@ -4041,6 +4131,12 @@
"p50_sec": 180.0,
"p75_sec": 300.0
},
+ "ltx|i2v|balanced|177.0|M4 Pro|48.0|any": {
+ "n": 7,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|balanced|177.0|M5 Pro|64.0|any": {
"n": 3,
"p25_sec": 300.0,
@@ -4054,8 +4150,8 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|185.0|M4 Pro|48.0|any": {
- "n": 4,
- "p25_sec": 555.0,
+ "n": 18,
+ "p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -4084,7 +4180,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|193.0|M4 Pro|48.0|any": {
- "n": 131,
+ "n": 145,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -4101,8 +4197,14 @@
"p50_sec": 105.0,
"p75_sec": 120.0
},
+ "ltx|i2v|balanced|201.0|M4 Pro|48.0|any": {
+ "n": 11,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|balanced|217.0|M4 Pro|48.0|any": {
- "n": 7,
+ "n": 14,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -4120,7 +4222,7 @@
"p75_sec": 390.0
},
"ltx|i2v|balanced|241.0|M1 Max|64.0|any": {
- "n": 97,
+ "n": 99,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -4186,16 +4288,16 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|241.0|M2 Ultra|64.0|any": {
- "n": 7,
+ "n": 8,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
"ltx|i2v|balanced|241.0|M2|16.0|any": {
- "n": 12,
+ "n": 18,
"p25_sec": 1800.0,
"p50_sec": 1800.0,
- "p75_sec": 1950.0
+ "p75_sec": 2400.0
},
"ltx|i2v|balanced|241.0|M3 Max|128.0|any": {
"n": 33,
@@ -4204,7 +4306,7 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|241.0|M3 Max|36.0|any": {
- "n": 9,
+ "n": 10,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -4246,13 +4348,13 @@
"p75_sec": 1200.0
},
"ltx|i2v|balanced|241.0|M4 Max|128.0|any": {
- "n": 24,
+ "n": 25,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 600.0
},
"ltx|i2v|balanced|241.0|M4 Max|36.0|any": {
- "n": 48,
+ "n": 52,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -4270,7 +4372,7 @@
"p75_sec": 420.0
},
"ltx|i2v|balanced|241.0|M4 Pro|24.0|any": {
- "n": 395,
+ "n": 434,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -4282,13 +4384,13 @@
"p75_sec": 900.0
},
"ltx|i2v|balanced|241.0|M4 Pro|64.0|any": {
- "n": 32,
+ "n": 59,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|i2v|balanced|241.0|M4|16.0|any": {
- "n": 109,
+ "n": 110,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 1200.0
@@ -4318,16 +4420,16 @@
"p75_sec": 240.0
},
"ltx|i2v|balanced|241.0|M5 Max|64.0|any": {
- "n": 17,
+ "n": 18,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
},
"ltx|i2v|balanced|241.0|M5 Pro|24.0|any": {
- "n": 49,
+ "n": 51,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 120.0
+ "p75_sec": 150.0
},
"ltx|i2v|balanced|241.0|M5 Pro|48.0|any": {
"n": 428,
@@ -4480,7 +4582,7 @@
"p75_sec": 420.0
},
"ltx|i2v|balanced|481.0|M5|24.0|any": {
- "n": 16,
+ "n": 17,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -4546,10 +4648,10 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|65.0|M2 Max|64.0|any": {
- "n": 3,
- "p25_sec": 300.0,
+ "n": 7,
+ "p25_sec": 270.0,
"p50_sec": 300.0,
- "p75_sec": 450.0
+ "p75_sec": 300.0
},
"ltx|i2v|balanced|65.0|M4 Max|36.0|any": {
"n": 33,
@@ -4660,7 +4762,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|73.0|M4 Pro|48.0|any": {
- "n": 33,
+ "n": 34,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -4702,8 +4804,8 @@
"p75_sec": 90.0
},
"ltx|i2v|balanced|73.0|M5 Pro|64.0|any": {
- "n": 16,
- "p25_sec": 120.0,
+ "n": 22,
+ "p25_sec": 90.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
@@ -4731,12 +4833,24 @@
"p50_sec": 60.0,
"p75_sec": 60.0
},
+ "ltx|i2v|balanced|89.0|M2 Max|64.0|any": {
+ "n": 5,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|89.0|M4 Max|36.0|any": {
"n": 46,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
+ "ltx|i2v|balanced|97.0|M2 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|97.0|M3 Ultra|512.0|any": {
"n": 19,
"p25_sec": 180.0,
@@ -4744,7 +4858,7 @@
"p75_sec": 270.0
},
"ltx|i2v|balanced|97.0|M4 Max|36.0|any": {
- "n": 34,
+ "n": 37,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
@@ -4756,7 +4870,7 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|97.0|M4 Pro|48.0|any": {
- "n": 7,
+ "n": 10,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -4792,7 +4906,7 @@
"p75_sec": 120.0
},
"ltx|i2v|high_720p|121.0|M3 Ultra|96.0|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -4846,7 +4960,7 @@
"p75_sec": 420.0
},
"ltx|i2v|high|121.0|M2 Ultra|64.0|any": {
- "n": 11,
+ "n": 14,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -4882,10 +4996,10 @@
"p75_sec": 420.0
},
"ltx|i2v|high|121.0|M4 Max|48.0|any": {
- "n": 3,
+ "n": 4,
"p25_sec": 300.0,
"p50_sec": 300.0,
- "p75_sec": 360.0
+ "p75_sec": 330.0
},
"ltx|i2v|high|121.0|M4 Max|64.0|any": {
"n": 42,
@@ -4942,10 +5056,10 @@
"p75_sec": 600.0
},
"ltx|i2v|high|169.0|M4 Max|48.0|any": {
- "n": 5,
+ "n": 6,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 600.0
+ "p75_sec": 555.0
},
"ltx|i2v|high|169.0|M4 Max|64.0|any": {
"n": 9,
@@ -5044,7 +5158,7 @@
"p75_sec": 600.0
},
"ltx|i2v|high|241.0|M4 Pro|48.0|any": {
- "n": 12,
+ "n": 14,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -5062,7 +5176,7 @@
"p75_sec": 300.0
},
"ltx|i2v|high|241.0|M5 Max|64.0|any": {
- "n": 7,
+ "n": 9,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -5182,7 +5296,7 @@
"p75_sec": 180.0
},
"ltx|i2v|quick|113.0|M1 Max|64.0|any": {
- "n": 13,
+ "n": 14,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -5206,7 +5320,7 @@
"p75_sec": 255.0
},
"ltx|i2v|quick|121.0|M1 Max|64.0|any": {
- "n": 25,
+ "n": 28,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -5296,7 +5410,7 @@
"p75_sec": 180.0
},
"ltx|i2v|quick|121.0|M4|16.0|any": {
- "n": 23,
+ "n": 24,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 900.0
@@ -5349,8 +5463,14 @@
"p50_sec": 600.0,
"p75_sec": 600.0
},
+ "ltx|i2v|quick|129.0|M1 Max|64.0|any": {
+ "n": 6,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 210.0
+ },
"ltx|i2v|quick|129.0|M2 Ultra|64.0|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 60.0
@@ -5361,6 +5481,12 @@
"p50_sec": 60.0,
"p75_sec": 60.0
},
+ "ltx|i2v|quick|137.0|M1 Max|64.0|any": {
+ "n": 22,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 120.0
+ },
"ltx|i2v|quick|145.0|M1 Max|64.0|any": {
"n": 14,
"p25_sec": 240.0,
@@ -5620,9 +5746,9 @@
"p75_sec": 330.0
},
"ltx|i2v|quick|481.0|M4|16.0|any": {
- "n": 14,
+ "n": 17,
"p25_sec": 600.0,
- "p50_sec": 750.0,
+ "p50_sec": 900.0,
"p75_sec": 900.0
},
"ltx|i2v|quick|481.0|M5 Max|128.0|any": {
@@ -5740,10 +5866,10 @@
"p75_sec": 60.0
},
"ltx|i2v|quick|73.0|M3 Ultra|96.0|any": {
- "n": 4,
- "p25_sec": 41.2,
- "p50_sec": 67.5,
- "p75_sec": 90.0
+ "n": 6,
+ "p25_sec": 30.0,
+ "p50_sec": 37.5,
+ "p75_sec": 78.8
},
"ltx|i2v|quick|73.0|M4 Max|128.0|any": {
"n": 4,
@@ -5823,6 +5949,12 @@
"p50_sec": 90.0,
"p75_sec": 105.0
},
+ "ltx|i2v|quick|81.0|M1 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 105.0,
+ "p50_sec": 120.0,
+ "p75_sec": 120.0
+ },
"ltx|i2v|quick|81.0|M5 Pro|24.0|any": {
"n": 5,
"p25_sec": 45.0,
@@ -5835,6 +5967,12 @@
"p50_sec": 150.0,
"p75_sec": 180.0
},
+ "ltx|i2v|quick|89.0|M1 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 135.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|i2v|quick|89.0|M5 Pro|24.0|any": {
"n": 3,
"p25_sec": 45.0,
@@ -5865,15 +6003,21 @@
"p50_sec": 15.0,
"p75_sec": 15.0
},
+ "ltx|i2v|standard|113.0|M1 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 240.0,
+ "p50_sec": 240.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|standard|121.0|M1 Max|32.0|any": {
- "n": 262,
+ "n": 267,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
"ltx|i2v|standard|121.0|M1 Max|64.0|any": {
- "n": 13,
- "p25_sec": 420.0,
+ "n": 20,
+ "p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
@@ -5896,7 +6040,7 @@
"p75_sec": 2025.0
},
"ltx|i2v|standard|121.0|M2 Max|32.0|any": {
- "n": 19,
+ "n": 20,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -5914,16 +6058,16 @@
"p75_sec": 300.0
},
"ltx|i2v|standard|121.0|M2 Ultra|64.0|any": {
- "n": 42,
+ "n": 43,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
},
"ltx|i2v|standard|121.0|M3 Max|36.0|any": {
- "n": 11,
+ "n": 14,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 180.0
+ "p75_sec": 165.0
},
"ltx|i2v|standard|121.0|M3 Max|48.0|any": {
"n": 12,
@@ -5944,8 +6088,8 @@
"p75_sec": 420.0
},
"ltx|i2v|standard|121.0|M3 Ultra|512.0|any": {
- "n": 56,
- "p25_sec": 225.0,
+ "n": 57,
+ "p25_sec": 180.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -5962,7 +6106,7 @@
"p75_sec": 120.0
},
"ltx|i2v|standard|121.0|M4 Max|48.0|any": {
- "n": 75,
+ "n": 89,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -5980,43 +6124,43 @@
"p75_sec": 240.0
},
"ltx|i2v|standard|121.0|M4 Pro|48.0|any": {
- "n": 103,
+ "n": 105,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
"ltx|i2v|standard|121.0|M4|16.0|any": {
- "n": 14,
+ "n": 16,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|i2v|standard|121.0|M4|24.0|any": {
- "n": 21,
+ "n": 22,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
},
"ltx|i2v|standard|121.0|M5 Max|128.0|any": {
- "n": 84,
- "p25_sec": 90.0,
+ "n": 93,
+ "p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|i2v|standard|121.0|M5 Max|36.0|any": {
- "n": 35,
- "p25_sec": 60.0,
+ "n": 106,
+ "p25_sec": 45.0,
"p50_sec": 60.0,
"p75_sec": 60.0
},
"ltx|i2v|standard|121.0|M5 Max|48.0|any": {
- "n": 8,
- "p25_sec": 56.2,
- "p50_sec": 75.0,
- "p75_sec": 97.5
+ "n": 13,
+ "p25_sec": 60.0,
+ "p50_sec": 60.0,
+ "p75_sec": 90.0
},
"ltx|i2v|standard|121.0|M5 Max|64.0|any": {
- "n": 20,
+ "n": 24,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -6034,15 +6178,15 @@
"p75_sec": 180.0
},
"ltx|i2v|standard|121.0|M5 Pro|64.0|any": {
- "n": 63,
+ "n": 70,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 240.0
},
"ltx|i2v|standard|121.0|M5|16.0|any": {
- "n": 17,
+ "n": 18,
"p25_sec": 420.0,
- "p50_sec": 600.0,
+ "p50_sec": 510.0,
"p75_sec": 600.0
},
"ltx|i2v|standard|121.0|M5|24.0|any": {
@@ -6057,6 +6201,24 @@
"p50_sec": 120.0,
"p75_sec": 240.0
},
+ "ltx|i2v|standard|129.0|M1 Max|64.0|any": {
+ "n": 11,
+ "p25_sec": 240.0,
+ "p50_sec": 240.0,
+ "p75_sec": 420.0
+ },
+ "ltx|i2v|standard|129.0|M5 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 60.0,
+ "p50_sec": 60.0,
+ "p75_sec": 60.0
+ },
+ "ltx|i2v|standard|137.0|M1 Max|64.0|any": {
+ "n": 51,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|standard|137.0|M4 Max|64.0|any": {
"n": 4,
"p25_sec": 120.0,
@@ -6142,11 +6304,17 @@
"p75_sec": 240.0
},
"ltx|i2v|standard|169.0|M2 Ultra|64.0|any": {
- "n": 99,
+ "n": 100,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|i2v|standard|169.0|M2|16.0|any": {
+ "n": 8,
+ "p25_sec": 825.0,
+ "p50_sec": 900.0,
+ "p75_sec": 900.0
+ },
"ltx|i2v|standard|169.0|M3 Pro|18.0|any": {
"n": 3,
"p25_sec": 510.0,
@@ -6184,7 +6352,7 @@
"p75_sec": 300.0
},
"ltx|i2v|standard|169.0|M4 Pro|24.0|any": {
- "n": 58,
+ "n": 59,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -6196,7 +6364,7 @@
"p75_sec": 420.0
},
"ltx|i2v|standard|169.0|M4|16.0|any": {
- "n": 21,
+ "n": 23,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -6220,7 +6388,7 @@
"p75_sec": 120.0
},
"ltx|i2v|standard|169.0|M5 Max|64.0|any": {
- "n": 132,
+ "n": 154,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -6358,7 +6526,7 @@
"p75_sec": 300.0
},
"ltx|i2v|standard|241.0|M2 Ultra|64.0|any": {
- "n": 86,
+ "n": 90,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -6370,7 +6538,7 @@
"p75_sec": 1800.0
},
"ltx|i2v|standard|241.0|M3 Max|36.0|any": {
- "n": 8,
+ "n": 10,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -6394,16 +6562,16 @@
"p75_sec": 420.0
},
"ltx|i2v|standard|241.0|M4 Max|128.0|any": {
- "n": 17,
- "p25_sec": 900.0,
+ "n": 18,
+ "p25_sec": 675.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"ltx|i2v|standard|241.0|M4 Max|36.0|any": {
- "n": 42,
+ "n": 43,
"p25_sec": 180.0,
"p50_sec": 180.0,
- "p75_sec": 225.0
+ "p75_sec": 240.0
},
"ltx|i2v|standard|241.0|M4 Max|48.0|any": {
"n": 66,
@@ -6424,7 +6592,7 @@
"p75_sec": 300.0
},
"ltx|i2v|standard|241.0|M4 Pro|48.0|any": {
- "n": 51,
+ "n": 59,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -6442,7 +6610,7 @@
"p75_sec": 600.0
},
"ltx|i2v|standard|241.0|M4|32.0|any": {
- "n": 339,
+ "n": 357,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -6466,7 +6634,7 @@
"p75_sec": 180.0
},
"ltx|i2v|standard|241.0|M5 Max|64.0|any": {
- "n": 60,
+ "n": 64,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -6490,7 +6658,7 @@
"p75_sec": 600.0
},
"ltx|i2v|standard|241.0|M5|16.0|any": {
- "n": 145,
+ "n": 157,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -6531,6 +6699,12 @@
"p50_sec": 600.0,
"p75_sec": 600.0
},
+ "ltx|i2v|standard|289.0|M4 Max|36.0|any": {
+ "n": 3,
+ "p25_sec": 180.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|i2v|standard|289.0|M4 Pro|48.0|any": {
"n": 5,
"p25_sec": 420.0,
@@ -6615,6 +6789,12 @@
"p50_sec": 60.0,
"p75_sec": 90.0
},
+ "ltx|i2v|standard|49.0|M5 Max|36.0|any": {
+ "n": 3,
+ "p25_sec": 30.0,
+ "p50_sec": 30.0,
+ "p75_sec": 30.0
+ },
"ltx|i2v|standard|73.0|M1 Max|32.0|any": {
"n": 27,
"p25_sec": 180.0,
@@ -6670,7 +6850,7 @@
"p75_sec": 120.0
},
"ltx|i2v|standard|73.0|M4 Pro|48.0|any": {
- "n": 34,
+ "n": 41,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -6694,9 +6874,9 @@
"p75_sec": 240.0
},
"ltx|i2v|standard|73.0|M5 Max|128.0|any": {
- "n": 169,
+ "n": 215,
"p25_sec": 60.0,
- "p50_sec": 60.0,
+ "p50_sec": 90.0,
"p75_sec": 120.0
},
"ltx|i2v|standard|73.0|M5 Max|48.0|any": {
@@ -6705,6 +6885,12 @@
"p50_sec": 45.0,
"p75_sec": 45.0
},
+ "ltx|i2v|standard|73.0|M5 Max|64.0|any": {
+ "n": 6,
+ "p25_sec": 30.0,
+ "p50_sec": 30.0,
+ "p75_sec": 41.2
+ },
"ltx|i2v|standard|73.0|M5 Pro|48.0|any": {
"n": 15,
"p25_sec": 60.0,
@@ -6723,6 +6909,12 @@
"p50_sec": 420.0,
"p75_sec": 1110.0
},
+ "ltx|i2v|standard|81.0|M1 Max|64.0|any": {
+ "n": 4,
+ "p25_sec": 180.0,
+ "p50_sec": 240.0,
+ "p75_sec": 330.0
+ },
"ltx|i2v|standard|81.0|M5 Max|48.0|any": {
"n": 25,
"p25_sec": 45.0,
@@ -6735,6 +6927,12 @@
"p50_sec": 45.0,
"p75_sec": 45.0
},
+ "ltx|i2v|standard|89.0|M1 Max|64.0|any": {
+ "n": 5,
+ "p25_sec": 180.0,
+ "p50_sec": 300.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|standard|89.0|M5 Max|128.0|any": {
"n": 4,
"p25_sec": 60.0,
@@ -6915,6 +7113,12 @@
"p50_sec": 900.0,
"p75_sec": 1050.0
},
+ "ltx|keyframe|balanced|241.0|M5 Max|128.0|any": {
+ "n": 4,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
"ltx|keyframe|balanced|241.0|M5 Pro|48.0|any": {
"n": 4,
"p25_sec": 420.0,
@@ -7204,7 +7408,7 @@
"p75_sec": 90.0
},
"ltx|t2v|balanced|121.0|M1 Max|32.0|any": {
- "n": 104,
+ "n": 105,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -7216,7 +7420,7 @@
"p75_sec": 300.0
},
"ltx|t2v|balanced|121.0|M1 Pro|16.0|any": {
- "n": 78,
+ "n": 79,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -7264,7 +7468,7 @@
"p75_sec": 240.0
},
"ltx|t2v|balanced|121.0|M2 Max|96.0|any": {
- "n": 83,
+ "n": 92,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -7348,13 +7552,13 @@
"p75_sec": 240.0
},
"ltx|t2v|balanced|121.0|M3 Ultra|256.0|any": {
- "n": 20,
+ "n": 22,
"p25_sec": 60.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
"ltx|t2v|balanced|121.0|M3 Ultra|512.0|any": {
- "n": 57,
+ "n": 61,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 120.0
@@ -7396,13 +7600,13 @@
"p75_sec": 180.0
},
"ltx|t2v|balanced|121.0|M4 Max|64.0|any": {
- "n": 527,
+ "n": 530,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|t2v|balanced|121.0|M4 Pro|24.0|any": {
- "n": 213,
+ "n": 217,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -7444,8 +7648,8 @@
"p75_sec": 75.0
},
"ltx|t2v|balanced|121.0|M5 Max|36.0|any": {
- "n": 3,
- "p25_sec": 52.5,
+ "n": 5,
+ "p25_sec": 45.0,
"p50_sec": 60.0,
"p75_sec": 60.0
},
@@ -7456,7 +7660,7 @@
"p75_sec": 120.0
},
"ltx|t2v|balanced|121.0|M5 Max|64.0|any": {
- "n": 53,
+ "n": 84,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 90.0
@@ -7468,13 +7672,13 @@
"p75_sec": 90.0
},
"ltx|t2v|balanced|121.0|M5 Pro|48.0|any": {
- "n": 84,
+ "n": 85,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|t2v|balanced|121.0|M5 Pro|64.0|any": {
- "n": 104,
+ "n": 105,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 120.0
@@ -7564,8 +7768,8 @@
"p75_sec": 465.0
},
"ltx|t2v|balanced|169.0|M2 Max|96.0|any": {
- "n": 10,
- "p25_sec": 300.0,
+ "n": 12,
+ "p25_sec": 285.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
@@ -7588,10 +7792,10 @@
"p75_sec": 975.0
},
"ltx|t2v|balanced|169.0|M4 Max|36.0|any": {
- "n": 6,
+ "n": 8,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 165.0
+ "p75_sec": 180.0
},
"ltx|t2v|balanced|169.0|M4 Max|64.0|any": {
"n": 32,
@@ -7606,8 +7810,8 @@
"p75_sec": 420.0
},
"ltx|t2v|balanced|169.0|M4 Pro|48.0|any": {
- "n": 19,
- "p25_sec": 360.0,
+ "n": 25,
+ "p25_sec": 180.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
@@ -7623,6 +7827,12 @@
"p50_sec": 120.0,
"p75_sec": 120.0
},
+ "ltx|t2v|balanced|169.0|M5 Max|64.0|any": {
+ "n": 3,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 150.0
+ },
"ltx|t2v|balanced|169.0|M5 Pro|24.0|any": {
"n": 41,
"p25_sec": 90.0,
@@ -7636,7 +7846,7 @@
"p75_sec": 180.0
},
"ltx|t2v|balanced|169.0|M5 Pro|64.0|any": {
- "n": 5,
+ "n": 9,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -7726,9 +7936,9 @@
"p75_sec": 420.0
},
"ltx|t2v|balanced|241.0|M2 Max|96.0|any": {
- "n": 12,
- "p25_sec": 180.0,
- "p50_sec": 360.0,
+ "n": 16,
+ "p25_sec": 270.0,
+ "p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|t2v|balanced|241.0|M2 Pro|32.0|any": {
@@ -7738,7 +7948,7 @@
"p75_sec": 810.0
},
"ltx|t2v|balanced|241.0|M2|16.0|any": {
- "n": 7,
+ "n": 8,
"p25_sec": 1800.0,
"p50_sec": 1800.0,
"p75_sec": 1800.0
@@ -7774,10 +7984,10 @@
"p75_sec": 900.0
},
"ltx|t2v|balanced|241.0|M4 Max|36.0|any": {
- "n": 20,
+ "n": 21,
"p25_sec": 180.0,
- "p50_sec": 210.0,
- "p75_sec": 375.0
+ "p50_sec": 240.0,
+ "p75_sec": 300.0
},
"ltx|t2v|balanced|241.0|M4 Max|48.0|any": {
"n": 211,
@@ -7792,7 +8002,7 @@
"p75_sec": 390.0
},
"ltx|t2v|balanced|241.0|M4 Pro|24.0|any": {
- "n": 80,
+ "n": 81,
"p25_sec": 300.0,
"p50_sec": 600.0,
"p75_sec": 900.0
@@ -7810,9 +8020,9 @@
"p75_sec": 600.0
},
"ltx|t2v|balanced|241.0|M4|16.0|any": {
- "n": 34,
+ "n": 44,
"p25_sec": 900.0,
- "p50_sec": 1200.0,
+ "p50_sec": 900.0,
"p75_sec": 1200.0
},
"ltx|t2v|balanced|241.0|M4|24.0|any": {
@@ -7827,6 +8037,12 @@
"p50_sec": 180.0,
"p75_sec": 180.0
},
+ "ltx|t2v|balanced|241.0|M5 Max|36.0|any": {
+ "n": 3,
+ "p25_sec": 345.0,
+ "p50_sec": 600.0,
+ "p75_sec": 1200.0
+ },
"ltx|t2v|balanced|241.0|M5 Max|48.0|any": {
"n": 9,
"p25_sec": 120.0,
@@ -7839,6 +8055,12 @@
"p50_sec": 180.0,
"p75_sec": 285.0
},
+ "ltx|t2v|balanced|241.0|M5 Pro|24.0|any": {
+ "n": 3,
+ "p25_sec": 150.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|t2v|balanced|241.0|M5 Pro|48.0|any": {
"n": 19,
"p25_sec": 240.0,
@@ -7846,10 +8068,10 @@
"p75_sec": 300.0
},
"ltx|t2v|balanced|241.0|M5 Pro|64.0|any": {
- "n": 13,
- "p25_sec": 300.0,
+ "n": 14,
+ "p25_sec": 255.0,
"p50_sec": 300.0,
- "p75_sec": 900.0
+ "p75_sec": 750.0
},
"ltx|t2v|balanced|241.0|M5|16.0|any": {
"n": 25,
@@ -7972,13 +8194,13 @@
"p75_sec": 180.0
},
"ltx|t2v|balanced|73.0|M2 Max|64.0|any": {
- "n": 14,
+ "n": 17,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|t2v|balanced|73.0|M2 Max|96.0|any": {
- "n": 16,
+ "n": 20,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -8032,7 +8254,7 @@
"p75_sec": 120.0
},
"ltx|t2v|balanced|73.0|M4 Pro|48.0|any": {
- "n": 45,
+ "n": 48,
"p25_sec": 90.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -8056,10 +8278,10 @@
"p75_sec": 45.0
},
"ltx|t2v|balanced|73.0|M5 Pro|24.0|any": {
- "n": 4,
- "p25_sec": 41.2,
+ "n": 5,
+ "p25_sec": 45.0,
"p50_sec": 45.0,
- "p75_sec": 48.8
+ "p75_sec": 45.0
},
"ltx|t2v|balanced|73.0|M5 Pro|48.0|any": {
"n": 7,
@@ -8068,9 +8290,9 @@
"p75_sec": 60.0
},
"ltx|t2v|balanced|73.0|M5 Pro|64.0|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 60.0,
- "p50_sec": 75.0,
+ "p50_sec": 60.0,
"p75_sec": 90.0
},
"ltx|t2v|balanced|73.0|M5|24.0|any": {
@@ -8200,9 +8422,9 @@
"p75_sec": 420.0
},
"ltx|t2v|high|121.0|M2 Max|96.0|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 300.0,
- "p50_sec": 360.0,
+ "p50_sec": 300.0,
"p75_sec": 420.0
},
"ltx|t2v|high|121.0|M2 Ultra|64.0|any": {
@@ -8224,9 +8446,9 @@
"p75_sec": 900.0
},
"ltx|t2v|high|121.0|M4 Max|64.0|any": {
- "n": 14,
- "p25_sec": 300.0,
- "p50_sec": 420.0,
+ "n": 16,
+ "p25_sec": 240.0,
+ "p50_sec": 360.0,
"p75_sec": 420.0
},
"ltx|t2v|high|121.0|M4 Pro|48.0|any": {
@@ -8254,10 +8476,10 @@
"p75_sec": 112.5
},
"ltx|t2v|high|121.0|M5 Max|64.0|any": {
- "n": 5,
+ "n": 14,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 180.0
+ "p75_sec": 120.0
},
"ltx|t2v|high|121.0|M5 Pro|48.0|any": {
"n": 7,
@@ -8313,6 +8535,12 @@
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|t2v|high|169.0|M4 Max|64.0|any": {
+ "n": 5,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|t2v|high|169.0|M4 Pro|48.0|any": {
"n": 10,
"p25_sec": 675.0,
@@ -8374,7 +8602,7 @@
"p75_sec": 1200.0
},
"ltx|t2v|high|241.0|M4 Max|64.0|any": {
- "n": 22,
+ "n": 26,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -8458,7 +8686,7 @@
"p75_sec": 240.0
},
"ltx|t2v|high|73.0|M2 Max|64.0|any": {
- "n": 8,
+ "n": 10,
"p25_sec": 240.0,
"p50_sec": 270.0,
"p75_sec": 300.0
@@ -8494,7 +8722,7 @@
"p75_sec": 300.0
},
"ltx|t2v|high|73.0|M4 Pro|48.0|any": {
- "n": 8,
+ "n": 9,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -8524,7 +8752,7 @@
"p75_sec": 240.0
},
"ltx|t2v|quick|121.0|M1 Max|64.0|any": {
- "n": 86,
+ "n": 92,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
@@ -8554,8 +8782,8 @@
"p75_sec": 75.0
},
"ltx|t2v|quick|121.0|M2 Max|32.0|any": {
- "n": 10,
- "p25_sec": 97.5,
+ "n": 12,
+ "p25_sec": 112.5,
"p50_sec": 120.0,
"p75_sec": 120.0
},
@@ -8566,7 +8794,7 @@
"p75_sec": 90.0
},
"ltx|t2v|quick|121.0|M2 Max|96.0|any": {
- "n": 5,
+ "n": 11,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
@@ -8578,10 +8806,10 @@
"p75_sec": 180.0
},
"ltx|t2v|quick|121.0|M3 Max|36.0|any": {
- "n": 7,
+ "n": 11,
"p25_sec": 120.0,
- "p50_sec": 120.0,
- "p75_sec": 180.0
+ "p50_sec": 240.0,
+ "p75_sec": 270.0
},
"ltx|t2v|quick|121.0|M3 Max|48.0|any": {
"n": 10,
@@ -8608,7 +8836,7 @@
"p75_sec": 97.5
},
"ltx|t2v|quick|121.0|M3 Ultra|96.0|any": {
- "n": 15,
+ "n": 32,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 45.0
@@ -8656,10 +8884,10 @@
"p75_sec": 180.0
},
"ltx|t2v|quick|121.0|M4|16.0|any": {
- "n": 18,
+ "n": 19,
"p25_sec": 300.0,
"p50_sec": 300.0,
- "p75_sec": 390.0
+ "p75_sec": 420.0
},
"ltx|t2v|quick|121.0|M4|24.0|any": {
"n": 13,
@@ -8721,6 +8949,12 @@
"p50_sec": 180.0,
"p75_sec": 240.0
},
+ "ltx|t2v|quick|145.0|M1 Max|64.0|any": {
+ "n": 5,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 420.0
+ },
"ltx|t2v|quick|145.0|M4 Pro|24.0|any": {
"n": 7,
"p25_sec": 180.0,
@@ -9058,15 +9292,15 @@
"p75_sec": 30.0
},
"ltx|t2v|quick|73.0|M1 Max|32.0|any": {
- "n": 14,
+ "n": 19,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|t2v|quick|73.0|M1 Max|64.0|any": {
- "n": 19,
- "p25_sec": 90.0,
- "p50_sec": 120.0,
+ "n": 20,
+ "p25_sec": 82.5,
+ "p50_sec": 105.0,
"p75_sec": 120.0
},
"ltx|t2v|quick|73.0|M1 Pro|16.0|any": {
@@ -9112,7 +9346,7 @@
"p75_sec": 120.0
},
"ltx|t2v|quick|73.0|M3 Max|48.0|any": {
- "n": 6,
+ "n": 7,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 60.0
@@ -9190,7 +9424,7 @@
"p75_sec": 30.0
},
"ltx|t2v|quick|73.0|M5 Pro|24.0|any": {
- "n": 6,
+ "n": 7,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 45.0
@@ -9220,8 +9454,8 @@
"p75_sec": 90.0
},
"ltx|t2v|quick|97.0|M1 Max|64.0|any": {
- "n": 5,
- "p25_sec": 120.0,
+ "n": 6,
+ "p25_sec": 97.5,
"p50_sec": 120.0,
"p75_sec": 120.0
},
@@ -9304,7 +9538,7 @@
"p75_sec": 810.0
},
"ltx|t2v|standard|121.0|M2 Max|32.0|any": {
- "n": 4,
+ "n": 9,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -9406,9 +9640,9 @@
"p75_sec": 330.0
},
"ltx|t2v|standard|121.0|M5 Max|128.0|any": {
- "n": 22,
+ "n": 34,
"p25_sec": 60.0,
- "p50_sec": 105.0,
+ "p50_sec": 60.0,
"p75_sec": 120.0
},
"ltx|t2v|standard|121.0|M5 Max|36.0|any": {
@@ -9424,7 +9658,7 @@
"p75_sec": 60.0
},
"ltx|t2v|standard|121.0|M5 Max|64.0|any": {
- "n": 33,
+ "n": 35,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -9550,7 +9784,7 @@
"p75_sec": 360.0
},
"ltx|t2v|standard|241.0|M1 Max|64.0|any": {
- "n": 56,
+ "n": 58,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -9622,13 +9856,13 @@
"p75_sec": 1200.0
},
"ltx|t2v|standard|241.0|M4 Max|36.0|any": {
- "n": 91,
+ "n": 96,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 300.0
},
"ltx|t2v|standard|241.0|M4 Max|48.0|any": {
- "n": 52,
+ "n": 53,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -9717,6 +9951,12 @@
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|t2v|standard|241.0|M6|24.0|any": {
+ "n": 38,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 300.0
+ },
"ltx|t2v|standard|25.0|M1 Ultra|128.0|any": {
"n": 10,
"p25_sec": 45.0,
@@ -9783,6 +10023,12 @@
"p50_sec": 120.0,
"p75_sec": 270.0
},
+ "ltx|t2v|standard|73.0|M2 Max|64.0|any": {
+ "n": 6,
+ "p25_sec": 180.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|t2v|standard|73.0|M3 Ultra|256.0|any": {
"n": 4,
"p25_sec": 90.0,
@@ -9935,10 +10181,10 @@
"p75_sec": 900.0
},
"h3|i2v|draft_10s|243.0|M3 Ultra|fast": {
- "n": 3,
- "p25_sec": 330.0,
+ "n": 13,
+ "p25_sec": 300.0,
"p50_sec": 420.0,
- "p75_sec": 510.0
+ "p75_sec": 600.0
},
"h3|i2v|draft_10s|243.0|M4 Max|best": {
"n": 18,
@@ -9952,6 +10198,12 @@
"p50_sec": 420.0,
"p75_sec": 420.0
},
+ "h3|i2v|draft_10s|243.0|M4 Pro|fast": {
+ "n": 3,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
"h3|i2v|draft_10s|243.0|M5 Max|fast": {
"n": 10,
"p25_sec": 120.0,
@@ -10145,10 +10397,10 @@
"p75_sec": 600.0
},
"h3|i2v|draft_5s|124.0|M3 Ultra|fast": {
- "n": 24,
+ "n": 35,
"p25_sec": 90.0,
- "p50_sec": 90.0,
- "p75_sec": 120.0
+ "p50_sec": 120.0,
+ "p75_sec": 180.0
},
"h3|i2v|draft_5s|124.0|M4 Max|fast": {
"n": 21,
@@ -10163,9 +10415,9 @@
"p75_sec": 420.0
},
"h3|i2v|draft_5s|124.0|M5 Max|best": {
- "n": 5,
+ "n": 6,
"p25_sec": 120.0,
- "p50_sec": 180.0,
+ "p50_sec": 150.0,
"p75_sec": 180.0
},
"h3|i2v|draft_5s|124.0|M5 Max|fast": {
@@ -10181,7 +10433,7 @@
"p75_sec": 420.0
},
"h3|i2v|draft_5s|124.0|M5 Pro|fast": {
- "n": 36,
+ "n": 37,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -10259,7 +10511,7 @@
"p75_sec": 2400.0
},
"h3|i2v|high_10s|243.0|M4 Max|fast": {
- "n": 120,
+ "n": 138,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -10283,7 +10535,7 @@
"p75_sec": 1200.0
},
"h3|i2v|high_10s|243.0|M5 Pro|fast": {
- "n": 24,
+ "n": 38,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -10307,7 +10559,7 @@
"p75_sec": 2400.0
},
"h3|i2v|high_15s|362.0|M4 Max|fast": {
- "n": 683,
+ "n": 714,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -10319,10 +10571,10 @@
"p75_sec": 5400.0
},
"h3|i2v|high_15s|362.0|M5 Max|best": {
- "n": 6,
+ "n": 7,
"p25_sec": 1800.0,
"p50_sec": 1800.0,
- "p75_sec": 2250.0
+ "p75_sec": 2400.0
},
"h3|i2v|high_15s|362.0|M5 Max|fast": {
"n": 16,
@@ -10373,7 +10625,7 @@
"p75_sec": 600.0
},
"h3|i2v|high_3s|73.0|M5 Max|fast": {
- "n": 30,
+ "n": 51,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -10385,7 +10637,7 @@
"p75_sec": 300.0
},
"h3|i2v|high_3s|73.0|M5 Pro|fast": {
- "n": 131,
+ "n": 135,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
@@ -10421,7 +10673,7 @@
"p75_sec": 1200.0
},
"h3|i2v|high_5s|124.0|M2 Ultra|fast": {
- "n": 22,
+ "n": 23,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -10439,16 +10691,16 @@
"p75_sec": 600.0
},
"h3|i2v|high_5s|124.0|M3 Ultra|best": {
- "n": 63,
- "p25_sec": 750.0,
+ "n": 67,
+ "p25_sec": 900.0,
"p50_sec": 900.0,
- "p75_sec": 1200.0
+ "p75_sec": 1800.0
},
"h3|i2v|high_5s|124.0|M3 Ultra|fast": {
- "n": 68,
+ "n": 75,
"p25_sec": 300.0,
"p50_sec": 300.0,
- "p75_sec": 300.0
+ "p75_sec": 360.0
},
"h3|i2v|high_5s|124.0|M4 Max|best": {
"n": 9,
@@ -10457,10 +10709,10 @@
"p75_sec": 1800.0
},
"h3|i2v|high_5s|124.0|M4 Max|fast": {
- "n": 240,
+ "n": 278,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 900.0
+ "p75_sec": 600.0
},
"h3|i2v|high_5s|124.0|M4 Pro|fast": {
"n": 8,
@@ -10469,15 +10721,15 @@
"p75_sec": 975.0
},
"h3|i2v|high_5s|124.0|M5 Max|best": {
- "n": 6,
- "p25_sec": 1200.0,
+ "n": 7,
+ "p25_sec": 1050.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"h3|i2v|high_5s|124.0|M5 Max|fast": {
- "n": 77,
+ "n": 99,
"p25_sec": 180.0,
- "p50_sec": 240.0,
+ "p50_sec": 300.0,
"p75_sec": 300.0
},
"h3|i2v|high_5s|124.0|M5 Pro|best": {
@@ -10487,7 +10739,7 @@
"p75_sec": 600.0
},
"h3|i2v|high_5s|124.0|M5 Pro|fast": {
- "n": 448,
+ "n": 559,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -10511,7 +10763,7 @@
"p75_sec": 2400.0
},
"h3|i2v|native_10s|243.0|M5 Max|fast": {
- "n": 12,
+ "n": 15,
"p25_sec": 1200.0,
"p50_sec": 1800.0,
"p75_sec": 1800.0
@@ -10546,6 +10798,12 @@
"p50_sec": 600.0,
"p75_sec": 600.0
},
+ "h3|i2v|native_3s|73.0|M5 Max|fast": {
+ "n": 7,
+ "p25_sec": 270.0,
+ "p50_sec": 600.0,
+ "p75_sec": 1200.0
+ },
"h3|i2v|native_5s|124.0|M1 Max|best": {
"n": 14,
"p25_sec": 5400.0,
@@ -10582,11 +10840,17 @@
"p50_sec": 1200.0,
"p75_sec": 1950.0
},
+ "h3|i2v|native_5s|124.0|M5 Max|best": {
+ "n": 3,
+ "p25_sec": 1050.0,
+ "p50_sec": 1200.0,
+ "p75_sec": 1200.0
+ },
"h3|i2v|native_5s|124.0|M5 Max|fast": {
- "n": 13,
+ "n": 14,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 900.0
+ "p75_sec": 825.0
},
"h3|i2v|native_5s|124.0|M5 Pro|best": {
"n": 11,
@@ -10691,13 +10955,13 @@
"p75_sec": 600.0
},
"h3|i2v|standard_10s|243.0|M4 Max|best": {
- "n": 49,
+ "n": 51,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"h3|i2v|standard_10s|243.0|M4 Max|fast": {
- "n": 150,
+ "n": 162,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -10883,9 +11147,9 @@
"p75_sec": 600.0
},
"h3|i2v|standard_5s|124.0|M2 Ultra|fast": {
- "n": 4,
+ "n": 5,
"p25_sec": 240.0,
- "p50_sec": 270.0,
+ "p50_sec": 240.0,
"p75_sec": 300.0
},
"h3|i2v|standard_5s|124.0|M3 Max|best": {
@@ -10919,7 +11183,7 @@
"p75_sec": 1200.0
},
"h3|i2v|standard_5s|124.0|M4 Max|fast": {
- "n": 272,
+ "n": 279,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -10931,7 +11195,7 @@
"p75_sec": 600.0
},
"h3|i2v|standard_5s|124.0|M5 Max|best": {
- "n": 109,
+ "n": 112,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -11087,10 +11351,10 @@
"p75_sec": 1200.0
},
"h3|t2v|draft_15s|362.0|M5 Max|best": {
- "n": 5,
+ "n": 6,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 600.0
+ "p75_sec": 555.0
},
"h3|t2v|draft_15s|362.0|M5 Max|fast": {
"n": 10,
@@ -11099,7 +11363,7 @@
"p75_sec": 1200.0
},
"h3|t2v|draft_15s|362.0|M5 Pro|fast": {
- "n": 19,
+ "n": 21,
"p25_sec": 180.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -11171,13 +11435,13 @@
"p75_sec": 120.0
},
"h3|t2v|draft_3s|73.0|M3 Ultra|fast": {
- "n": 21,
+ "n": 22,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 60.0
},
"h3|t2v|draft_3s|73.0|M4 Max|best": {
- "n": 16,
+ "n": 17,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 300.0
@@ -11201,13 +11465,13 @@
"p75_sec": 240.0
},
"h3|t2v|draft_3s|73.0|M5 Max|best": {
- "n": 550,
+ "n": 553,
"p25_sec": 60.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
"h3|t2v|draft_3s|73.0|M5 Max|fast": {
- "n": 31,
+ "n": 35,
"p25_sec": 30.0,
"p50_sec": 45.0,
"p75_sec": 52.5
@@ -11273,8 +11537,8 @@
"p75_sec": 300.0
},
"h3|t2v|draft_5s|124.0|M3 Ultra|best": {
- "n": 31,
- "p25_sec": 240.0,
+ "n": 43,
+ "p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
@@ -11285,14 +11549,14 @@
"p75_sec": 120.0
},
"h3|t2v|draft_5s|124.0|M4 Max|best": {
- "n": 28,
+ "n": 29,
"p25_sec": 300.0,
"p50_sec": 300.0,
- "p75_sec": 465.0
+ "p75_sec": 420.0
},
"h3|t2v|draft_5s|124.0|M4 Max|fast": {
- "n": 34,
- "p25_sec": 195.0,
+ "n": 37,
+ "p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
@@ -11321,7 +11585,7 @@
"p75_sec": 120.0
},
"h3|t2v|draft_5s|124.0|M5 Pro|best": {
- "n": 10,
+ "n": 11,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -11524,6 +11788,12 @@
"p50_sec": 900.0,
"p75_sec": 1050.0
},
+ "h3|t2v|high_5s|124.0|M3 Ultra|best": {
+ "n": 3,
+ "p25_sec": 2100.0,
+ "p50_sec": 2400.0,
+ "p75_sec": 3900.0
+ },
"h3|t2v|high_5s|124.0|M3 Ultra|fast": {
"n": 7,
"p25_sec": 300.0,
@@ -11543,7 +11813,7 @@
"p75_sec": 900.0
},
"h3|t2v|high_5s|124.0|M5 Max|best": {
- "n": 44,
+ "n": 51,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -11704,6 +11974,12 @@
"p50_sec": 900.0,
"p75_sec": 1200.0
},
+ "h3|t2v|standard_10s|243.0|M4 Max|best": {
+ "n": 3,
+ "p25_sec": 900.0,
+ "p50_sec": 900.0,
+ "p75_sec": 1050.0
+ },
"h3|t2v|standard_10s|243.0|M4 Max|fast": {
"n": 8,
"p25_sec": 600.0,
@@ -11746,6 +12022,12 @@
"p50_sec": 3600.0,
"p75_sec": 4050.0
},
+ "h3|t2v|standard_15s|362.0|M2 Max|fast": {
+ "n": 3,
+ "p25_sec": 1800.0,
+ "p50_sec": 2400.0,
+ "p75_sec": 3900.0
+ },
"h3|t2v|standard_15s|362.0|M4 Max|fast": {
"n": 3,
"p25_sec": 600.0,
@@ -11789,10 +12071,10 @@
"p75_sec": 900.0
},
"h3|t2v|standard_3s|73.0|M1 Max|best": {
- "n": 4,
+ "n": 5,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 675.0
+ "p75_sec": 900.0
},
"h3|t2v|standard_3s|73.0|M1 Max|fast": {
"n": 7,
@@ -11921,21 +12203,21 @@
"p75_sec": 600.0
},
"h3|t2v|standard_5s|124.0|M3 Ultra|fast": {
- "n": 25,
+ "n": 29,
"p25_sec": 120.0,
"p50_sec": 300.0,
"p75_sec": 600.0
},
"h3|t2v|standard_5s|124.0|M4 Max|best": {
- "n": 15,
+ "n": 16,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"h3|t2v|standard_5s|124.0|M4 Max|fast": {
- "n": 38,
+ "n": 43,
"p25_sec": 240.0,
- "p50_sec": 300.0,
+ "p50_sec": 240.0,
"p75_sec": 420.0
},
"h3|t2v|standard_5s|124.0|M4 Pro|best": {
@@ -11951,7 +12233,7 @@
"p75_sec": 600.0
},
"h3|t2v|standard_5s|124.0|M5 Max|best": {
- "n": 33,
+ "n": 34,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -11999,13 +12281,13 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|121.0|M4 Pro|any": {
- "n": 17,
+ "n": 19,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 600.0
+ "p75_sec": 510.0
},
"ltx|a2v|balanced|121.0|M4|any": {
- "n": 51,
+ "n": 54,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -12017,9 +12299,9 @@
"p75_sec": 90.0
},
"ltx|a2v|balanced|129.0|M4 Pro|any": {
- "n": 5,
+ "n": 6,
"p25_sec": 420.0,
- "p50_sec": 420.0,
+ "p50_sec": 510.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|129.0|M5 Max|any": {
@@ -12029,10 +12311,10 @@
"p75_sec": 120.0
},
"ltx|a2v|balanced|137.0|M4 Pro|any": {
- "n": 4,
- "p25_sec": 390.0,
+ "n": 6,
+ "p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 465.0
+ "p75_sec": 420.0
},
"ltx|a2v|balanced|137.0|M5 Max|any": {
"n": 11,
@@ -12041,10 +12323,16 @@
"p75_sec": 120.0
},
"ltx|a2v|balanced|145.0|M4 Pro|any": {
- "n": 10,
+ "n": 12,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 555.0
+ "p75_sec": 600.0
+ },
+ "ltx|a2v|balanced|145.0|M4|any": {
+ "n": 5,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
},
"ltx|a2v|balanced|145.0|M5 Max|any": {
"n": 4,
@@ -12059,7 +12347,7 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|153.0|M4 Pro|any": {
- "n": 5,
+ "n": 8,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -12083,7 +12371,7 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|169.0|M4|any": {
- "n": 8,
+ "n": 12,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -12095,27 +12383,27 @@
"p75_sec": 120.0
},
"ltx|a2v|balanced|177.0|M4 Pro|any": {
- "n": 4,
+ "n": 6,
"p25_sec": 420.0,
- "p50_sec": 420.0,
- "p75_sec": 465.0
+ "p50_sec": 510.0,
+ "p75_sec": 600.0
},
"ltx|a2v|balanced|193.0|M4 Pro|any": {
- "n": 5,
+ "n": 8,
"p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 600.0
+ "p75_sec": 900.0
},
"ltx|a2v|balanced|193.0|M4|any": {
- "n": 4,
+ "n": 8,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|201.0|M4 Pro|any": {
- "n": 4,
+ "n": 8,
"p25_sec": 600.0,
- "p50_sec": 750.0,
+ "p50_sec": 600.0,
"p75_sec": 900.0
},
"ltx|a2v|balanced|209.0|M4 Pro|any": {
@@ -12136,6 +12424,12 @@
"p50_sec": 900.0,
"p75_sec": 900.0
},
+ "ltx|a2v|balanced|241.0|M4|any": {
+ "n": 3,
+ "p25_sec": 900.0,
+ "p50_sec": 900.0,
+ "p75_sec": 900.0
+ },
"ltx|a2v|balanced|49.0|M4|any": {
"n": 9,
"p25_sec": 300.0,
@@ -12179,10 +12473,10 @@
"p75_sec": 300.0
},
"ltx|a2v|balanced|73.0|M5 Max|any": {
- "n": 5,
+ "n": 7,
"p25_sec": 45.0,
- "p50_sec": 45.0,
- "p75_sec": 60.0
+ "p50_sec": 60.0,
+ "p75_sec": 240.0
},
"ltx|a2v|balanced|73.0|M5 Pro|any": {
"n": 8,
@@ -12250,6 +12544,12 @@
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|a2v|high|121.0|M1 Pro|any": {
+ "n": 3,
+ "p25_sec": 330.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|a2v|high|121.0|M1 Ultra|any": {
"n": 6,
"p25_sec": 240.0,
@@ -12329,10 +12629,10 @@
"p75_sec": 1800.0
},
"ltx|a2v|high|169.0|M1 Pro|any": {
- "n": 6,
- "p25_sec": 330.0,
+ "n": 8,
+ "p25_sec": 390.0,
"p50_sec": 420.0,
- "p75_sec": 420.0
+ "p75_sec": 465.0
},
"ltx|a2v|high|169.0|M2 Max|any": {
"n": 9,
@@ -12389,10 +12689,10 @@
"p75_sec": 420.0
},
"ltx|a2v|high|193.0|M1 Pro|any": {
- "n": 16,
+ "n": 23,
"p25_sec": 420.0,
"p50_sec": 420.0,
- "p75_sec": 465.0
+ "p75_sec": 600.0
},
"ltx|a2v|high|193.0|M4 Pro|any": {
"n": 6,
@@ -12401,8 +12701,8 @@
"p75_sec": 1650.0
},
"ltx|a2v|high|193.0|M5 Pro|any": {
- "n": 8,
- "p25_sec": 390.0,
+ "n": 15,
+ "p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
@@ -12413,7 +12713,7 @@
"p75_sec": 900.0
},
"ltx|a2v|high|217.0|M1 Pro|any": {
- "n": 17,
+ "n": 28,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -12431,8 +12731,8 @@
"p75_sec": 900.0
},
"ltx|a2v|high|241.0|M1 Pro|any": {
- "n": 5,
- "p25_sec": 420.0,
+ "n": 8,
+ "p25_sec": 555.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -12521,7 +12821,7 @@
"p75_sec": 2400.0
},
"ltx|a2v|high|433.0|M4 Pro|any": {
- "n": 71,
+ "n": 77,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1800.0
@@ -12575,17 +12875,23 @@
"p75_sec": 900.0
},
"ltx|a2v|high|721.0|M2 Max|any": {
- "n": 7,
+ "n": 10,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
- "p75_sec": 1800.0
+ "p75_sec": 1200.0
},
"ltx|a2v|high|721.0|M4 Pro|any": {
- "n": 4,
- "p25_sec": 4650.0,
+ "n": 6,
+ "p25_sec": 5400.0,
"p50_sec": 5400.0,
"p75_sec": 5400.0
},
+ "ltx|a2v|high|73.0|M1 Max|any": {
+ "n": 5,
+ "p25_sec": 1200.0,
+ "p50_sec": 1200.0,
+ "p75_sec": 1200.0
+ },
"ltx|a2v|high|73.0|M2|any": {
"n": 7,
"p25_sec": 600.0,
@@ -12599,9 +12905,9 @@
"p75_sec": 900.0
},
"ltx|a2v|high|73.0|M4 Pro|any": {
- "n": 5,
- "p25_sec": 180.0,
- "p50_sec": 900.0,
+ "n": 6,
+ "p25_sec": 285.0,
+ "p50_sec": 750.0,
"p75_sec": 900.0
},
"ltx|a2v|high|73.0|M4|any": {
@@ -12845,9 +13151,9 @@
"p75_sec": 4500.0
},
"ltx|extend|balanced|241.0|M4 Pro|any": {
- "n": 4,
- "p25_sec": 4650.0,
- "p50_sec": 5400.0,
+ "n": 8,
+ "p25_sec": 1800.0,
+ "p50_sec": 2100.0,
"p75_sec": 5400.0
},
"ltx|extend|balanced|241.0|M5 Max|any": {
@@ -12893,11 +13199,17 @@
"p75_sec": 90.0
},
"ltx|i2v|balanced|105.0|M4 Pro|any": {
- "n": 4,
- "p25_sec": 285.0,
+ "n": 5,
+ "p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|i2v|balanced|113.0|M2 Max|any": {
+ "n": 3,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|113.0|M4 Max|any": {
"n": 18,
"p25_sec": 120.0,
@@ -12911,7 +13223,7 @@
"p75_sec": 60.0
},
"ltx|i2v|balanced|121.0|M1 Max|any": {
- "n": 344,
+ "n": 347,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -12935,7 +13247,7 @@
"p75_sec": 1200.0
},
"ltx|i2v|balanced|121.0|M2 Max|any": {
- "n": 309,
+ "n": 316,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -12953,20 +13265,20 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M2|any": {
- "n": 14,
- "p25_sec": 900.0,
+ "n": 16,
+ "p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 900.0
},
"ltx|i2v|balanced|121.0|M3 Max|any": {
- "n": 436,
+ "n": 441,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 300.0
},
"ltx|i2v|balanced|121.0|M3 Pro|any": {
- "n": 15,
- "p25_sec": 270.0,
+ "n": 17,
+ "p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
},
@@ -12977,43 +13289,43 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M3|any": {
- "n": 9,
+ "n": 10,
"p25_sec": 420.0,
- "p50_sec": 420.0,
+ "p50_sec": 510.0,
"p75_sec": 600.0
},
"ltx|i2v|balanced|121.0|M4 Max|any": {
- "n": 566,
+ "n": 568,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M4 Pro|any": {
- "n": 336,
+ "n": 345,
"p25_sec": 180.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
"ltx|i2v|balanced|121.0|M4|any": {
- "n": 187,
+ "n": 202,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
"ltx|i2v|balanced|121.0|M5 Max|any": {
- "n": 166,
+ "n": 173,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 90.0
},
"ltx|i2v|balanced|121.0|M5 Pro|any": {
- "n": 420,
+ "n": 421,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|M5|any": {
- "n": 86,
+ "n": 88,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 300.0
@@ -13024,6 +13336,12 @@
"p50_sec": 120.0,
"p75_sec": 120.0
},
+ "ltx|i2v|balanced|137.0|M4 Pro|any": {
+ "n": 4,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|137.0|M5 Pro|any": {
"n": 3,
"p25_sec": 120.0,
@@ -13049,7 +13367,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|145.0|M4 Pro|any": {
- "n": 102,
+ "n": 107,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -13067,7 +13385,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|161.0|M4 Pro|any": {
- "n": 3,
+ "n": 9,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -13097,8 +13415,8 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|169.0|M2 Ultra|any": {
- "n": 56,
- "p25_sec": 285.0,
+ "n": 119,
+ "p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
@@ -13109,7 +13427,7 @@
"p75_sec": 1200.0
},
"ltx|i2v|balanced|169.0|M3 Max|any": {
- "n": 85,
+ "n": 86,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -13127,13 +13445,13 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|169.0|M4 Pro|any": {
- "n": 66,
+ "n": 75,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|i2v|balanced|169.0|M4|any": {
- "n": 116,
+ "n": 118,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -13156,6 +13474,12 @@
"p50_sec": 300.0,
"p75_sec": 330.0
},
+ "ltx|i2v|balanced|177.0|M4 Pro|any": {
+ "n": 7,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|balanced|177.0|M5 Pro|any": {
"n": 3,
"p25_sec": 300.0,
@@ -13169,8 +13493,8 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|185.0|M4 Pro|any": {
- "n": 4,
- "p25_sec": 555.0,
+ "n": 18,
+ "p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -13199,7 +13523,7 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|193.0|M4 Pro|any": {
- "n": 131,
+ "n": 145,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -13210,8 +13534,14 @@
"p50_sec": 120.0,
"p75_sec": 120.0
},
+ "ltx|i2v|balanced|201.0|M4 Pro|any": {
+ "n": 11,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|balanced|217.0|M4 Pro|any": {
- "n": 7,
+ "n": 14,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -13223,7 +13553,7 @@
"p75_sec": 420.0
},
"ltx|i2v|balanced|241.0|M1 Max|any": {
- "n": 151,
+ "n": 153,
"p25_sec": 300.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -13259,19 +13589,19 @@
"p75_sec": 1200.0
},
"ltx|i2v|balanced|241.0|M2 Ultra|any": {
- "n": 23,
+ "n": 24,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
"ltx|i2v|balanced|241.0|M2|any": {
- "n": 12,
+ "n": 19,
"p25_sec": 1800.0,
"p50_sec": 1800.0,
- "p75_sec": 1950.0
+ "p75_sec": 2400.0
},
"ltx|i2v|balanced|241.0|M3 Max|any": {
- "n": 44,
+ "n": 45,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -13295,31 +13625,31 @@
"p75_sec": 1200.0
},
"ltx|i2v|balanced|241.0|M4 Max|any": {
- "n": 164,
+ "n": 169,
"p25_sec": 180.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|i2v|balanced|241.0|M4 Pro|any": {
- "n": 636,
+ "n": 702,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
"ltx|i2v|balanced|241.0|M4|any": {
- "n": 169,
+ "n": 170,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 1200.0
},
"ltx|i2v|balanced|241.0|M5 Max|any": {
- "n": 631,
+ "n": 632,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 240.0
},
"ltx|i2v|balanced|241.0|M5 Pro|any": {
- "n": 528,
+ "n": 530,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -13391,7 +13721,7 @@
"p75_sec": 420.0
},
"ltx|i2v|balanced|361.0|M5 Max|any": {
- "n": 81,
+ "n": 82,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -13427,10 +13757,10 @@
"p75_sec": 300.0
},
"ltx|i2v|balanced|481.0|M5|any": {
- "n": 19,
+ "n": 20,
"p25_sec": 240.0,
"p50_sec": 300.0,
- "p75_sec": 300.0
+ "p75_sec": 330.0
},
"ltx|i2v|balanced|49.0|M1 Max|any": {
"n": 5,
@@ -13487,10 +13817,10 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|65.0|M2 Max|any": {
- "n": 3,
- "p25_sec": 300.0,
+ "n": 7,
+ "p25_sec": 270.0,
"p50_sec": 300.0,
- "p75_sec": 450.0
+ "p75_sec": 300.0
},
"ltx|i2v|balanced|65.0|M4 Max|any": {
"n": 33,
@@ -13565,7 +13895,7 @@
"p75_sec": 90.0
},
"ltx|i2v|balanced|73.0|M4 Pro|any": {
- "n": 38,
+ "n": 39,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -13583,7 +13913,7 @@
"p75_sec": 45.0
},
"ltx|i2v|balanced|73.0|M5 Pro|any": {
- "n": 40,
+ "n": 46,
"p25_sec": 60.0,
"p50_sec": 90.0,
"p75_sec": 120.0
@@ -13612,12 +13942,24 @@
"p50_sec": 60.0,
"p75_sec": 60.0
},
+ "ltx|i2v|balanced|89.0|M2 Max|any": {
+ "n": 5,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|89.0|M4 Max|any": {
"n": 46,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
+ "ltx|i2v|balanced|97.0|M2 Max|any": {
+ "n": 3,
+ "p25_sec": 420.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|balanced|97.0|M3 Ultra|any": {
"n": 19,
"p25_sec": 180.0,
@@ -13625,13 +13967,13 @@
"p75_sec": 270.0
},
"ltx|i2v|balanced|97.0|M4 Max|any": {
- "n": 34,
+ "n": 37,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
"ltx|i2v|balanced|97.0|M4 Pro|any": {
- "n": 16,
+ "n": 19,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -13655,7 +13997,7 @@
"p75_sec": 120.0
},
"ltx|i2v|high_720p|121.0|M3 Ultra|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -13709,7 +14051,7 @@
"p75_sec": 420.0
},
"ltx|i2v|high|121.0|M2 Ultra|any": {
- "n": 13,
+ "n": 16,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -13727,7 +14069,7 @@
"p75_sec": 240.0
},
"ltx|i2v|high|121.0|M4 Max|any": {
- "n": 93,
+ "n": 94,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -13739,7 +14081,7 @@
"p75_sec": 600.0
},
"ltx|i2v|high|121.0|M5 Max|any": {
- "n": 27,
+ "n": 28,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 240.0
@@ -13769,7 +14111,7 @@
"p75_sec": 600.0
},
"ltx|i2v|high|169.0|M4 Max|any": {
- "n": 15,
+ "n": 16,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -13829,13 +14171,13 @@
"p75_sec": 900.0
},
"ltx|i2v|high|241.0|M4 Pro|any": {
- "n": 12,
+ "n": 14,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"ltx|i2v|high|241.0|M5 Max|any": {
- "n": 40,
+ "n": 42,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -13943,7 +14285,7 @@
"p75_sec": 180.0
},
"ltx|i2v|quick|113.0|M1 Max|any": {
- "n": 13,
+ "n": 14,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -13961,8 +14303,8 @@
"p75_sec": 60.0
},
"ltx|i2v|quick|121.0|M1 Max|any": {
- "n": 53,
- "p25_sec": 180.0,
+ "n": 56,
+ "p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
},
@@ -14021,7 +14363,7 @@
"p75_sec": 180.0
},
"ltx|i2v|quick|121.0|M4|any": {
- "n": 50,
+ "n": 51,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 600.0
@@ -14044,8 +14386,14 @@
"p50_sec": 300.0,
"p75_sec": 600.0
},
+ "ltx|i2v|quick|129.0|M1 Max|any": {
+ "n": 6,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 210.0
+ },
"ltx|i2v|quick|129.0|M2 Ultra|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 60.0
@@ -14056,6 +14404,12 @@
"p50_sec": 60.0,
"p75_sec": 60.0
},
+ "ltx|i2v|quick|137.0|M1 Max|any": {
+ "n": 22,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 120.0
+ },
"ltx|i2v|quick|145.0|M1 Max|any": {
"n": 14,
"p25_sec": 240.0,
@@ -14099,7 +14453,7 @@
"p75_sec": 120.0
},
"ltx|i2v|quick|169.0|M4 Pro|any": {
- "n": 17,
+ "n": 19,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -14279,9 +14633,9 @@
"p75_sec": 420.0
},
"ltx|i2v|quick|481.0|M4|any": {
- "n": 14,
+ "n": 17,
"p25_sec": 600.0,
- "p50_sec": 750.0,
+ "p50_sec": 900.0,
"p75_sec": 900.0
},
"ltx|i2v|quick|481.0|M5 Max|any": {
@@ -14369,9 +14723,9 @@
"p75_sec": 90.0
},
"ltx|i2v|quick|73.0|M3 Ultra|any": {
- "n": 7,
+ "n": 9,
"p25_sec": 30.0,
- "p50_sec": 45.0,
+ "p50_sec": 30.0,
"p75_sec": 90.0
},
"ltx|i2v|quick|73.0|M3|any": {
@@ -14399,10 +14753,10 @@
"p75_sec": 600.0
},
"ltx|i2v|quick|73.0|M5 Max|any": {
- "n": 27,
+ "n": 28,
"p25_sec": 15.0,
"p50_sec": 15.0,
- "p75_sec": 15.0
+ "p75_sec": 18.8
},
"ltx|i2v|quick|73.0|M5 Pro|any": {
"n": 27,
@@ -14416,6 +14770,12 @@
"p50_sec": 420.0,
"p75_sec": 600.0
},
+ "ltx|i2v|quick|81.0|M1 Max|any": {
+ "n": 3,
+ "p25_sec": 105.0,
+ "p50_sec": 120.0,
+ "p75_sec": 120.0
+ },
"ltx|i2v|quick|81.0|M5 Pro|any": {
"n": 5,
"p25_sec": 45.0,
@@ -14428,6 +14788,12 @@
"p50_sec": 150.0,
"p75_sec": 180.0
},
+ "ltx|i2v|quick|89.0|M1 Max|any": {
+ "n": 3,
+ "p25_sec": 135.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|i2v|quick|89.0|M5 Pro|any": {
"n": 3,
"p25_sec": 45.0,
@@ -14452,8 +14818,14 @@
"p50_sec": 15.0,
"p75_sec": 15.0
},
+ "ltx|i2v|standard|113.0|M1 Max|any": {
+ "n": 3,
+ "p25_sec": 240.0,
+ "p50_sec": 240.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|standard|121.0|M1 Max|any": {
- "n": 275,
+ "n": 287,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -14477,13 +14849,13 @@
"p75_sec": 2025.0
},
"ltx|i2v|standard|121.0|M2 Max|any": {
- "n": 173,
+ "n": 174,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
"ltx|i2v|standard|121.0|M2 Ultra|any": {
- "n": 43,
+ "n": 44,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -14495,8 +14867,8 @@
"p75_sec": 1050.0
},
"ltx|i2v|standard|121.0|M3 Max|any": {
- "n": 26,
- "p25_sec": 135.0,
+ "n": 29,
+ "p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
@@ -14507,7 +14879,7 @@
"p75_sec": 1500.0
},
"ltx|i2v|standard|121.0|M3 Ultra|any": {
- "n": 64,
+ "n": 67,
"p25_sec": 180.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -14519,41 +14891,59 @@
"p75_sec": 420.0
},
"ltx|i2v|standard|121.0|M4 Max|any": {
- "n": 143,
- "p25_sec": 120.0,
+ "n": 157,
+ "p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 240.0
},
"ltx|i2v|standard|121.0|M4 Pro|any": {
- "n": 220,
+ "n": 222,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
"ltx|i2v|standard|121.0|M4|any": {
- "n": 36,
+ "n": 39,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|i2v|standard|121.0|M5 Max|any": {
- "n": 147,
+ "n": 236,
"p25_sec": 60.0,
- "p50_sec": 120.0,
- "p75_sec": 180.0
+ "p50_sec": 60.0,
+ "p75_sec": 120.0
},
"ltx|i2v|standard|121.0|M5 Pro|any": {
- "n": 162,
+ "n": 169,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|i2v|standard|121.0|M5|any": {
- "n": 163,
+ "n": 164,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 240.0
},
+ "ltx|i2v|standard|129.0|M1 Max|any": {
+ "n": 11,
+ "p25_sec": 240.0,
+ "p50_sec": 240.0,
+ "p75_sec": 420.0
+ },
+ "ltx|i2v|standard|129.0|M5 Max|any": {
+ "n": 3,
+ "p25_sec": 60.0,
+ "p50_sec": 60.0,
+ "p75_sec": 60.0
+ },
+ "ltx|i2v|standard|137.0|M1 Max|any": {
+ "n": 51,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|standard|137.0|M4 Max|any": {
"n": 4,
"p25_sec": 120.0,
@@ -14627,11 +15017,17 @@
"p75_sec": 420.0
},
"ltx|i2v|standard|169.0|M2 Ultra|any": {
- "n": 102,
+ "n": 103,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|i2v|standard|169.0|M2|any": {
+ "n": 8,
+ "p25_sec": 825.0,
+ "p50_sec": 900.0,
+ "p75_sec": 900.0
+ },
"ltx|i2v|standard|169.0|M3 Max|any": {
"n": 3,
"p25_sec": 240.0,
@@ -14657,19 +15053,19 @@
"p75_sec": 240.0
},
"ltx|i2v|standard|169.0|M4 Pro|any": {
- "n": 132,
+ "n": 133,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 420.0
},
"ltx|i2v|standard|169.0|M4|any": {
- "n": 36,
+ "n": 38,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
"ltx|i2v|standard|169.0|M5 Max|any": {
- "n": 143,
+ "n": 165,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -14753,7 +15149,7 @@
"p75_sec": 420.0
},
"ltx|i2v|standard|241.0|M2 Ultra|any": {
- "n": 109,
+ "n": 113,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -14765,7 +15161,7 @@
"p75_sec": 1800.0
},
"ltx|i2v|standard|241.0|M3 Max|any": {
- "n": 12,
+ "n": 14,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -14789,25 +15185,25 @@
"p75_sec": 1200.0
},
"ltx|i2v|standard|241.0|M4 Max|any": {
- "n": 150,
+ "n": 152,
"p25_sec": 300.0,
"p50_sec": 420.0,
- "p75_sec": 420.0
+ "p75_sec": 465.0
},
"ltx|i2v|standard|241.0|M4 Pro|any": {
- "n": 124,
+ "n": 132,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
"ltx|i2v|standard|241.0|M4|any": {
- "n": 424,
+ "n": 442,
"p25_sec": 420.0,
- "p50_sec": 420.0,
+ "p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|i2v|standard|241.0|M5 Max|any": {
- "n": 123,
+ "n": 127,
"p25_sec": 180.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -14819,7 +15215,7 @@
"p75_sec": 300.0
},
"ltx|i2v|standard|241.0|M5|any": {
- "n": 156,
+ "n": 168,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -14848,6 +15244,12 @@
"p50_sec": 600.0,
"p75_sec": 600.0
},
+ "ltx|i2v|standard|289.0|M4 Max|any": {
+ "n": 3,
+ "p25_sec": 180.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|i2v|standard|289.0|M4 Pro|any": {
"n": 5,
"p25_sec": 420.0,
@@ -14927,7 +15329,7 @@
"p75_sec": 120.0
},
"ltx|i2v|standard|49.0|M5 Max|any": {
- "n": 31,
+ "n": 34,
"p25_sec": 45.0,
"p50_sec": 60.0,
"p75_sec": 90.0
@@ -14963,21 +15365,21 @@
"p75_sec": 120.0
},
"ltx|i2v|standard|73.0|M4 Pro|any": {
- "n": 75,
+ "n": 82,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|i2v|standard|73.0|M4|any": {
- "n": 7,
+ "n": 8,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 330.0
},
"ltx|i2v|standard|73.0|M5 Max|any": {
- "n": 174,
+ "n": 227,
"p25_sec": 60.0,
- "p50_sec": 60.0,
+ "p50_sec": 90.0,
"p75_sec": 120.0
},
"ltx|i2v|standard|73.0|M5 Pro|any": {
@@ -14992,12 +15394,24 @@
"p50_sec": 420.0,
"p75_sec": 1110.0
},
+ "ltx|i2v|standard|81.0|M1 Max|any": {
+ "n": 4,
+ "p25_sec": 180.0,
+ "p50_sec": 240.0,
+ "p75_sec": 330.0
+ },
"ltx|i2v|standard|81.0|M5 Max|any": {
"n": 33,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 45.0
},
+ "ltx|i2v|standard|89.0|M1 Max|any": {
+ "n": 5,
+ "p25_sec": 180.0,
+ "p50_sec": 300.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|standard|89.0|M5 Max|any": {
"n": 8,
"p25_sec": 45.0,
@@ -15142,6 +15556,12 @@
"p50_sec": 900.0,
"p75_sec": 1050.0
},
+ "ltx|keyframe|balanced|241.0|M5 Max|any": {
+ "n": 4,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
"ltx|keyframe|balanced|241.0|M5 Pro|any": {
"n": 6,
"p25_sec": 420.0,
@@ -15395,10 +15815,10 @@
"p75_sec": 600.0
},
"ltx|keyframe|standard|241.0|M5 Max|any": {
- "n": 6,
+ "n": 7,
"p25_sec": 180.0,
"p50_sec": 180.0,
- "p75_sec": 225.0
+ "p75_sec": 240.0
},
"ltx|keyframe|standard|289.0|M2 Ultra|any": {
"n": 4,
@@ -15449,13 +15869,13 @@
"p75_sec": 90.0
},
"ltx|t2v|balanced|121.0|M1 Max|any": {
- "n": 276,
+ "n": 277,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
"ltx|t2v|balanced|121.0|M1 Pro|any": {
- "n": 85,
+ "n": 86,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -15473,7 +15893,7 @@
"p75_sec": 900.0
},
"ltx|t2v|balanced|121.0|M2 Max|any": {
- "n": 182,
+ "n": 191,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -15509,10 +15929,10 @@
"p75_sec": 600.0
},
"ltx|t2v|balanced|121.0|M3 Ultra|any": {
- "n": 102,
+ "n": 108,
"p25_sec": 90.0,
"p50_sec": 90.0,
- "p75_sec": 90.0
+ "p75_sec": 120.0
},
"ltx|t2v|balanced|121.0|M3|any": {
"n": 11,
@@ -15521,13 +15941,13 @@
"p75_sec": 1200.0
},
"ltx|t2v|balanced|121.0|M4 Max|any": {
- "n": 779,
+ "n": 782,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|t2v|balanced|121.0|M4 Pro|any": {
- "n": 368,
+ "n": 372,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -15539,13 +15959,13 @@
"p75_sec": 600.0
},
"ltx|t2v|balanced|121.0|M5 Max|any": {
- "n": 176,
+ "n": 209,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 90.0
},
"ltx|t2v|balanced|121.0|M5 Pro|any": {
- "n": 209,
+ "n": 211,
"p25_sec": 90.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -15599,7 +16019,7 @@
"p75_sec": 420.0
},
"ltx|t2v|balanced|169.0|M2 Max|any": {
- "n": 13,
+ "n": 15,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -15623,14 +16043,14 @@
"p75_sec": 825.0
},
"ltx|t2v|balanced|169.0|M4 Max|any": {
- "n": 39,
- "p25_sec": 240.0,
+ "n": 41,
+ "p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 240.0
},
"ltx|t2v|balanced|169.0|M4 Pro|any": {
- "n": 26,
- "p25_sec": 300.0,
+ "n": 32,
+ "p25_sec": 225.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
@@ -15641,16 +16061,16 @@
"p75_sec": 600.0
},
"ltx|t2v|balanced|169.0|M5 Max|any": {
- "n": 13,
- "p25_sec": 90.0,
+ "n": 14,
+ "p25_sec": 97.5,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|t2v|balanced|169.0|M5 Pro|any": {
- "n": 50,
+ "n": 54,
"p25_sec": 90.0,
"p50_sec": 90.0,
- "p75_sec": 90.0
+ "p75_sec": 120.0
},
"ltx|t2v|balanced|169.0|M5|any": {
"n": 4,
@@ -15707,7 +16127,7 @@
"p75_sec": 4500.0
},
"ltx|t2v|balanced|241.0|M2 Max|any": {
- "n": 93,
+ "n": 97,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -15719,7 +16139,7 @@
"p75_sec": 810.0
},
"ltx|t2v|balanced|241.0|M2|any": {
- "n": 7,
+ "n": 8,
"p25_sec": 1800.0,
"p50_sec": 1800.0,
"p75_sec": 1800.0
@@ -15749,31 +16169,31 @@
"p75_sec": 900.0
},
"ltx|t2v|balanced|241.0|M4 Max|any": {
- "n": 263,
+ "n": 264,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|t2v|balanced|241.0|M4 Pro|any": {
- "n": 180,
- "p25_sec": 555.0,
+ "n": 181,
+ "p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|t2v|balanced|241.0|M4|any": {
- "n": 39,
+ "n": 49,
"p25_sec": 900.0,
- "p50_sec": 1200.0,
+ "p50_sec": 900.0,
"p75_sec": 1200.0
},
"ltx|t2v|balanced|241.0|M5 Max|any": {
- "n": 57,
+ "n": 58,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
},
"ltx|t2v|balanced|241.0|M5 Pro|any": {
- "n": 33,
+ "n": 36,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -15893,14 +16313,14 @@
"p75_sec": 135.0
},
"ltx|t2v|balanced|73.0|M2 Max|any": {
- "n": 46,
+ "n": 53,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|t2v|balanced|73.0|M3 Max|any": {
- "n": 10,
- "p25_sec": 97.5,
+ "n": 11,
+ "p25_sec": 105.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
@@ -15917,8 +16337,8 @@
"p75_sec": 90.0
},
"ltx|t2v|balanced|73.0|M4 Pro|any": {
- "n": 53,
- "p25_sec": 90.0,
+ "n": 56,
+ "p25_sec": 112.5,
"p50_sec": 180.0,
"p75_sec": 180.0
},
@@ -15935,7 +16355,7 @@
"p75_sec": 45.0
},
"ltx|t2v|balanced|73.0|M5 Pro|any": {
- "n": 15,
+ "n": 17,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 60.0
@@ -16049,9 +16469,9 @@
"p75_sec": 420.0
},
"ltx|t2v|high|121.0|M2 Max|any": {
- "n": 13,
+ "n": 14,
"p25_sec": 300.0,
- "p50_sec": 420.0,
+ "p50_sec": 360.0,
"p75_sec": 420.0
},
"ltx|t2v|high|121.0|M2 Ultra|any": {
@@ -16067,7 +16487,7 @@
"p75_sec": 600.0
},
"ltx|t2v|high|121.0|M4 Max|any": {
- "n": 91,
+ "n": 93,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 900.0
@@ -16079,8 +16499,8 @@
"p75_sec": 600.0
},
"ltx|t2v|high|121.0|M5 Max|any": {
- "n": 20,
- "p25_sec": 90.0,
+ "n": 29,
+ "p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
},
@@ -16126,6 +16546,12 @@
"p50_sec": 300.0,
"p75_sec": 300.0
},
+ "ltx|t2v|high|169.0|M4 Max|any": {
+ "n": 7,
+ "p25_sec": 360.0,
+ "p50_sec": 420.0,
+ "p75_sec": 420.0
+ },
"ltx|t2v|high|169.0|M4 Pro|any": {
"n": 11,
"p25_sec": 600.0,
@@ -16169,7 +16595,7 @@
"p75_sec": 300.0
},
"ltx|t2v|high|241.0|M4 Max|any": {
- "n": 54,
+ "n": 58,
"p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 1200.0
@@ -16241,8 +16667,8 @@
"p75_sec": 240.0
},
"ltx|t2v|high|73.0|M2 Max|any": {
- "n": 14,
- "p25_sec": 255.0,
+ "n": 16,
+ "p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
},
@@ -16265,7 +16691,7 @@
"p75_sec": 300.0
},
"ltx|t2v|high|73.0|M4 Pro|any": {
- "n": 8,
+ "n": 9,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 420.0
@@ -16289,7 +16715,7 @@
"p75_sec": 150.0
},
"ltx|t2v|quick|121.0|M1 Max|any": {
- "n": 113,
+ "n": 119,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 180.0
@@ -16307,7 +16733,7 @@
"p75_sec": 90.0
},
"ltx|t2v|quick|121.0|M2 Max|any": {
- "n": 60,
+ "n": 68,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
@@ -16319,10 +16745,10 @@
"p75_sec": 180.0
},
"ltx|t2v|quick|121.0|M3 Max|any": {
- "n": 19,
+ "n": 23,
"p25_sec": 90.0,
- "p50_sec": 90.0,
- "p75_sec": 120.0
+ "p50_sec": 120.0,
+ "p75_sec": 210.0
},
"ltx|t2v|quick|121.0|M3 Pro|any": {
"n": 3,
@@ -16331,7 +16757,7 @@
"p75_sec": 420.0
},
"ltx|t2v|quick|121.0|M3 Ultra|any": {
- "n": 80,
+ "n": 97,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 60.0
@@ -16355,7 +16781,7 @@
"p75_sec": 180.0
},
"ltx|t2v|quick|121.0|M4|any": {
- "n": 33,
+ "n": 34,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -16378,6 +16804,12 @@
"p50_sec": 180.0,
"p75_sec": 300.0
},
+ "ltx|t2v|quick|145.0|M1 Max|any": {
+ "n": 5,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 420.0
+ },
"ltx|t2v|quick|145.0|M4 Pro|any": {
"n": 8,
"p25_sec": 180.0,
@@ -16673,7 +17105,7 @@
"p75_sec": 30.0
},
"ltx|t2v|quick|73.0|M1 Max|any": {
- "n": 33,
+ "n": 39,
"p25_sec": 90.0,
"p50_sec": 120.0,
"p75_sec": 120.0
@@ -16703,10 +17135,10 @@
"p75_sec": 120.0
},
"ltx|t2v|quick|73.0|M3 Max|any": {
- "n": 12,
+ "n": 13,
"p25_sec": 60.0,
"p50_sec": 60.0,
- "p75_sec": 67.5
+ "p75_sec": 90.0
},
"ltx|t2v|quick|73.0|M3 Ultra|any": {
"n": 43,
@@ -16739,7 +17171,7 @@
"p75_sec": 45.0
},
"ltx|t2v|quick|73.0|M5 Pro|any": {
- "n": 18,
+ "n": 19,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 45.0
@@ -16751,16 +17183,16 @@
"p75_sec": 135.0
},
"ltx|t2v|quick|97.0|M1 Max|any": {
- "n": 6,
- "p25_sec": 120.0,
+ "n": 7,
+ "p25_sec": 105.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|t2v|quick|97.0|M3 Max|any": {
- "n": 6,
+ "n": 7,
"p25_sec": 90.0,
"p50_sec": 90.0,
- "p75_sec": 90.0
+ "p75_sec": 105.0
},
"ltx|t2v|quick|97.0|M3 Ultra|any": {
"n": 6,
@@ -16823,10 +17255,10 @@
"p75_sec": 615.0
},
"ltx|t2v|standard|121.0|M2 Max|any": {
- "n": 7,
+ "n": 12,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 180.0
+ "p75_sec": 135.0
},
"ltx|t2v|standard|121.0|M2 Pro|any": {
"n": 3,
@@ -16877,9 +17309,9 @@
"p75_sec": 420.0
},
"ltx|t2v|standard|121.0|M5 Max|any": {
- "n": 87,
+ "n": 101,
"p25_sec": 60.0,
- "p50_sec": 120.0,
+ "p50_sec": 90.0,
"p75_sec": 120.0
},
"ltx|t2v|standard|121.0|M5 Pro|any": {
@@ -16918,6 +17350,12 @@
"p50_sec": 420.0,
"p75_sec": 600.0
},
+ "ltx|t2v|standard|169.0|M2 Max|any": {
+ "n": 3,
+ "p25_sec": 360.0,
+ "p50_sec": 600.0,
+ "p75_sec": 900.0
+ },
"ltx|t2v|standard|169.0|M2 Ultra|any": {
"n": 3,
"p25_sec": 300.0,
@@ -16955,7 +17393,7 @@
"p75_sec": 600.0
},
"ltx|t2v|standard|241.0|M1 Max|any": {
- "n": 59,
+ "n": 61,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -16991,7 +17429,7 @@
"p75_sec": 420.0
},
"ltx|t2v|standard|241.0|M2|any": {
- "n": 4,
+ "n": 5,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -17003,7 +17441,7 @@
"p75_sec": 600.0
},
"ltx|t2v|standard|241.0|M4 Max|any": {
- "n": 160,
+ "n": 166,
"p25_sec": 180.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -17039,10 +17477,10 @@
"p75_sec": 420.0
},
"ltx|t2v|standard|241.0|M6|any": {
- "n": 3,
- "p25_sec": 240.0,
- "p50_sec": 240.0,
- "p75_sec": 240.0
+ "n": 41,
+ "p25_sec": 300.0,
+ "p50_sec": 300.0,
+ "p75_sec": 300.0
},
"ltx|t2v|standard|25.0|M1 Ultra|any": {
"n": 10,
@@ -17104,6 +17542,12 @@
"p50_sec": 120.0,
"p75_sec": 120.0
},
+ "ltx|t2v|standard|73.0|M2 Max|any": {
+ "n": 7,
+ "p25_sec": 180.0,
+ "p50_sec": 180.0,
+ "p75_sec": 180.0
+ },
"ltx|t2v|standard|73.0|M3 Ultra|any": {
"n": 6,
"p25_sec": 90.0,
@@ -17201,10 +17645,10 @@
"p75_sec": 600.0
},
"h3|i2v|draft_10s|243.0|fast": {
- "n": 117,
+ "n": 128,
"p25_sec": 300.0,
"p50_sec": 420.0,
- "p75_sec": 420.0
+ "p75_sec": 600.0
},
"h3|i2v|draft_15s|362.0|best": {
"n": 16,
@@ -17231,13 +17675,13 @@
"p75_sec": 180.0
},
"h3|i2v|draft_5s|124.0|best": {
- "n": 171,
+ "n": 172,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 600.0
},
"h3|i2v|draft_5s|124.0|fast": {
- "n": 128,
+ "n": 140,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 300.0
@@ -17261,19 +17705,19 @@
"p75_sec": 2400.0
},
"h3|i2v|high_10s|243.0|fast": {
- "n": 196,
- "p25_sec": 900.0,
+ "n": 228,
+ "p25_sec": 600.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"h3|i2v|high_15s|362.0|best": {
- "n": 99,
+ "n": 100,
"p25_sec": 3600.0,
"p50_sec": 5400.0,
"p75_sec": 5400.0
},
"h3|i2v|high_15s|362.0|fast": {
- "n": 721,
+ "n": 752,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -17285,19 +17729,19 @@
"p75_sec": 420.0
},
"h3|i2v|high_3s|73.0|fast": {
- "n": 197,
+ "n": 222,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"h3|i2v|high_5s|124.0|best": {
- "n": 626,
+ "n": 631,
"p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 1200.0
},
"h3|i2v|high_5s|124.0|fast": {
- "n": 920,
+ "n": 1099,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 600.0
@@ -17315,7 +17759,7 @@
"p75_sec": 5400.0
},
"h3|i2v|native_10s|243.0|fast": {
- "n": 33,
+ "n": 36,
"p25_sec": 1800.0,
"p50_sec": 2400.0,
"p75_sec": 2400.0
@@ -17339,19 +17783,19 @@
"p75_sec": 1950.0
},
"h3|i2v|native_3s|73.0|fast": {
- "n": 28,
+ "n": 34,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"h3|i2v|native_5s|124.0|best": {
- "n": 56,
+ "n": 58,
"p25_sec": 2400.0,
- "p50_sec": 3600.0,
+ "p50_sec": 2400.0,
"p75_sec": 3600.0
},
"h3|i2v|native_5s|124.0|fast": {
- "n": 38,
+ "n": 39,
"p25_sec": 600.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -17369,13 +17813,13 @@
"p75_sec": 1200.0
},
"h3|i2v|standard_10s|243.0|best": {
- "n": 162,
+ "n": 164,
"p25_sec": 900.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
},
"h3|i2v|standard_10s|243.0|fast": {
- "n": 266,
+ "n": 278,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -17387,7 +17831,7 @@
"p75_sec": 3600.0
},
"h3|i2v|standard_15s|362.0|fast": {
- "n": 92,
+ "n": 93,
"p25_sec": 420.0,
"p50_sec": 900.0,
"p75_sec": 1200.0
@@ -17405,13 +17849,13 @@
"p75_sec": 300.0
},
"h3|i2v|standard_5s|124.0|best": {
- "n": 231,
+ "n": 234,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 900.0
},
"h3|i2v|standard_5s|124.0|fast": {
- "n": 409,
+ "n": 417,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -17441,7 +17885,7 @@
"p75_sec": 600.0
},
"h3|t2v|draft_10s|243.0|best": {
- "n": 84,
+ "n": 85,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 1200.0
@@ -17453,39 +17897,39 @@
"p75_sec": 600.0
},
"h3|t2v|draft_15s|362.0|best": {
- "n": 21,
+ "n": 22,
"p25_sec": 600.0,
"p50_sec": 2400.0,
"p75_sec": 2400.0
},
"h3|t2v|draft_15s|362.0|fast": {
- "n": 64,
- "p25_sec": 555.0,
+ "n": 66,
+ "p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 1200.0
},
"h3|t2v|draft_3s|73.0|best": {
- "n": 749,
+ "n": 753,
"p25_sec": 60.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
"h3|t2v|draft_3s|73.0|fast": {
- "n": 212,
+ "n": 217,
"p25_sec": 60.0,
"p50_sec": 120.0,
- "p75_sec": 195.0
+ "p75_sec": 180.0
},
"h3|t2v|draft_5s|124.0|best": {
- "n": 518,
- "p25_sec": 120.0,
+ "n": 532,
+ "p25_sec": 180.0,
"p50_sec": 300.0,
"p75_sec": 600.0
},
"h3|t2v|draft_5s|124.0|fast": {
- "n": 226,
+ "n": 230,
"p25_sec": 120.0,
- "p50_sec": 180.0,
+ "p50_sec": 210.0,
"p75_sec": 300.0
},
"h3|t2v|high_10s_dense|243.0|best": {
@@ -17513,7 +17957,7 @@
"p75_sec": 1650.0
},
"h3|t2v|high_15s|362.0|best": {
- "n": 59,
+ "n": 60,
"p25_sec": 3600.0,
"p50_sec": 5400.0,
"p75_sec": 5400.0
@@ -17525,7 +17969,7 @@
"p75_sec": 2400.0
},
"h3|t2v|high_3s|73.0|best": {
- "n": 32,
+ "n": 33,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 900.0
@@ -17537,9 +17981,9 @@
"p75_sec": 300.0
},
"h3|t2v|high_5s|124.0|best": {
- "n": 101,
+ "n": 109,
"p25_sec": 600.0,
- "p50_sec": 900.0,
+ "p50_sec": 1200.0,
"p75_sec": 1800.0
},
"h3|t2v|high_5s|124.0|fast": {
@@ -17615,7 +18059,7 @@
"p75_sec": 675.0
},
"h3|t2v|standard_10s|243.0|best": {
- "n": 76,
+ "n": 77,
"p25_sec": 900.0,
"p50_sec": 2400.0,
"p75_sec": 2400.0
@@ -17627,21 +18071,21 @@
"p75_sec": 675.0
},
"h3|t2v|standard_15s|362.0|best": {
- "n": 43,
+ "n": 44,
"p25_sec": 900.0,
- "p50_sec": 1050.0,
- "p75_sec": 3300.0
+ "p50_sec": 1200.0,
+ "p75_sec": 3600.0
},
"h3|t2v|standard_15s|362.0|fast": {
- "n": 79,
+ "n": 80,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 900.0
},
"h3|t2v|standard_3s|73.0|best": {
- "n": 60,
+ "n": 61,
"p25_sec": 120.0,
- "p50_sec": 210.0,
+ "p50_sec": 240.0,
"p75_sec": 600.0
},
"h3|t2v|standard_3s|73.0|fast": {
@@ -17651,13 +18095,13 @@
"p75_sec": 195.0
},
"h3|t2v|standard_5s|124.0|best": {
- "n": 171,
+ "n": 173,
"p25_sec": 300.0,
"p50_sec": 600.0,
- "p75_sec": 1125.0
+ "p75_sec": 975.0
},
"h3|t2v|standard_5s|124.0|fast": {
- "n": 147,
+ "n": 156,
"p25_sec": 120.0,
"p50_sec": 300.0,
"p75_sec": 600.0
@@ -17681,32 +18125,32 @@
"p75_sec": 765.0
},
"ltx|a2v|balanced|121.0|any": {
- "n": 90,
+ "n": 95,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|a2v|balanced|129.0|any": {
- "n": 10,
+ "n": 11,
"p25_sec": 120.0,
"p50_sec": 420.0,
- "p75_sec": 555.0
+ "p75_sec": 600.0
},
"ltx|a2v|balanced|137.0|any": {
- "n": 15,
+ "n": 17,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 210.0
+ "p75_sec": 420.0
},
"ltx|a2v|balanced|145.0|any": {
- "n": 25,
- "p25_sec": 240.0,
+ "n": 30,
+ "p25_sec": 255.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|153.0|any": {
- "n": 8,
- "p25_sec": 120.0,
+ "n": 11,
+ "p25_sec": 360.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
@@ -17717,27 +18161,27 @@
"p75_sec": 600.0
},
"ltx|a2v|balanced|169.0|any": {
- "n": 16,
- "p25_sec": 480.0,
+ "n": 20,
+ "p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|177.0|any": {
- "n": 6,
- "p25_sec": 195.0,
+ "n": 8,
+ "p25_sec": 345.0,
"p50_sec": 420.0,
- "p75_sec": 420.0
+ "p75_sec": 600.0
},
"ltx|a2v|balanced|193.0|any": {
- "n": 9,
+ "n": 16,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
},
"ltx|a2v|balanced|201.0|any": {
- "n": 4,
+ "n": 8,
"p25_sec": 600.0,
- "p50_sec": 750.0,
+ "p50_sec": 600.0,
"p75_sec": 900.0
},
"ltx|a2v|balanced|209.0|any": {
@@ -17753,7 +18197,7 @@
"p75_sec": 900.0
},
"ltx|a2v|balanced|241.0|any": {
- "n": 32,
+ "n": 34,
"p25_sec": 900.0,
"p50_sec": 900.0,
"p75_sec": 900.0
@@ -17783,7 +18227,7 @@
"p75_sec": 300.0
},
"ltx|a2v|balanced|73.0|any": {
- "n": 61,
+ "n": 63,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -17819,7 +18263,7 @@
"p75_sec": 300.0
},
"ltx|a2v|high|121.0|any": {
- "n": 64,
+ "n": 66,
"p25_sec": 240.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -17855,7 +18299,7 @@
"p75_sec": 1215.0
},
"ltx|a2v|high|169.0|any": {
- "n": 190,
+ "n": 192,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 900.0
@@ -17867,19 +18311,19 @@
"p75_sec": 420.0
},
"ltx|a2v|high|193.0|any": {
- "n": 59,
+ "n": 73,
"p25_sec": 420.0,
"p50_sec": 600.0,
- "p75_sec": 900.0
+ "p75_sec": 600.0
},
"ltx|a2v|high|217.0|any": {
- "n": 57,
- "p25_sec": 555.0,
+ "n": 68,
+ "p25_sec": 600.0,
"p50_sec": 600.0,
- "p75_sec": 900.0
+ "p75_sec": 600.0
},
"ltx|a2v|high|241.0|any": {
- "n": 116,
+ "n": 119,
"p25_sec": 420.0,
"p50_sec": 420.0,
"p75_sec": 900.0
@@ -17921,7 +18365,7 @@
"p75_sec": 1200.0
},
"ltx|a2v|high|433.0|any": {
- "n": 108,
+ "n": 114,
"p25_sec": 1200.0,
"p50_sec": 1500.0,
"p75_sec": 2400.0
@@ -17944,6 +18388,12 @@
"p50_sec": 45.0,
"p75_sec": 45.0
},
+ "ltx|a2v|high|577.0|any": {
+ "n": 3,
+ "p25_sec": 3000.0,
+ "p50_sec": 3600.0,
+ "p75_sec": 4500.0
+ },
"ltx|a2v|high|601.0|any": {
"n": 8,
"p25_sec": 2250.0,
@@ -17963,16 +18413,16 @@
"p75_sec": 900.0
},
"ltx|a2v|high|721.0|any": {
- "n": 20,
+ "n": 25,
"p25_sec": 1200.0,
"p50_sec": 2400.0,
"p75_sec": 5400.0
},
"ltx|a2v|high|73.0|any": {
- "n": 36,
- "p25_sec": 150.0,
- "p50_sec": 300.0,
- "p75_sec": 600.0
+ "n": 40,
+ "p25_sec": 180.0,
+ "p50_sec": 420.0,
+ "p75_sec": 750.0
},
"ltx|a2v|high|81.0|any": {
"n": 12,
@@ -17993,9 +18443,9 @@
"p75_sec": 750.0
},
"ltx|a2v|quick|241.0|any": {
- "n": 21,
- "p25_sec": 120.0,
- "p50_sec": 600.0,
+ "n": 22,
+ "p25_sec": 135.0,
+ "p50_sec": 900.0,
"p75_sec": 1200.0
},
"ltx|a2v|standard|105.0|any": {
@@ -18088,11 +18538,17 @@
"p50_sec": 1200.0,
"p75_sec": 1800.0
},
+ "ltx|extend|balanced|169.0|any": {
+ "n": 3,
+ "p25_sec": 3000.0,
+ "p50_sec": 3600.0,
+ "p75_sec": 4500.0
+ },
"ltx|extend|balanced|241.0|any": {
- "n": 12,
+ "n": 16,
"p25_sec": 1800.0,
- "p50_sec": 2400.0,
- "p75_sec": 5400.0
+ "p50_sec": 1800.0,
+ "p75_sec": 4050.0
},
"ltx|extend|high|121.0|any": {
"n": 4,
@@ -18119,19 +18575,19 @@
"p75_sec": 5400.0
},
"ltx|i2v|balanced|105.0|any": {
- "n": 8,
+ "n": 10,
"p25_sec": 90.0,
"p50_sec": 165.0,
"p75_sec": 300.0
},
"ltx|i2v|balanced|113.0|any": {
- "n": 64,
+ "n": 65,
"p25_sec": 60.0,
"p50_sec": 60.0,
"p75_sec": 120.0
},
"ltx|i2v|balanced|121.0|any": {
- "n": 3455,
+ "n": 3511,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 300.0
@@ -18143,13 +18599,13 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|137.0|any": {
- "n": 18,
+ "n": 22,
"p25_sec": 120.0,
"p50_sec": 120.0,
- "p75_sec": 120.0
+ "p75_sec": 195.0
},
"ltx|i2v|balanced|145.0|any": {
- "n": 358,
+ "n": 363,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -18161,37 +18617,49 @@
"p75_sec": 120.0
},
"ltx|i2v|balanced|161.0|any": {
- "n": 8,
+ "n": 16,
"p25_sec": 120.0,
- "p50_sec": 120.0,
+ "p50_sec": 420.0,
"p75_sec": 420.0
},
"ltx|i2v|balanced|169.0|any": {
- "n": 763,
+ "n": 838,
"p25_sec": 120.0,
"p50_sec": 300.0,
"p75_sec": 420.0
},
"ltx|i2v|balanced|177.0|any": {
- "n": 5,
- "p25_sec": 180.0,
- "p50_sec": 300.0,
- "p75_sec": 300.0
+ "n": 12,
+ "p25_sec": 300.0,
+ "p50_sec": 420.0,
+ "p75_sec": 465.0
},
"ltx|i2v|balanced|185.0|any": {
- "n": 10,
- "p25_sec": 210.0,
- "p50_sec": 300.0,
- "p75_sec": 555.0
+ "n": 24,
+ "p25_sec": 390.0,
+ "p50_sec": 510.0,
+ "p75_sec": 600.0
},
"ltx|i2v|balanced|193.0|any": {
- "n": 290,
+ "n": 304,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 420.0
},
+ "ltx|i2v|balanced|201.0|any": {
+ "n": 12,
+ "p25_sec": 600.0,
+ "p50_sec": 600.0,
+ "p75_sec": 600.0
+ },
+ "ltx|i2v|balanced|209.0|any": {
+ "n": 4,
+ "p25_sec": 420.0,
+ "p50_sec": 510.0,
+ "p75_sec": 600.0
+ },
"ltx|i2v|balanced|217.0|any": {
- "n": 8,
+ "n": 15,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -18203,7 +18671,7 @@
"p75_sec": 420.0
},
"ltx|i2v|balanced|241.0|any": {
- "n": 3150,
+ "n": 3236,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 600.0
@@ -18233,7 +18701,7 @@
"p75_sec": 510.0
},
"ltx|i2v|balanced|361.0|any": {
- "n": 143,
+ "n": 144,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -18245,7 +18713,7 @@
"p75_sec": 600.0
},
"ltx|i2v|balanced|481.0|any": {
- "n": 216,
+ "n": 217,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -18263,10 +18731,10 @@
"p75_sec": 180.0
},
"ltx|i2v|balanced|65.0|any": {
- "n": 45,
+ "n": 49,
"p25_sec": 60.0,
"p50_sec": 60.0,
- "p75_sec": 90.0
+ "p75_sec": 180.0
},
"ltx|i2v|balanced|721.0|any": {
"n": 10,
@@ -18275,7 +18743,7 @@
"p75_sec": 1800.0
},
"ltx|i2v|balanced|73.0|any": {
- "n": 488,
+ "n": 495,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 120.0
@@ -18287,16 +18755,16 @@
"p75_sec": 90.0
},
"ltx|i2v|balanced|89.0|any": {
- "n": 49,
+ "n": 53,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 90.0
},
"ltx|i2v|balanced|97.0|any": {
- "n": 128,
+ "n": 137,
"p25_sec": 90.0,
"p50_sec": 90.0,
- "p75_sec": 180.0
+ "p75_sec": 225.0
},
"ltx|i2v|draft|121.0|any": {
"n": 5,
@@ -18305,7 +18773,7 @@
"p75_sec": 180.0
},
"ltx|i2v|high_720p|121.0|any": {
- "n": 17,
+ "n": 18,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -18317,7 +18785,7 @@
"p75_sec": 1800.0
},
"ltx|i2v|high_720p|241.0|any": {
- "n": 34,
+ "n": 35,
"p25_sec": 1200.0,
"p50_sec": 1200.0,
"p75_sec": 2400.0
@@ -18335,7 +18803,7 @@
"p75_sec": 180.0
},
"ltx|i2v|high|121.0|any": {
- "n": 461,
+ "n": 466,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 420.0
@@ -18347,9 +18815,9 @@
"p75_sec": 300.0
},
"ltx|i2v|high|169.0|any": {
- "n": 63,
+ "n": 64,
"p25_sec": 420.0,
- "p50_sec": 600.0,
+ "p50_sec": 510.0,
"p75_sec": 900.0
},
"ltx|i2v|high|193.0|any": {
@@ -18359,7 +18827,7 @@
"p75_sec": 600.0
},
"ltx|i2v|high|241.0|any": {
- "n": 350,
+ "n": 354,
"p25_sec": 420.0,
"p50_sec": 600.0,
"p75_sec": 900.0
@@ -18419,34 +18887,34 @@
"p75_sec": 180.0
},
"ltx|i2v|quick|105.0|any": {
- "n": 4,
- "p25_sec": 165.0,
- "p50_sec": 300.0,
- "p75_sec": 420.0
+ "n": 6,
+ "p25_sec": 63.8,
+ "p50_sec": 150.0,
+ "p75_sec": 360.0
},
"ltx|i2v|quick|113.0|any": {
- "n": 24,
- "p25_sec": 165.0,
+ "n": 25,
+ "p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
},
"ltx|i2v|quick|121.0|any": {
- "n": 520,
+ "n": 524,
"p25_sec": 90.0,
"p50_sec": 120.0,
"p75_sec": 240.0
},
"ltx|i2v|quick|129.0|any": {
- "n": 11,
+ "n": 18,
"p25_sec": 60.0,
"p50_sec": 60.0,
- "p75_sec": 240.0
+ "p75_sec": 120.0
},
"ltx|i2v|quick|137.0|any": {
- "n": 4,
- "p25_sec": 150.0,
- "p50_sec": 210.0,
- "p75_sec": 240.0
+ "n": 24,
+ "p25_sec": 120.0,
+ "p50_sec": 120.0,
+ "p75_sec": 120.0
},
"ltx|i2v|quick|145.0|any": {
"n": 22,
@@ -18461,7 +18929,7 @@
"p75_sec": 300.0
},
"ltx|i2v|quick|169.0|any": {
- "n": 84,
+ "n": 86,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -18515,7 +18983,7 @@
"p75_sec": 60.0
},
"ltx|i2v|quick|481.0|any": {
- "n": 272,
+ "n": 275,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -18527,27 +18995,27 @@
"p75_sec": 180.0
},
"ltx|i2v|quick|57.0|any": {
- "n": 4,
+ "n": 6,
"p25_sec": 120.0,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|i2v|quick|73.0|any": {
- "n": 305,
+ "n": 308,
"p25_sec": 60.0,
"p50_sec": 120.0,
"p75_sec": 240.0
},
"ltx|i2v|quick|81.0|any": {
- "n": 13,
- "p25_sec": 45.0,
+ "n": 14,
+ "p25_sec": 48.8,
"p50_sec": 120.0,
"p75_sec": 120.0
},
"ltx|i2v|quick|89.0|any": {
- "n": 7,
- "p25_sec": 52.5,
- "p50_sec": 60.0,
+ "n": 8,
+ "p25_sec": 56.2,
+ "p50_sec": 75.0,
"p75_sec": 180.0
},
"ltx|i2v|quick|97.0|any": {
@@ -18556,23 +19024,29 @@
"p50_sec": 60.0,
"p75_sec": 285.0
},
+ "ltx|i2v|standard|113.0|any": {
+ "n": 3,
+ "p25_sec": 240.0,
+ "p50_sec": 240.0,
+ "p75_sec": 420.0
+ },
"ltx|i2v|standard|121.0|any": {
- "n": 1543,
+ "n": 1679,
"p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
"ltx|i2v|standard|129.0|any": {
- "n": 3,
- "p25_sec": 60.0,
- "p50_sec": 60.0,
- "p75_sec": 90.0
+ "n": 15,
+ "p25_sec": 180.0,
+ "p50_sec": 240.0,
+ "p75_sec": 360.0
},
"ltx|i2v|standard|137.0|any": {
- "n": 9,
- "p25_sec": 60.0,
- "p50_sec": 60.0,
- "p75_sec": 120.0
+ "n": 60,
+ "p25_sec": 240.0,
+ "p50_sec": 300.0,
+ "p75_sec": 420.0
},
"ltx|i2v|standard|145.0|any": {
"n": 99,
@@ -18593,7 +19067,7 @@
"p75_sec": 292.5
},
"ltx|i2v|standard|169.0|any": {
- "n": 867,
+ "n": 900,
"p25_sec": 180.0,
"p50_sec": 300.0,
"p75_sec": 420.0
@@ -18623,7 +19097,7 @@
"p75_sec": 690.0
},
"ltx|i2v|standard|241.0|any": {
- "n": 1851,
+ "n": 1901,
"p25_sec": 300.0,
"p50_sec": 420.0,
"p75_sec": 600.0
@@ -18641,7 +19115,7 @@
"p75_sec": 172.5
},
"ltx|i2v|standard|289.0|any": {
- "n": 78,
+ "n": 81,
"p25_sec": 600.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -18695,28 +19169,28 @@
"p75_sec": 1200.0
},
"ltx|i2v|standard|49.0|any": {
- "n": 45,
- "p25_sec": 60.0,
- "p50_sec": 90.0,
+ "n": 48,
+ "p25_sec": 45.0,
+ "p50_sec": 60.0,
"p75_sec": 90.0
},
"ltx|i2v|standard|73.0|any": {
- "n": 362,
+ "n": 423,
"p25_sec": 60.0,
"p50_sec": 120.0,
"p75_sec": 180.0
},
"ltx|i2v|standard|81.0|any": {
- "n": 33,
+ "n": 37,
"p25_sec": 45.0,
"p50_sec": 45.0,
"p75_sec": 45.0
},
"ltx|i2v|standard|89.0|any": {
- "n": 9,
- "p25_sec": 45.0,
+ "n": 14,
+ "p25_sec": 48.8,
"p50_sec": 60.0,
- "p75_sec": 60.0
+ "p75_sec": 180.0
},
"ltx|i2v|standard|97.0|any": {
"n": 124,
@@ -18737,8 +19211,8 @@
"p75_sec": 825.0
},
"ltx|keyframe|balanced|241.0|any": {
- "n": 85,
- "p25_sec": 900.0,
+ "n": 87,
+ "p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 1200.0
},
@@ -18869,8 +19343,8 @@
"p75_sec": 600.0
},
"ltx|keyframe|standard|169.0|any": {
- "n": 15,
- "p25_sec": 900.0,
+ "n": 16,
+ "p25_sec": 750.0,
"p50_sec": 900.0,
"p75_sec": 1200.0
},
@@ -18881,7 +19355,7 @@
"p75_sec": 300.0
},
"ltx|keyframe|standard|241.0|any": {
- "n": 25,
+ "n": 26,
"p25_sec": 300.0,
"p50_sec": 600.0,
"p75_sec": 1200.0
@@ -18923,7 +19397,7 @@
"p75_sec": 120.0
},
"ltx|t2v|balanced|121.0|any": {
- "n": 2764,
+ "n": 2823,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 240.0
@@ -18941,7 +19415,7 @@
"p75_sec": 90.0
},
"ltx|t2v|balanced|169.0|any": {
- "n": 229,
+ "n": 244,
"p25_sec": 120.0,
"p50_sec": 240.0,
"p75_sec": 300.0
@@ -18959,7 +19433,7 @@
"p75_sec": 420.0
},
"ltx|t2v|balanced|241.0|any": {
- "n": 1097,
+ "n": 1118,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 600.0
@@ -18995,8 +19469,8 @@
"p75_sec": 15.0
},
"ltx|t2v|balanced|481.0|any": {
- "n": 25,
- "p25_sec": 300.0,
+ "n": 27,
+ "p25_sec": 360.0,
"p50_sec": 900.0,
"p75_sec": 900.0
},
@@ -19013,7 +19487,7 @@
"p75_sec": 78.8
},
"ltx|t2v|balanced|73.0|any": {
- "n": 455,
+ "n": 468,
"p25_sec": 90.0,
"p50_sec": 90.0,
"p75_sec": 120.0
@@ -19061,10 +19535,10 @@
"p75_sec": 1800.0
},
"ltx|t2v|high_720p|73.0|any": {
- "n": 7,
+ "n": 8,
"p25_sec": 120.0,
- "p50_sec": 240.0,
- "p75_sec": 300.0
+ "p50_sec": 270.0,
+ "p75_sec": 375.0
},
"ltx|t2v|high|1.0|any": {
"n": 16,
@@ -19079,8 +19553,8 @@
"p75_sec": 180.0
},
"ltx|t2v|high|121.0|any": {
- "n": 333,
- "p25_sec": 300.0,
+ "n": 345,
+ "p25_sec": 240.0,
"p50_sec": 420.0,
"p75_sec": 600.0
},
@@ -19091,13 +19565,13 @@
"p75_sec": 240.0
},
"ltx|t2v|high|169.0|any": {
- "n": 58,
+ "n": 63,
"p25_sec": 300.0,
"p50_sec": 300.0,
"p75_sec": 600.0
},
"ltx|t2v|high|241.0|any": {
- "n": 210,
+ "n": 214,
"p25_sec": 600.0,
"p50_sec": 900.0,
"p75_sec": 1200.0
@@ -19145,8 +19619,8 @@
"p75_sec": 180.0
},
"ltx|t2v|high|73.0|any": {
- "n": 100,
- "p25_sec": 135.0,
+ "n": 103,
+ "p25_sec": 180.0,
"p50_sec": 240.0,
"p75_sec": 300.0
},
@@ -19163,15 +19637,15 @@
"p75_sec": 150.0
},
"ltx|t2v|quick|121.0|any": {
- "n": 983,
+ "n": 1019,
"p25_sec": 60.0,
"p50_sec": 120.0,
"p75_sec": 180.0
},
"ltx|t2v|quick|145.0|any": {
- "n": 38,
+ "n": 41,
"p25_sec": 60.0,
- "p50_sec": 180.0,
+ "p50_sec": 150.0,
"p75_sec": 180.0
},
"ltx|t2v|quick|153.0|any": {
@@ -19187,10 +19661,10 @@
"p75_sec": 240.0
},
"ltx|t2v|quick|193.0|any": {
- "n": 14,
- "p25_sec": 150.0,
+ "n": 15,
+ "p25_sec": 180.0,
"p50_sec": 240.0,
- "p75_sec": 255.0
+ "p75_sec": 300.0
},
"ltx|t2v|quick|201.0|any": {
"n": 15,
@@ -19199,7 +19673,7 @@
"p75_sec": 180.0
},
"ltx|t2v|quick|241.0|any": {
- "n": 386,
+ "n": 387,
"p25_sec": 120.0,
"p50_sec": 240.0,
"p75_sec": 420.0
@@ -19241,7 +19715,7 @@
"p75_sec": 30.0
},
"ltx|t2v|quick|481.0|any": {
- "n": 135,
+ "n": 136,
"p25_sec": 240.0,
"p50_sec": 300.0,
"p75_sec": 300.0
@@ -19259,21 +19733,21 @@
"p75_sec": 300.0
},
"ltx|t2v|quick|73.0|any": {
- "n": 394,
- "p25_sec": 45.0,
+ "n": 402,
+ "p25_sec": 48.8,
"p50_sec": 90.0,
"p75_sec": 120.0
},
"ltx|t2v|quick|97.0|any": {
- "n": 52,
+ "n": 54,
"p25_sec": 60.0,
"p50_sec": 90.0,
"p75_sec": 120.0
},
"ltx|t2v|standard|121.0|any": {
- "n": 762,
+ "n": 781,
"p25_sec": 120.0,
- "p50_sec": 240.0,
+ "p50_sec": 180.0,
"p75_sec": 420.0
},
"ltx|t2v|standard|145.0|any": {
@@ -19283,10 +19757,10 @@
"p75_sec": 240.0
},
"ltx|t2v|standard|169.0|any": {
- "n": 174,
+ "n": 175,
"p25_sec": 180.0,
"p50_sec": 180.0,
- "p75_sec": 270.0
+ "p75_sec": 255.0
},
"ltx|t2v|standard|217.0|any": {
"n": 31,
@@ -19295,7 +19769,7 @@
"p75_sec": 600.0
},
"ltx|t2v|standard|241.0|any": {
- "n": 785,
+ "n": 832,
"p25_sec": 300.0,
"p50_sec": 600.0,
"p75_sec": 600.0
@@ -19307,7 +19781,7 @@
"p75_sec": 45.0
},
"ltx|t2v|standard|289.0|any": {
- "n": 3,
+ "n": 4,
"p25_sec": 180.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -19319,7 +19793,7 @@
"p75_sec": 600.0
},
"ltx|t2v|standard|361.0|any": {
- "n": 298,
+ "n": 300,
"p25_sec": 240.0,
"p50_sec": 240.0,
"p75_sec": 240.0
@@ -19343,7 +19817,7 @@
"p75_sec": 300.0
},
"ltx|t2v|standard|73.0|any": {
- "n": 90,
+ "n": 95,
"p25_sec": 120.0,
"p50_sec": 180.0,
"p75_sec": 180.0
@@ -19374,7 +19848,7 @@
"keyframe"
],
"schema": "fleet_timings/1",
- "total_events_counted": 112495,
+ "total_events_counted": 116945,
"wall_sec": "bucket_lower_edge",
"window_days": 75
}
diff --git a/docs/API.md b/docs/API.md
index 6f99306..711a79e 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -35,7 +35,7 @@ Add a job to the panel's queue. Returns immediately; the helper renders it async
| Field | Type | Note |
|---|---|---|
-| `mode` | `t2v` \| `i2v` \| `extend` \| `keyframe` \| `image` | Job type. |
+| `mode` | `t2v` \| `i2v` \| `extend` \| `keyframe` \| `a2v` \| `v2a` \| `image` | Job type. `v2a` (Add sound) is Hailuo H3 only. |
| `prompt` | string | Full prompt text. Trigger words for LoRAs go here. |
| `negative_prompt` | string | Optional. Honoured only where the pipeline runs classifier-free guidance: `high`, `extend`, `keyframe`, `a2v`. The distilled `quick` / `balanced` / `standard` paths have no guidance branch and ignore it (they used to fold the terms into the prompt, which made the model draw them, #81). |
| `width`, `height` | int | Both divisible by 32. |
@@ -62,6 +62,17 @@ Add a job to the panel's queue. Returns immediately; the helper renders it async
| `window_invariants` | What must not change between windows (who, where, light, lens). Re-injected into every later window. |
| `loras` | JSON-encoded array | See LoRA payload below. |
+**Hailuo H3 (`engine=h3`), 4.19 fields.** H3 renders `t2v`, `i2v`, `keyframe`, `extend`, `a2v` and `v2a`; each mode past `i2v` needs a flag on the INSTALLED runner (`/status.h3.keyframes` / `.extend` / `.audio_drive` / `.video_to_audio`), and a job for one the runner lacks renders on LTX with a sentence (Add sound has no LTX lane and is refused with the update sentence instead).
+
+| Field | Type | Note |
+|---|---|---|
+| `h3_quality`, `h3_length` | string | The cell. `h3_quality=fast_hd` = the 640×384 Fast pass + Upscale & Face Fix to 1280×768, queued together; Fast and the fix are forced. |
+| `h3_continuity` | `on` \| `off` | Default `on`: a chained window carries the last 17 frames of the previous one and their sound (`--chain-context-frames 17`). `off` = the one-still hand-over. |
+| `start_image`, `end_image`, `keyframes_json` | path / JSON | `mode=keyframe`. On H3 the start frame is optional (an end frame alone is MiniMax's last-frame task); `keyframes_json` beats land at their `frame_index` on the 24 fps timeline. |
+| `video_path`, `h3_extend_seconds` | path / float | `mode=extend`: any clip, continued from its last 17 frames and their sound; 0.5–15 s added after it. |
+| `audio`, `image`, `frames`, `audio_start_time`, `audio_stem_auto` | | `mode=a2v` with `engine=h3`: the track is held exactly and the picture rendered to it; `frames` (24 fps) is the length, capped at the audio left after `audio_start_time` and at 30 s; `audio_stem_auto=on` conditions on the separated vocal and delivers the original. |
+| `video_path` | path | `mode=v2a` (Add sound, H3 only): the clip's picture is kept exactly and only its sound is generated; up to 60 s. |
+
**LoRA payload:** the `loras` field is a JSON-encoded array of `{path, strength}` objects. Stack as many as needed: On Hailuo H3, stacking needs the engine's repeatable `--lora` (`/status.h3.loras.max_stack` > 1); an older pack takes one adapter and the `h3_lora_slot` field decides whether it goes to Turbo or to the LoRA.
```json
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index bf77b71..8311c1d 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -39,6 +39,10 @@ webapp/ ← the frontend, as plain files served from disk
└── panel.css ← ALL panel CSS (slice 1, landed)
mlx_warm_helper.py ← the render subprocess (JSON over stdin/stdout);
not part of the web frontend at all
+extend_splice.py ← an Extend's delivery (issue #48): the source file's
+ own frames (H.264 copied bit-exact when possible) +
+ only the new frames, audio encoded once from a
+ lossless master; numpy + ffmpeg, no model
ltx_windows.py ← PURE: the sliding-window schedule and per-window
prompt contract for long LTX clips; the panel turns
it into one generate + N extend calls
diff --git a/docs/H3_ENGINE.md b/docs/H3_ENGINE.md
index c3eecca..9340a29 100644
--- a/docs/H3_ENGINE.md
+++ b/docs/H3_ENGINE.md
@@ -368,6 +368,77 @@ The dense 10 s tier ("10s single pass") ships visible by default, always —
`LTX_H3_DENSE_10S` is not read anywhere and restores nothing; see the
constants table above.
+### Media modes (4.19): Keyframes, Extend, Lip-sync, Add sound, carried context
+
+All of these ride on the packed sequence the reference already defines —
+video conditioning rows held at the keyframe noise level (0.999), audio
+conditioning rows held clean, and per-row timesteps — and on runner flags the
+panel probes on the INSTALLED runner (`/status.h3.keyframes`, `.continuation`,
+`.extend`, `.audio_drive`, `.video_to_audio`). An older pack falls back to LTX
+with a sentence (Add sound, which has no LTX lane, is refused with the update
+sentence). The panel-side map is `h3_media_plan()` in `mlx_ltx_panel.py`.
+
+| Capability | Runner flags | What the model sees |
+|---|---|---|
+| Carried context (chained 10 s / 15 s, Extend, Add sound) | `--chain-context-frames 17`, `--seam-colour-frames 24` | the previous window's last 17 frames as history rows placed just BEFORE the target on the rotary clock (one VAE clip, 5 latents), plus their sound as clean audio rows from the same instant; the hand-over frame stays the "first" anchor. Each window's grade is eased onto the carried frame over 24 frames. |
+| Start & end frame / Keyframes | `--first-frame`, `--last-frame`, `--keyframe PATH@FRAME` | MiniMax's FL2VA / L2VA tasks; a timed still is a `frame:<i>` anchor at `origin + i·5/3` (the same clock every target frame lives on). Each still also goes to the vision tower as `<Picture n>`, and the official alignment sentence is prepended when the prompt has none. On a chain each still is routed to the window that owns its frame. The start frame is optional on H3. |
+| Extend | `--extend-from SRC --extend-frames N` | the source is window 0; new 5 s windows continue from its last 17 frames and their sound. Output = source (on the H3 canvas) + N frames. Sources up to 60 s (the decoded source is held through the render). |
+| Lip-sync | `--audio-drive TRACK [--audio-mux ORIGINAL]` | the track is written into the TARGET audio rows and held clean (t = 1) for every step; only the picture is denoised. The delivered audio is the user's file, never the VAE round trip. "Voice only" conditions on the demucs vocal stem and delivers the mix. |
+| Add sound | `--video-to-audio SRC` | the clip is written into the TARGET video rows and held clean; only the audio is denoised. The delivery is the source's own video stream (`-c:v copy`) with the new track — no export re-encode, no Face Fix. |
+| Fast HD (quality) | the Draft canvas + Fast, then `mode=upscale` (start = source, 1 refine step — the "face kept" recipe) | H3 at 640×384 on the 3-step pass, LTX's x2 Upscale & Face Fix to 1280×768, queued together. |
+
+#### Measured (M4 Max 64 GB, Q8 DiT, 2026-10-07)
+
+Seam = the first frame of a new window. "Jump" = the change across the seam over the
+median frame-to-frame change around it (1.0 = invisible). Sound step = RMS 0.25 s after
+minus 0.25 s before.
+
+| Chain | Sound step at seams | Colour jump (eased) | Motion jump (eased) | Time |
+|---|---|---|---|---|
+| High 10 s, one still per window | +5.7 dB | 0.85 | 1.30 | 1008 s |
+| High 10 s, carried context | −0.9 dB | 1.81 | 1.14 | 1131 s |
+| Standard 15 s ×2 seeds, one still | avg 3.4 dB (worst 7.6) | avg 1.02 | avg 0.93 | 769 s |
+| Standard 15 s ×2 seeds, carried | avg 1.3 dB (worst 2.4) | avg 1.20 | avg 1.08 | 862 s |
+
+Without the easing the colour jump is 10–40× on either path — the grade step is a
+per-window decode artefact and the easing is what removes it. What carried context buys
+is the sound: the level and timbre continue across the seam (spectral similarity at the
+second seam 0.85/0.89 → 0.89/0.91, random-pair baseline 0.94). Transcripts were complete
+and identical on every chain.
+
+Other modes, High (1024×576) unless noted:
+
+- Keyframes, first + last, 5 s: normalised cross-correlation 1.000 at frame 0 and frame
+ 123; ArcFace median 0.956 against the reference stills; 545 s.
+- Extend, 5 s source + 5 s: seam motion 1.60, colour 1.35, sound −0.8 dB, voice
+ similarity 0.997; the dialogue continues; ArcFace 0.927; 606 s.
+- Lip-sync, 10 s spoken voice on a still: mouth/audio correlation 0.35 without the
+ character LoRA, 0.47 with it (native H3 dialogue renders: −0.24…0.38); ArcFace 0.82 /
+ 0.83; ~1110–1170 s. A song on its full mix scores −0.08 (the mouth stops after ~2 s) —
+ songs need Voice only (the vocal stem).
+- Add sound, Draft canvas, a talking clip with its audio removed: the line comes back
+ word for word on the lips (correlation 0.71, peak −7.9 dB); video stream byte-identical
+ to the source; 187 s for 5 s.
+
+#### Fast HD
+
+Same Bizarro prompt, still and seed, 5 s (124 frames):
+
+| Recipe | Output | Time | ArcFace median (min) |
+|---|---|---|---|
+| Fast HD: 640×384 Fast + x2 Face Fix, 1 step | 1280×768 | 181 + 158 = 339 s | 0.891 (0.841) |
+| 640×384 Fast + x2 Face Fix, 3 steps | 1280×768 | 181 + 357 = 538 s | 0.850 (0.818) |
+| High Fast (1024×576) | 1024×576 | 535 s | 0.914 (0.839) |
+| High Best (1024×576, 15 forwards) | 1024×576 | 2253 s | 0.922 (0.902) |
+| Native Best (1344×768, 8 forwards) | 1344×768 | 2888 s | 0.926 (0.886) |
+
+The 3-step finish redraws the face and costs as much as High Fast, so Fast HD uses the
+1-step "face kept" recipe. bf16 DiT on High Fast: 512 s, ArcFace 0.911, peak 42.6 GiB
+(Q8: 25.1 GiB) — not adopted. Skipping the 5 smallest-gate DiT blocks (`--skip-blocks
+auto:5`): 489 s, ArcFace 0.892 (min 0.814), visible expression change at the same seed —
+not adopted; the flag stays in the runner for research only.
+
+
### Export pass — the same post-process LTX renders get
Draft writes 640×384 (5:3) and Standard 768×448 (12:7), neither of them 720p
@@ -557,11 +628,12 @@ is hidden entirely on a pack that predates it.
## What H3 does *not* do
-- **Modes**: Text and Image only. Every other mode (FFLF, Extend, Remix,
- Character, A2V) is LTX-pipeline-specific; the picker snaps back to LTX with a
- note. Character does too — it submits `mode=t2v` but stacks **LTX** LoRAs, and
- those cannot load on H3 (see LoRAs below, which is about H3's own library).
-- **LoRA STACKING**: H3 takes exactly one adapter — see LoRAs below.
+- **Modes**: Remix and Character are LTX-pipeline-specific; the picker snaps
+ back to LTX with a note. Character submits `mode=t2v` but stacks **LTX**
+ LoRAs, and those cannot load on H3 (see LoRAs above, which is about H3's own
+ library). Text, Image, Keyframes, Extend, Lip-sync and Add sound all render
+ on H3 since 4.19 — see "Media modes" above.
+- **LoRA STACKING**: up to four adapters on a stacking runner — see LoRAs above.
- **Orientation, accel, temporal interpolation, the LTX upscale control**: none
apply. Those carry `data-ltx-only` and fold away under
`body[data-engine="h3"]`. H3 has its own export control (`h3_upscale`,
@@ -575,8 +647,20 @@ FL2VA first-frame conditioning landed on the engine repo **after** the branch
installed `scripts/generate_staged.py` for the flag
(`h3_supports_first_frame()`), reports it as `/status.h3.first_frame`, and keeps
Image mode on LTX when it's absent — so an older checkout degrades to Text-only
-instead of dying 30 s into a render with an argparse error. **Bump `H3_BRANCH`
-in `install_h3.js` once the first-frame work is published.**
+instead of dying 30 s into a render with an argparse error. (Historical: the
+first-frame work has long been published.)
+
+### The engine pin (4.19.0)
+
+The engine an install runs is an exact commit: `H3_PIN_SHA` + `H3_PIN_REF` in
+`scripts/pinokio/h3_checkout.sh`, called by both `install_h3.js` (Install,
+Repair, "Update Hailuo H3 runner") and `scripts/post_update.sh` (Update, and
+the panel's Update now). Through 4.18.x it was the tip of
+`codex/h3-engine-v2`, so a push to that branch reached every install with no
+release behind it. To move the engine: push the commit to a ref on
+`mrbizarro/minimax-h3-mlx` (a new branch or tag — never force-move one), change
+both lines in one commit, and ship it in a Phosphene release.
+`test_h3_engine_pin.py` pins the behaviour.
---
diff --git a/docs/RELEASE_CHECKLIST.md b/docs/RELEASE_CHECKLIST.md
index 6ab00da..c308a13 100644
--- a/docs/RELEASE_CHECKLIST.md
+++ b/docs/RELEASE_CHECKLIST.md
@@ -28,12 +28,23 @@ bash scripts/release_gates.sh # everything (~2 min)
bash scripts/release_gates.sh --fast # skips the two slowest
```
+- **The gates need pytest in the repo venv** — users never do, so no install
+ pins it: `ltx-2-mlx/env/bin/python -m pip install pytest`. Without it the
+ pytest-style suites are a loud SKIP, never a pass.
+- **The gates need a real install, not a bare clone.** `ltx-2-mlx/` (the
+ vendored engine and its venv) is gitignored and created by `install.js`, and
+ the registry gate reads the weights under `mlx_models/`. Run them inside an
+ installed Phosphene (or a worktree whose `ltx-2-mlx` and `mlx_models` point
+ at one); a fresh `git clone` cannot run them.
+
It runs every check on this page that a command can run — `py_compile`, the
three `node` gates, `assert_registry`, `assert_schedules`, `check_output_codec`
-(§3a), the whole root `test_*.py` sweep, and `scripts/test_*.py` **through
-pytest** (three of those suites are pytest-style; `python -m unittest` collects
-zero tests from them and prints a green "Ran 0 tests / OK" that asserts
-nothing). It prints a PASS/FAIL/SKIP table and exits non-zero on any failure.
+(§3a), the whole root `test_*.py` sweep, and `scripts/test_*.py` — every
+pytest-style file (module-level `def test_*`) **through pytest**, because
+`python -m unittest` collects zero tests from those and prints a green "Ran 0
+tests / OK" that asserts nothing. Each suite runs in its own empty state/
+outputs/uploads sandbox. It prints a PASS/FAIL/SKIP table, lists every test
+skipped inside a passing suite, and exits non-zero on any failure.
**A SKIP is not a PASS** — it means the gate could not run.
**Key every public step on the runner's exit code, explicitly.** On 2026-09-08 a
diff --git a/extend_splice.py b/extend_splice.py
new file mode 100644
index 0000000..67d7afe
--- /dev/null
+++ b/extend_splice.py
@@ -0,0 +1,473 @@
+"""Extend delivery: the clip you already had, untouched, plus the part the model made.
+
+Issue #48 — "progressive audio/video distortion when using Extend".
+
+WHY THIS EXISTS. Extend conditions the model on the source clip, and the
+model never re-denoises that region (LTX carries it with ``denoise_mask = 0``;
+H3 holds it as window 0 of the timeline). But both engines used to DELIVER the
+source region as the model pipeline's own copy of it, so every round put the
+whole accumulated clip through one more lossy generation:
+
+* LTX: the entire clip was VAE-encoded and decoded again, its audio resampled
+ to 16 kHz for the audio VAE and re-synthesised to 48 kHz by the vocoder
+ (everything above 8 kHz discarded and re-invented), and the result written
+ at the output preset (yuv420p / CRF 18 by default) — per round, over the
+ whole clip, compounding.
+* H3: the source was decoded, cover-scaled onto the canvas, its audio
+ resampled to 32 kHz, and the whole clip re-encoded at CRF 18 + AAC — again
+ per round, and the gallery's 720p export (which the Extend picker offers)
+ added a lanczos down-and-up resample on top.
+
+The fix keeps the model's conditioning exactly as it was and changes only the
+DELIVERY: the source region is the source file itself, the new region is what
+the model made, joined at the seam.
+
+* Video — the source's H.264 packets are copied bit-exact (concat demuxer,
+ ``-c copy``) whenever the source can be continued that way: same codec,
+ canvas and frame rate, every one of its frames used by the model, and the
+ new part's encoder parameter sets (``avcC``) byte-identical to the source's.
+ Otherwise (a first hop from a foreign file, a downscaled copy, a changed
+ output preset) the source is decoded ONCE from the file the user picked and
+ encoded once together with the new part — a single generation, after which
+ the next round is a copy again.
+* Audio — AAC cannot be concatenated without its priming/padding showing at
+ the splice, and re-encoding the previous round's AAC accumulates (measured:
+ 34.1 -> 32.2 -> 29.8 dB SNR over three tandem rounds at 192 kb/s). So every
+ extend output keeps a lossless 48 kHz FLAC "audio master" in a dot-folder,
+ and each round's AAC is encoded ONCE from master PCM. The source region of
+ that PCM is byte-identical round after round, so the delivered audio is
+ always exactly one generation from what the user had — never two.
+* Seam — a short linear crossfade (40 ms, ending on the seam) from the
+ source audio into the generated track. Linear, not equal-power: just before
+ the seam the generated track is the model's re-synthesis of the SAME sound,
+ so the two signals are correlated and an equal-power pair would bump the
+ level. No video blend: the first new frame continues the model's decode of
+ the last source frame, and the measured seam jump is reported per job.
+
+This module is pure apart from ffmpeg/ffprobe: every ffmpeg call goes through
+the ``run(cmd, label)`` callable the caller passes (the panel passes its
+cancellable ``run_ffmpeg_tracked``), so it is unit-testable on synthetic clips
+without a GPU.
+"""
+from __future__ import annotations
+
+import json
+import subprocess
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Callable
+
+import numpy as np
+
+SAMPLE_RATE = 48000
+CHANNELS = 2
+FADE_SECONDS = 0.040
+AUDIO_BITRATE = "192k"
+# LTX's video VAE is causal in time: latent frame 0 holds one pixel frame and
+# every later latent holds 8, so the extend pipeline only ever sees the first
+# 1 + 8k frames of its source (retake.py `_encode_source_video`).
+VAE_TIME_STRIDE = 8
+
+Runner = Callable[[list, str], object]
+
+
+class SpliceError(RuntimeError):
+ """The splice could not produce a verified file (the caller keeps the
+ model's own output, i.e. the pre-#48 delivery, and says so)."""
+
+
+# --------------------------------------------------------------------------
+# Layout: which frames of which file go where
+# --------------------------------------------------------------------------
+
+@dataclass(frozen=True)
+class Layout:
+ source_frames: int # frames of the SOURCE file the delivery keeps
+ new_start: int # first generated frame that is new
+ new_end: int # one past the last generated frame that is new
+ source_first: bool # True = extend after, False = extend before
+
+ @property
+ def new_frames(self) -> int:
+ return self.new_end - self.new_start
+
+ @property
+ def total_frames(self) -> int:
+ return self.source_frames + self.new_frames
+
+ @property
+ def seam_frame(self) -> int:
+ """Index in the DELIVERED clip of the first frame after the seam."""
+ return self.source_frames if self.source_first else self.new_frames
+
+
+def ltx_source_frames(n_source: int) -> int:
+ """How many leading frames of an n-frame source the LTX extend pipeline
+ encodes (1 + 8k, rounded down; any remainder is dropped by the model)."""
+ if n_source < 1:
+ raise SpliceError("the source has no frames")
+ return 1 + VAE_TIME_STRIDE * max(0, (n_source - 1) // VAE_TIME_STRIDE)
+
+
+def ltx_layout(n_source: int, n_generated: int, direction: str = "after") -> Layout:
+ """LTX extend: the decoded output holds the K = 1+8k source frames plus
+ 8 per new latent, new ones after (or before) the source region."""
+ k = ltx_source_frames(n_source)
+ new = n_generated - k
+ if new < 1:
+ raise SpliceError(f"the model returned {n_generated} frames for a "
+ f"{k}-frame source — no new frames to splice")
+ if direction == "before":
+ return Layout(source_frames=k, new_start=0, new_end=new, source_first=False)
+ return Layout(source_frames=k, new_start=k, new_end=n_generated, source_first=True)
+
+
+def h3_layout(n_generated: int, new_frames: int) -> Layout:
+ """H3 extend: the runner delivers its source frames followed by exactly
+ ``new_frames`` new ones (`--extend-frames`). Forward only."""
+ src = n_generated - int(new_frames)
+ if src < 1 or new_frames < 1:
+ raise SpliceError(f"the H3 runner returned {n_generated} frames for "
+ f"{new_frames} new ones — nothing to splice")
+ return Layout(source_frames=src, new_start=src, new_end=n_generated, source_first=True)
+
+
+# --------------------------------------------------------------------------
+# Audio: pure numpy
+# --------------------------------------------------------------------------
+
+def crossfade_splice(source: np.ndarray, generated: np.ndarray, seam: int,
+ fade: int, source_first: bool = True) -> np.ndarray:
+ """Join source PCM and generated PCM at sample ``seam`` of the delivered
+ timeline, both ``(channels, samples)`` float32.
+
+ ``source_first`` (extend after): ``generated`` is on the delivered
+ timeline (sample 0 = clip start, its first ``seam`` samples are the
+ model's copy of the source). Output = source[:seam-fade], a linear fade
+ from source to generated over [seam-fade, seam), then generated[seam:].
+ A source shorter than the seam hands over where it ends instead.
+
+ Extend before: ``generated`` holds the new part in [0, seam) followed by
+ the model's copy of the source; ``source`` starts at the seam. Output =
+ generated[:seam], a fade from generated into the source over its first
+ ``fade`` samples, then the rest of the source.
+ """
+ source = np.asarray(source, dtype=np.float32)
+ generated = np.asarray(generated, dtype=np.float32)
+ if source.ndim != 2 or generated.ndim != 2 or source.shape[0] != generated.shape[0]:
+ raise SpliceError("source and generated audio must both be (channels, samples)")
+ seam = max(0, int(seam))
+ if source_first:
+ hand = min(seam, source.shape[1], generated.shape[1])
+ f = max(0, min(int(fade), hand))
+ head = source[:, :hand - f]
+ if f:
+ w = ((np.arange(f, dtype=np.float32) + 0.5) / f)[None, :]
+ mid = source[:, hand - f:hand] * (1.0 - w) + generated[:, hand - f:hand] * w
+ else:
+ mid = np.zeros((source.shape[0], 0), np.float32)
+ return np.concatenate([head, mid, generated[:, hand:]], axis=1)
+ hand = min(seam, generated.shape[1])
+ f = max(0, min(int(fade), source.shape[1], generated.shape[1] - hand))
+ if f:
+ w = ((np.arange(f, dtype=np.float32) + 0.5) / f)[None, :]
+ mid = generated[:, hand:hand + f] * (1.0 - w) + source[:, :f] * w
+ else:
+ mid = np.zeros((source.shape[0], 0), np.float32)
+ return np.concatenate([generated[:, :hand], mid, source[:, f:]], axis=1)
+
+
+def fit_length(pcm: np.ndarray, samples: int) -> np.ndarray:
+ """Pad with silence or cut to exactly ``samples``."""
+ samples = max(0, int(samples))
+ if pcm.shape[1] >= samples:
+ return np.ascontiguousarray(pcm[:, :samples])
+ return np.pad(pcm, ((0, 0), (0, samples - pcm.shape[1])))
+
+
+# --------------------------------------------------------------------------
+# Probing
+# --------------------------------------------------------------------------
+
+def probe(ffprobe: str | Path, path: str | Path) -> dict:
+ """Codec, canvas, pix_fmt, frame rate, frame count (packets) and whether
+ there is an audio stream. Raises SpliceError on an unreadable file."""
+ r = subprocess.run(
+ [str(ffprobe), "-v", "error", "-count_packets", "-show_entries",
+ "stream=codec_type,codec_name,width,height,pix_fmt,avg_frame_rate,"
+ "r_frame_rate,nb_read_packets,start_time", "-of", "json", str(path)],
+ capture_output=True, text=True, errors="replace", timeout=120)
+ try:
+ streams = json.loads(r.stdout or "{}").get("streams") or []
+ except ValueError:
+ streams = []
+ v = next((s for s in streams if s.get("codec_type") == "video"), None)
+ if r.returncode != 0 or v is None:
+ raise SpliceError(f"cannot read the video stream of {Path(path).name}")
+
+ def _rate(s: str | None) -> float:
+ num, _, den = str(s or "0/1").partition("/")
+ try:
+ return float(num) / float(den or 1)
+ except (ValueError, ZeroDivisionError):
+ return 0.0
+
+ fps = _rate(v.get("avg_frame_rate")) or _rate(v.get("r_frame_rate"))
+ a = next((s for s in streams if s.get("codec_type") == "audio"), None)
+
+ def _start(s: dict | None) -> float:
+ try:
+ return float((s or {}).get("start_time") or 0.0)
+ except (TypeError, ValueError):
+ return 0.0
+
+ return {
+ # Where the audio starts on the VIDEO's clock (Codex 4.19.0): an
+ # imported clip whose sound starts later (or earlier) than its first
+ # frame must not have that offset dropped when it is decoded to PCM.
+ "audio_offset": (_start(a) - _start(v)) if a is not None else 0.0,
+ "codec": v.get("codec_name"), "width": int(v.get("width") or 0),
+ "height": int(v.get("height") or 0), "pix_fmt": v.get("pix_fmt"),
+ "fps": fps, "frames": int(v.get("nb_read_packets") or 0),
+ "has_audio": any(s.get("codec_type") == "audio" for s in streams),
+ }
+
+
+def avcc(path: str | Path) -> bytes | None:
+ """The H.264 decoder configuration record (SPS + PPS) of an mp4, or None.
+
+ Two streams can only be joined packet-for-packet when this is
+ byte-identical: the joined file carries ONE sample description, so a new
+ part whose parameter sets differ (another CRF, profile, colour tags, x264
+ build) would be decoded with the source's and break."""
+ try:
+ data = Path(path).read_bytes()
+ except OSError:
+ return None
+ i = data.find(b"avcC")
+ if i < 4:
+ return None
+ size = int.from_bytes(data[i - 4:i], "big")
+ if size < 8 or i - 4 + size > len(data):
+ return None
+ return data[i + 4:i - 4 + size]
+
+
+# --------------------------------------------------------------------------
+# Assembly
+# --------------------------------------------------------------------------
+
+def _read_pcm(run: Runner, ffmpeg: str, src: Path, raw: Path, label: str,
+ offset: float = 0.0) -> np.ndarray:
+ """The audio as (channels, samples) on the VIDEO's timeline: ``offset``
+ seconds (audio start minus video start) are padded with silence when
+ positive and trimmed when negative, so sample 0 is the first frame's."""
+ run([ffmpeg, "-y", "-v", "error", "-i", str(src), "-map", "0:a:0", "-vn",
+ "-ac", str(CHANNELS), "-ar", str(SAMPLE_RATE), "-f", "f32le", str(raw)], label)
+ data = np.fromfile(raw, dtype="<f4")
+ data = data[: data.size - data.size % CHANNELS]
+ pcm = np.ascontiguousarray(data.reshape(-1, CHANNELS).T)
+ shift = int(round(float(offset or 0.0) * SAMPLE_RATE))
+ if shift > 0:
+ pcm = np.concatenate([np.zeros((CHANNELS, shift), dtype=pcm.dtype), pcm], axis=1)
+ elif shift < 0:
+ pcm = pcm[:, -shift:]
+ return np.ascontiguousarray(pcm)
+
+
+def _write_master(run: Runner, ffmpeg: str, pcm: np.ndarray, raw: Path, master: Path) -> None:
+ np.ascontiguousarray(pcm.T, dtype="<f4").tofile(raw)
+ master.parent.mkdir(parents=True, exist_ok=True)
+ partial = master.with_name(master.name + ".partial")
+ run([ffmpeg, "-y", "-v", "error", "-f", "f32le", "-ar", str(SAMPLE_RATE),
+ "-ac", str(CHANNELS), "-i", str(raw), "-c:a", "flac", "-sample_fmt", "s16",
+ "-f", "flac", str(partial)], "Extend: audio master")
+ partial.replace(master)
+
+
+def _master_matches(master: Path | None, seconds: float) -> bool:
+ """A master is only trusted when it still describes the source: same
+ length to within a frame (a clip trimmed or replaced since must not get
+ the old soundtrack back)."""
+ if not master:
+ return False
+ try:
+ size = master.stat().st_size
+ except OSError:
+ return False
+ return size > 0 and abs(_flac_seconds(master) - seconds) <= 0.05
+
+
+def _flac_seconds(path: Path) -> float:
+ """Duration of a FLAC file from its STREAMINFO block (no ffprobe)."""
+ try:
+ with open(path, "rb") as fh:
+ head = fh.read(42)
+ if head[:4] != b"fLaC":
+ return -1.0
+ info = head[8:8 + 34]
+ sr = (info[10] << 12) | (info[11] << 4) | (info[12] >> 4)
+ total = ((info[13] & 0x0F) << 32) | int.from_bytes(info[14:18], "big")
+ return total / float(sr) if sr else -1.0
+ except OSError:
+ return -1.0
+
+
+def splice(*, ffmpeg: str | Path, ffprobe: str | Path, source: Path, generated: Path,
+ generated_audio: Path | None, out: Path, layout: Layout, work: Path,
+ pix_fmt: str, crf: str, x264_args: list[str] | None = None,
+ generated_lossless: bool = True, source_master: Path | None = None,
+ master_out: Path | None = None, run: Runner | None = None) -> dict:
+ """Write ``out`` = the source's own frames + the generated new frames,
+ with the audio spliced from lossless masters and encoded once.
+
+ ``generated`` is the model's full output (source region + new), on the
+ delivered canvas; ``generated_lossless`` says whether its video is a
+ lossless intermediate (re-encode the new part once) or already the
+ delivery codec (H3's runner without ``--crf 0``). ``generated_audio`` is
+ a lossless wav of the same timeline when the engine leaves one (the
+ helper's vocoder output, the H3 runner's wav), else the audio is read
+ from ``generated``. Returns a report dict for the sidecar.
+ """
+ run = run or _default_run
+ ffmpeg, ffprobe = str(ffmpeg), str(ffprobe)
+ x264 = list(x264_args or [])
+ work.mkdir(parents=True, exist_ok=True)
+ src = probe(ffprobe, source)
+ gen = probe(ffprobe, generated)
+ fps = gen["fps"] or src["fps"]
+ if not fps:
+ raise SpliceError("unknown frame rate")
+ if gen["frames"] < layout.new_end:
+ raise SpliceError(f"the model's output has {gen['frames']} frames, the "
+ f"splice needs {layout.new_end}")
+ report = {"version": 1, "source": str(source), "source_frames": layout.source_frames,
+ "new_frames": layout.new_frames, "seam_frame": layout.seam_frame,
+ "seam_seconds": round(layout.seam_frame / fps, 4),
+ "direction": "after" if layout.source_first else "before"}
+ same_canvas = (src["width"], src["height"]) == (gen["width"], gen["height"])
+ same_rate = abs((src["fps"] or 0) - fps) < 0.01
+ enc = ["-c:v", "libx264", "-pix_fmt", pix_fmt, "-crf", str(crf), *x264]
+
+ # ---- video --------------------------------------------------------------
+ video = work / "video.mp4"
+ mode = None
+ why = ""
+ if not (same_canvas and same_rate):
+ why = (f"source {src['width']}x{src['height']}@{src['fps']:.3f} differs from the "
+ f"render {gen['width']}x{gen['height']}@{fps:.3f}")
+ elif src["frames"] < layout.source_frames:
+ why = f"source has {src['frames']} frames, the model used {layout.source_frames}"
+ if why:
+ # Nothing of the source file can stand in for the model's input here:
+ # deliver the model's own frames (its source region was decoded once
+ # from the picked file), exactly the pre-#48 delivery for this round.
+ mode = "generated"
+ if generated_lossless:
+ run([ffmpeg, "-y", "-v", "error", "-i", str(generated), "-map", "0:v:0", "-an",
+ *enc, str(video)], "Extend: encode")
+ else:
+ run([ffmpeg, "-y", "-v", "error", "-i", str(generated), "-map", "0:v:0", "-an",
+ "-c:v", "copy", str(video)], "Extend: video")
+ else:
+ new_part = work / "new.mp4"
+ sel = f"select='between(n\\,{layout.new_start}\\,{layout.new_end - 1})',setpts=N/FRAME_RATE/TB"
+ run([ffmpeg, "-y", "-v", "error", "-i", str(generated), "-map", "0:v:0", "-an",
+ "-vf", sel, "-frames:v", str(layout.new_frames), *enc, str(new_part)],
+ "Extend: new frames")
+ copy_ok = (src["codec"] == "h264" and src["frames"] == layout.source_frames
+ and avcc(new_part) is not None and avcc(new_part) == avcc(source))
+ if copy_ok:
+ src_v = work / "source_video.mp4"
+ run([ffmpeg, "-y", "-v", "error", "-i", str(source), "-map", "0:v:0", "-an",
+ "-c", "copy", str(src_v)], "Extend: source video")
+ parts = [src_v, new_part] if layout.source_first else [new_part, src_v]
+ lst = work / "concat.txt"
+ lst.write_text("".join("file '" + str(p).replace("'", "'\\''") + "'\n"
+ for p in parts), encoding="utf-8")
+ try:
+ run([ffmpeg, "-y", "-v", "error", "-f", "concat", "-safe", "0",
+ "-i", str(lst), "-c", "copy", str(video)], "Extend: join")
+ got = probe(ffprobe, video)["frames"]
+ except Exception: # noqa: BLE001
+ got = -1
+ if got == layout.total_frames:
+ mode = "copy"
+ else:
+ why = f"stream-copy join came out at {got} frames, not {layout.total_frames}"
+ else:
+ why = ("source is not an H.264 stream the new part can continue "
+ "(codec, frame count or encoder parameter sets differ)")
+ if mode is None:
+ # Decode the picked file ONCE (never a re-decoded copy of it) and
+ # encode it together with the new frames: one generation.
+ a, b = layout.new_start, layout.new_end
+ chains = (f"[0:v]trim=end_frame={layout.source_frames},setpts=PTS-STARTPTS,"
+ f"setsar=1,format={pix_fmt}[s];"
+ f"[1:v]trim=start_frame={a}:end_frame={b},setpts=PTS-STARTPTS,"
+ f"setsar=1,format={pix_fmt}[n];")
+ chains += "[s][n]concat=n=2:v=1:a=0[v]" if layout.source_first \
+ else "[n][s]concat=n=2:v=1:a=0[v]"
+ run([ffmpeg, "-y", "-v", "error", "-i", str(source), "-i", str(generated),
+ "-filter_complex", chains, "-map", "[v]", "-an", *enc, str(video)],
+ "Extend: re-encode once")
+ mode = "reencode"
+ report["video"] = mode
+ if why:
+ report["video_note"] = why
+ total = probe(ffprobe, video)["frames"]
+ if mode != "generated" and total != layout.total_frames:
+ raise SpliceError(f"spliced video has {total} frames, expected {layout.total_frames}")
+ report["frames"] = total
+
+ # ---- audio --------------------------------------------------------------
+ seconds_total = total / fps
+ n_total = int(round(seconds_total * SAMPLE_RATE))
+ g_src = generated_audio if (generated_audio and Path(generated_audio).is_file()) else generated
+ gen_pcm = _read_pcm(run, ffmpeg, Path(g_src), work / "gen.f32", "Extend: generated audio",
+ offset=gen.get("audio_offset", 0.0) if g_src == generated else 0.0)
+ # The audio is spliced whatever happened to the picture: it is a time-domain
+ # signal, and the source region spans the same seconds either way.
+ src_seconds = src["frames"] / (src["fps"] or fps)
+ if _master_matches(source_master, src_seconds):
+ src_pcm = _read_pcm(run, ffmpeg, Path(source_master), work / "src.f32",
+ "Extend: source audio master")
+ report["audio"] = "master"
+ elif src["has_audio"]:
+ src_pcm = _read_pcm(run, ffmpeg, source, work / "src.f32", "Extend: source audio",
+ offset=src.get("audio_offset", 0.0))
+ report["audio"] = "decoded"
+ else:
+ src_pcm = np.zeros((CHANNELS, int(round(src_seconds * SAMPLE_RATE))), np.float32)
+ report["audio"] = "silent-source"
+ # Only the stretch the model used: a source longer than its 1+8k frames
+ # loses the same tail in the audio as in the picture.
+ src_pcm = src_pcm[:, :int(round(layout.source_frames / fps * SAMPLE_RATE))]
+ fade = int(round(FADE_SECONDS * SAMPLE_RATE))
+ seam = int(round(layout.seam_frame / fps * SAMPLE_RATE))
+ pcm = crossfade_splice(src_pcm, gen_pcm, seam, fade, layout.source_first)
+ report["fade_ms"] = round(1000 * fade / SAMPLE_RATE, 1)
+ pcm = fit_length(pcm, n_total)
+ master = master_out or (work / "master.flac")
+ _write_master(run, ffmpeg, pcm, work / "master.f32", master)
+ report["audio_master"] = str(master)
+
+ # ---- mux ----------------------------------------------------------------
+ partial = out.with_name(out.name + ".partial")
+ run([ffmpeg, "-y", "-v", "error", "-i", str(video), "-i", str(master),
+ "-map", "0:v:0", "-map", "1:a:0", "-c:v", "copy", "-c:a", "aac",
+ "-b:a", AUDIO_BITRATE, "-movflags", "+faststart", "-f", "mp4", str(partial)],
+ "Extend: mux")
+ final = probe(ffprobe, partial)
+ if final["frames"] != total or not final["has_audio"]:
+ raise SpliceError(f"muxed file has {final['frames']} frames / audio "
+ f"{final['has_audio']}, expected {total} + audio")
+ partial.replace(out)
+ return report
+
+
+def _default_run(cmd: list, label: str) -> None:
+ r = subprocess.run([str(c) for c in cmd], capture_output=True, text=True,
+ errors="replace")
+ if r.returncode != 0:
+ raise SpliceError(f"{label} failed: {(r.stderr or r.stdout).strip()[-300:]}")
diff --git a/install_h3.js b/install_h3.js
index ad56705..59c32de 100644
--- a/install_h3.js
+++ b/install_h3.js
@@ -43,6 +43,10 @@
// quantizer for 48 GB Macs, and the LoRA-on-quantized logical-dims fix.
// Published as a NEW branch: the histories diverged, and force-moving a
// branch users' installs already track is how updates break mid-clone.
+// 4.19.0: this is ONLY the branch a fresh clone starts on. The engine commit
+// the app runs is the PIN in scripts/pinokio/h3_checkout.sh (an exact SHA),
+// which the next step moves the checkout to — so pushing this branch no
+// longer changes what any 4.19+ install runs.
const H3_BRANCH = "codex/h3-engine-v2"
// Every step that works inside the checkout starts here: resolve the roots the
// panel uses (LTX_H3_ROOT / LTX_H3_MODELS), then enter the checkout. See
@@ -145,7 +149,7 @@ module.exports = {
message: [
// The pin itself lives in scripts/pinokio/h3_checkout.sh (#74: Update
// must make the same move; one literal, two callers). H3_BRANCH above
- // is only the fresh-clone branch and must match it.
+ // is only the fresh-clone branch; the pin is a commit it need not contain.
RH3 + "bash \"$APP_ROOT/scripts/pinokio/h3_checkout.sh\" \"$(pwd)\"",
RH3 + "git rev-parse --short HEAD"
]
diff --git a/lora_lab/repair_scrambled_lora.py b/lora_lab/repair_scrambled_lora.py
new file mode 100644
index 0000000..3d3a846
--- /dev/null
+++ b/lora_lab/repair_scrambled_lora.py
@@ -0,0 +1,380 @@
+"""Detect and repair LoRA files the trainer wrote scrambled (#62 root cause).
+
+Every Train-tab adapter (character and voice) saved by a venv with
+safetensors 0.8.0 (released 2026-06-09; the packages require only
+``safetensors>=0.4.0``) holds each factor's UNTRANSPOSED bytes under the
+transposed shape — see ``lora_lab.train._patch_contiguous_checkpoint_save``.
+The element values are all there, so the file can be repaired exactly:
+
+ lora_A (r, in) := file_A.reshape(in, r).T
+ lora_B (out, r) := file_B.reshape(r, out).T
+
+Applying that to a file that was saved correctly would scramble it, so the
+repair is gated on a content check rather than on dates or versions. In a
+real adapter the rank rows of ``lora_A`` share the input-channel magnitude
+profile (the gradient into ``lora_a`` is scaled by the input activations), so
+``|A|``'s rows correlate; scrambling interleaves rank components and input
+channels and the correlation collapses to ~0. The check scores both readings
+and only calls a file scrambled when the unscrambled reading wins by
+``MARGIN``. Measured: a Phosphene 2-image run 0.0008 as saved vs 0.0146
+unscrambled, ``valeriosan_v5`` 0.0015 vs 0.0402, and a third-party PyTorch
+LoRA (DoctorDiffusion Colorizer) 0.0050 as-is vs 0.0006 "unscrambled".
+
+ python -m lora_lab.repair_scrambled_lora FILE.safetensors [...] # report only
+ python -m lora_lab.repair_scrambled_lora FILE.safetensors --out FIXED.safetensors
+ python -m lora_lab.repair_scrambled_lora FILE.safetensors --in-place # keeps FILE.scrambled.bak
+ python -m lora_lab.repair_scrambled_lora --auto MODELS_DIR # what Update runs
+
+Found and written by @tanis2000 (PR #89). 4.19.0 additions: the header's
+metadata and each tensor's dtype survive a repair; an in-place repair keeps
+hard links (a character bundle shares its file with ``loras/``); the stored
+``adapter_strength`` verdict is re-measured, so a WEAK badge earned by the
+scrambled file goes away; voice adapters are scored against a floor sized for
+their short rows; and ``--auto`` repairs only adapters this app trained, so
+Update can fix every installed character without touching anything else.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import shutil
+import statistics
+import struct
+import sys
+from pathlib import Path
+
+import numpy as np
+
+MARGIN = 3.0
+MIN_SCORE = 0.005 # real winners measured 0.0118-0.0406; losers <= 0.0032
+# Voice adapters (every module on the audio branch) have 2048-wide rows and
+# rank 16, so their channel structure is fainter: the two real voice adapters
+# measured here read 0.0070 / 0.0042 as saved and 0.0008 / 0.0003 the other
+# way, which MIN_SCORE called "undetermined" in BOTH directions — a scrambled
+# voice adapter could never be repaired. The floor below is sized from the
+# null distribution of the MEDIAN over the scored modules (measured: sd
+# 0.00025 at 16x2048 over 96 modules, mean 0), so 0.002 is ~8 sd; the 3x
+# MARGIN still has to hold on top of it.
+MIN_SCORE_AUDIO = 0.002
+MAX_MODULES = 96
+_A, _B = ".lora_A.weight", ".lora_B.weight"
+
+
+def load_weights(path: Path) -> dict[str, np.ndarray]:
+ """float32 numpy view of every tensor; bf16 files go through MLX."""
+ try:
+ from safetensors.numpy import load_file
+ return {k: v.astype(np.float32, copy=False) for k, v in load_file(str(path)).items()}
+ except TypeError: # bfloat16 is not a numpy dtype
+ import mlx.core as mx
+ return {k: np.array(v.astype(mx.float32)) for k, v in mx.load(str(path)).items()}
+
+
+def _row_corr(a: np.ndarray) -> float:
+ """Mean off-diagonal correlation of |A|'s rows across the input axis."""
+ m = np.abs(a)
+ m = (m - m.mean(1, keepdims=True)) / (m.std(1, keepdims=True) + 1e-12)
+ c = m @ m.T / m.shape[1]
+ r = c.shape[0]
+ return float((c.sum() - np.trace(c)) / (r * r - r)) if r > 1 else 0.0
+
+
+def _unscramble_a(a: np.ndarray) -> np.ndarray:
+ r, n_in = a.shape
+ return np.ascontiguousarray(a).reshape(n_in, r).T
+
+
+def scramble_scores(weights: dict[str, np.ndarray]) -> tuple[float, float, int, float]:
+ """(as-is score, unscrambled-reading score, modules scored, noise floor).
+
+ The floor is ~6 sigma of the score structureless noise would produce
+ (one row-pair correlation over n_in samples has sd ~1/sqrt(n_in); the
+ score averages r(r-1) of them), and never below MIN_SCORE.
+ """
+ keys = sorted(k for k, v in weights.items() if k.endswith(_A) and v.ndim == 2 and v.shape[0] > 1)
+ keys = keys[:: max(1, len(keys) // MAX_MODULES)][:MAX_MODULES]
+ if not keys:
+ return 0.0, 0.0, 0, MIN_SCORE
+ as_is = [_row_corr(weights[k]) for k in keys]
+ unscr = [_row_corr(_unscramble_a(weights[k])) for k in keys]
+ r, n_in = weights[keys[0]].shape
+ # 6 sd of the MEDIAN of len(keys) structureless module scores: one
+ # module's score has sd sqrt(2 / (n_in r (r-1))) (r(r-1)/2 independent
+ # row pairs, each ~1/sqrt(n_in)), and the median of n draws has
+ # sd ~1.2533 * that / sqrt(n).
+ one = np.sqrt(2.0 / (n_in * r * (r - 1)))
+ stat_floor = 6.0 * 1.2533 * one / np.sqrt(len(keys))
+ audio_only = all(".audio_" in k or "audio_attn" in k or "audio_ff" in k for k in keys)
+ floor = max(MIN_SCORE_AUDIO if audio_only else MIN_SCORE, stat_floor)
+ return statistics.median(as_is), statistics.median(unscr), len(keys), float(floor)
+
+
+def classify(as_is: float, unscr: float, floor: float = MIN_SCORE) -> str:
+ """'scrambled', 'ok', or 'undetermined' (never guess on a close call).
+
+ A reading wins only if it clears the noise floor AND beats the other by
+ MARGIN; anything else — including structureless noise — is undetermined.
+ """
+ if unscr >= floor and unscr >= MARGIN * max(as_is, 1e-6):
+ return "scrambled"
+ if as_is >= floor and as_is >= MARGIN * max(unscr, 1e-6):
+ return "ok"
+ return "undetermined"
+
+
+def unscramble(weights: dict[str, np.ndarray]) -> dict[str, np.ndarray]:
+ out: dict[str, np.ndarray] = {}
+ for k, v in weights.items():
+ if k.endswith(_A):
+ out[k] = np.ascontiguousarray(_unscramble_a(v))
+ elif k.endswith(_B):
+ n_out, r = v.shape
+ out[k] = np.ascontiguousarray(np.ascontiguousarray(v).reshape(r, n_out).T)
+ else:
+ out[k] = np.ascontiguousarray(v)
+ return out
+
+
+def read_header(path: Path) -> tuple[dict[str, str], dict[str, str]]:
+ """(tensor name -> safetensors dtype, __metadata__) from the file header."""
+ with Path(path).open("rb") as fh:
+ n = struct.unpack("<Q", fh.read(8))[0]
+ if n <= 0 or n > 100_000_000:
+ raise ValueError(f"{path}: not a safetensors file")
+ header = json.loads(fh.read(n))
+ meta = header.pop("__metadata__", None) or {}
+ return ({k: str(v.get("dtype")) for k, v in header.items()},
+ {str(k): str(v) for k, v in meta.items()})
+
+
+def save_like(weights: dict[str, np.ndarray], dest: Path, source: Path) -> None:
+ """Write ``weights`` with the SOURCE file's dtypes and header metadata.
+
+ ``load_weights`` reads everything as float32; written back as-is a bf16
+ adapter would double in size and a fp16 one would change type, and the
+ header's ``__metadata__`` (trigger words, training provenance in many
+ third-party files) would be gone.
+ """
+ dtypes, meta = read_header(source)
+ if any(d == "BF16" for d in dtypes.values()):
+ import mlx.core as mx
+ mxd = {"BF16": mx.bfloat16, "F16": mx.float16, "F32": mx.float32}
+ out = {k: mx.array(v).astype(mxd.get(dtypes.get(k, "F32"), mx.float32))
+ for k, v in weights.items()}
+ mx.save_safetensors(str(dest), out, metadata=meta or None)
+ return
+ from safetensors.numpy import save_file
+ npd = {"F16": np.float16, "F32": np.float32, "F64": np.float64}
+ out = {k: np.ascontiguousarray(v.astype(npd[dtypes[k]], copy=False))
+ if dtypes.get(k) in npd else np.ascontiguousarray(v)
+ for k, v in weights.items()}
+ save_file(out, str(dest), metadata=meta or None)
+
+
+def _write_in_place(fixed: dict[str, np.ndarray], path: Path) -> None:
+ """Replace ``path``'s CONTENT, keeping its inode.
+
+ A trained character is one file under two names — ``loras/<id>_v2`` and
+ the bundle's ``characters/<id>/<id>.video`` are hard links — so an
+ ``os.replace`` would repair one name and leave the other scrambled. The
+ repaired bytes are written to a temp file first (a failed save leaves the
+ original untouched), then copied over the original.
+ """
+ tmp = path.with_name(path.name + ".repair.tmp")
+ try:
+ save_like(fixed, tmp, path)
+ shutil.copyfile(tmp, path)
+ finally:
+ tmp.unlink(missing_ok=True)
+
+
+def _remeasure(path: Path) -> dict | None:
+ """The adapter_strength payload the trainer would have written for the
+ repaired file (``lora_lab.train_character.report_adapter_strength``)."""
+ try:
+ sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
+ from lora_compat import measure_adapter_effect
+ effect = measure_adapter_effect(path)
+ except Exception: # noqa: BLE001 — a probe must never fail a repair
+ return None
+ if effect is None:
+ return None
+ return {
+ "modules": effect.modules,
+ "carrying_modules": effect.modules - effect.zero_modules,
+ "delta_rms_median": effect.median_rms,
+ "delta_rms_max": effect.max_rms,
+ "floor": effect.floor,
+ "verdict": "inert" if effect.inert else ("weak" if effect.weak else "ok"),
+ }
+
+
+def sidecars(path: Path) -> list[Path]:
+ """The two sidecars a trained adapter can carry: the trainer's
+ ``<file>.safetensors.json`` and the panel's ``<stem>.json``."""
+ return [p for p in (path.with_suffix(path.suffix + ".json"), path.with_suffix(".json"))
+ if p.is_file() and not p.is_symlink()]
+
+
+def _note_sidecar(path: Path, report: dict) -> None:
+ strength = _remeasure(path)
+ for sidecar in sidecars(path):
+ try:
+ data = json.loads(sidecar.read_text())
+ except (OSError, ValueError):
+ continue
+ if not isinstance(data, dict):
+ continue
+ data["repaired_scrambled_save"] = report
+ # The verdict the Train tab shows (WEAK / DEAD badge) was measured on
+ # the scrambled file — about half strength by construction. Replace
+ # it with the repaired file's, and keep the old one for the record.
+ if strength is not None and "adapter_strength" in data:
+ data["adapter_strength_as_saved"] = data["adapter_strength"]
+ data["adapter_strength"] = strength
+ sidecar.write_text(json.dumps(data, indent=2))
+
+
+def _provenance(path: Path) -> tuple[bool, bool]:
+ """(trained in this app, already repaired) from ``path``'s own sidecars."""
+ trained = repaired = False
+ for sidecar in sidecars(path):
+ try:
+ data = json.loads(sidecar.read_text())
+ except (OSError, ValueError):
+ continue
+ if not isinstance(data, dict):
+ continue
+ repaired = repaired or bool(data.get("repaired_scrambled_save"))
+ trained = trained or bool(data.get("lora_lab_version")
+ or data.get("kind") in ("train_character", "train_style"))
+ return trained, repaired
+
+
+def trained_here(path: Path) -> bool:
+ """True only for adapters this app's trainer wrote, not yet repaired.
+
+ ``--auto`` runs unattended inside Update, so it never classifies a file it
+ cannot vouch for, and a NAME is not provenance (Codex 4.19.0: a downloaded
+ ``someone.audio.safetensors`` must never be rewritten). A trained
+ character carries a sidecar from the trainer (``lora_lab_version``) or the
+ panel (``kind`` train_character / train_style). A voice adapter has no
+ sidecar of its own; Train writes it as ``<trigger>.audio.safetensors``
+ beside that character's face file ``<trigger>_v2.safetensors``, so it
+ qualifies only when that face file's sidecar says this app trained it.
+ Anything else (CivitAI, Hugging Face, a file a user dropped in, a bundle
+ that came with a download) is skipped without being read.
+ """
+ trained, repaired = _provenance(path)
+ if repaired:
+ return False # repaired already; never read it twice
+ if trained:
+ return True
+ if path.name.endswith(".audio.safetensors"):
+ face = path.with_name(path.name[: -len(".audio.safetensors")] + "_v2.safetensors")
+ return _provenance(face)[0]
+ return False
+
+
+def auto_candidates(models_dir: Path) -> list[Path]:
+ """Every trained adapter under ``loras/`` and ``characters/*/``, one path
+ per inode (hard links are the same adapter).
+
+ Only REAL files that live inside those folders: a symlink (or a folder
+ that resolves elsewhere) is skipped, so an unattended repair can never
+ write through a link to a file outside the model library (Codex 4.19.0).
+ """
+ seen: set[tuple[int, int]] = set()
+ out: list[Path] = []
+ roots = [models_dir / "loras", *sorted((models_dir / "characters").glob("*/"))]
+ for root in roots:
+ if not root.is_dir() or root.is_symlink():
+ continue
+ real_root = root.resolve()
+ for f in sorted(root.glob("*.safetensors")):
+ try:
+ if f.is_symlink() or f.resolve().parent != real_root:
+ continue
+ st = f.stat()
+ except OSError:
+ continue
+ key = (st.st_dev, st.st_ino)
+ if key in seen or not trained_here(f):
+ continue
+ seen.add(key)
+ out.append(f)
+ return out
+
+
+def _free_bytes(path: Path) -> int:
+ try:
+ return shutil.disk_usage(path.parent).free
+ except OSError:
+ return 0
+
+
+def main(argv: list[str] | None = None) -> int:
+ p = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ p.add_argument("files", nargs="*", type=Path)
+ g = p.add_mutually_exclusive_group()
+ g.add_argument("--out", type=Path, help="write the repaired copy here (one input file only)")
+ g.add_argument("--in-place", action="store_true", help="repair in place, keeping <file>.scrambled.bak")
+ g.add_argument("--auto", type=Path, metavar="MODELS_DIR",
+ help="repair, in place, every adapter this app trained under "
+ "MODELS_DIR/loras and MODELS_DIR/characters/* (what Update runs)")
+ args = p.parse_args(argv)
+ if args.out and len(args.files) != 1:
+ p.error("--out takes exactly one input file")
+ if args.auto:
+ if args.files:
+ p.error("--auto takes a models directory, not files")
+ args.files = auto_candidates(args.auto)
+ args.in_place = True
+ print(f"checking {len(args.files)} adapter(s) trained in this app for the "
+ "#62 scrambled save")
+ elif not args.files:
+ p.error("give at least one file, or --auto MODELS_DIR")
+
+ worst = 0
+ for f in args.files:
+ try:
+ w = load_weights(f)
+ except Exception as exc: # noqa: BLE001 — one unreadable file must not stop the rest
+ print(f"{f}: unreadable ({exc}) - left as is")
+ worst = max(worst, 2)
+ continue
+ as_is, unscr, n, floor = scramble_scores(w)
+ verdict = classify(as_is, unscr, floor)
+ print(f"{f}: {verdict} (as-is {as_is:+.4f}, unscrambled {unscr:+.4f}, {n} modules)")
+ if verdict != "scrambled" or not (args.out or args.in_place):
+ worst = max(worst, 0 if verdict != "undetermined" else 2)
+ continue
+ fixed = unscramble(w)
+ report = {"as_is": round(as_is, 5), "unscrambled": round(unscr, 5), "modules_scored": n}
+ if args.out:
+ save_like(fixed, args.out, f)
+ print(f" wrote repaired copy -> {args.out}")
+ else:
+ backup = f.with_name(f.name + ".scrambled.bak")
+ if backup.exists():
+ print(f" refusing: {backup} already exists", file=sys.stderr)
+ worst = 1
+ continue
+ # The backup and the temp copy each need the file's size again.
+ need = 2 * f.stat().st_size + 512 * 1024 * 1024
+ if _free_bytes(f) < need:
+ print(f" NOT repaired: needs {need / 1e9:.1f} GB free beside it "
+ f"for the backup - free space and run Update again")
+ worst = 1
+ continue
+ shutil.copy2(f, backup)
+ _write_in_place(fixed, f)
+ _note_sidecar(f, report)
+ print(f" repaired in place (original kept as {backup.name})")
+ return worst
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/lora_lab/train.py b/lora_lab/train.py
index a8eae9d..93c840f 100644
--- a/lora_lab/train.py
+++ b/lora_lab/train.py
@@ -22,6 +22,7 @@ import logging
import sys
import time
from pathlib import Path
+from typing import Any
import yaml
@@ -216,7 +217,7 @@ def _patch_compute_video_positions_fps_kwarg() -> None:
mod.compute_audio_token_count = patched_audio
-def _patch_lora_target_exclude_audio() -> None:
+def _patch_lora_target_exclude_audio(enabled: bool = True) -> None:
"""Exclude audio attention/FF layers from LoRA target matching.
The trainer's ``_find_lora_targets`` (trainer.py:917) does suffix matching:
@@ -241,9 +242,21 @@ def _patch_lora_target_exclude_audio() -> None:
Lora-lab CLAUDE rule 1 says don't mutate phosphene's tree — so we
monkey-patch at runtime instead.
+
+ ``enabled=False`` restores the vendored matcher, which is the Lightricks
+ trainer's default target set: q/k/v/out on all six attention families,
+ 1152 modules — the same set ``bizarrotrn_v2`` carries (#62 trainer
+ comparison). Idempotent either way.
"""
import ltx_trainer_mlx.trainer as _trainer
- _orig = _trainer._find_lora_targets
+ _orig = getattr(_trainer, "_phos_orig_find_lora_targets", None)
+ if _orig is None:
+ _orig = _trainer._find_lora_targets
+ _trainer._phos_orig_find_lora_targets = _orig
+ if not enabled:
+ _trainer._find_lora_targets = _orig
+ logger.info("lora target filter: off (all attention families, audio included)")
+ return
EXCLUDE_SUBSTRINGS = ("audio_attn", "audio_ff")
@@ -263,6 +276,183 @@ def _patch_lora_target_exclude_audio() -> None:
_trainer._find_lora_targets = patched
+def _patch_contiguous_checkpoint_save() -> None:
+ """Make every tensor the trainer saves C-contiguous. THE #62 root cause.
+
+ ``ltx_trainer_mlx.trainer._save_checkpoint`` converts each LoRA factor to
+ the ComfyUI layout with ``np.array(mx.transpose(param).astype(mx.float32))``.
+ The params are already float32, so ``astype`` is a no-op and the transpose
+ stays a VIEW: numpy receives a correctly-strided but non-contiguous array.
+ ``safetensors.numpy.save_file`` (0.8.0 in this venv) serializes
+ ``tensor.ctypes.data`` for ``tensor.nbytes`` — the raw buffer, strides
+ ignored; its own docstring says tensors "need to be contiguous". So every
+ ``lora_A.weight`` on disk is ``lora_a``'s bytes under the transposed shape,
+ not ``lora_a.T``, and likewise ``lora_B``.
+
+ The file keeps every element value, so it attaches cleanly and moves the
+ output, but its delta is unrelated to the trained one (cosine -0.0002 at
+ 4096x32) and, on a trained adapter, about half its strength:
+ ``valeriosan_v2``-``v5`` read 6.7-7.1e-4 on the identity family as saved
+ and 1.33-1.49e-3 unscrambled — the band of the characters that work. That
+ is the #62 signature exactly — clean attach, "half strength", output
+ perturbed, no identity — and why ``probe_fit.py`` measured ~0 fit on
+ adapters whose training loss had fallen 37-68%: unscrambled, the same
+ 2-image adapter fits its images by 41-83%. Character and voice LoRAs both
+ save through here.
+
+ Wrapping the trainer module's ``save_safetensors`` binding fixes every save
+ site at once and is a no-op on arrays that are already contiguous.
+ """
+ import numpy as np
+ import ltx_trainer_mlx.trainer as _trainer
+
+ orig = getattr(_trainer, "_phos_orig_save_safetensors", None)
+ if orig is None:
+ orig = _trainer.save_safetensors
+ _trainer._phos_orig_save_safetensors = orig
+
+ def save_contiguous(tensors: dict, filename: Any, metadata: Any = None) -> None:
+ tensors = {k: np.ascontiguousarray(v) for k, v in tensors.items()}
+ if metadata is None:
+ return orig(tensors, filename)
+ return orig(tensors, filename, metadata)
+
+ _trainer.save_safetensors = save_contiguous
+
+
+def _patch_adam_bias_correction(enabled: bool) -> None:
+ """Give the trainer's AdamW the bias correction every PyTorch AdamW has.
+
+ ``ltx_trainer_mlx.trainer._init_optimizer`` builds ``mlx.optimizers.AdamW``
+ with only ``learning_rate`` and ``weight_decay``, and MLX defaults
+ ``bias_correction`` to False (checked on mlx 0.31.1). PyTorch's AdamW —
+ which the Lightricks trainer and ai-toolkit (bitsandbytes AdamW8bit) both
+ use — always corrects. Uncorrected, Adam's step is
+ ``(1 - b1**t) / sqrt(1 - b2**t)`` times the corrected one: 3.2x at step 1,
+ 6.5x around steps 10-15, 3.3x at 100, 1.6x at 500, 1.26x at 1000. So the
+ "lr 1e-4" recipe spent its first few hundred steps at several times that,
+ with batch-1 gradients that are ~92% noise draw (#62, trainer regression
+ check). ``enabled=False`` restores the old optimizer exactly; it is how a
+ run reproduces an adapter trained before iter7.
+ """
+ import ltx_trainer_mlx.trainer as _trainer
+
+ cls = _trainer.LtxvTrainer
+ orig = getattr(cls, "_phos_orig_init_optimizer", None)
+ if orig is None:
+ orig = cls._init_optimizer
+ cls._phos_orig_init_optimizer = orig
+
+ def patched(self) -> None:
+ orig(self)
+ # Adam.apply_single reads self.bias_correction on every step, so
+ # setting it after construction is the same as passing it in.
+ self._optimizer.bias_correction = bool(enabled)
+ logger.info("optimizer: AdamW bias_correction=%s", bool(enabled))
+
+ cls._init_optimizer = patched
+
+
+# Image-only training feeds the joint audio+video DiT a stand-in audio stream:
+# trainer.py `_build_loss_fn` builds ONE all-zero audio token with audio
+# timesteps of 0 — "clean, finished audio" — next to a noisy video. Neither
+# reference trainer does that (#62 trainer comparison):
+# - Lightricks ltx-trainer passes audio=None, and ltx-core then skips the
+# audio<->video cross-attention entirely (transformer.py run_a2v/run_v2a);
+# - ai-toolkit passes a zero audio latent at the SAME sigma as the video, as
+# every real render does.
+# The MLX model also drives the a2v gate from the VIDEO sigma where ltx-core
+# uses the audio one (transformer_args._prepare_cross_attention_timestep), so
+# clean-audio-plus-noisy-video is a combination the reference model never
+# computes. These are the three modes.
+IMAGE_AUDIO_MODES = ("skip_a2v", "matched_sigma", "clean_zero")
+
+
+class _ImageOnlyAudioTransformer:
+ """Stand-in for ``trainer._transformer`` inside one loss evaluation.
+
+ The vendored loss function looks ``self._transformer`` up at call time and
+ calls it with the dummy-audio kwargs. Swapping a plain forwarding object in
+ for the duration of that call lets us change only the audio arguments
+ without copying the vendored loss function. It is not an ``nn.Module``:
+ ``value_and_grad`` was built on the real model and still differentiates
+ its trainable parameters, which this object calls straight through to.
+ """
+
+ def __init__(self, model: Any, mode: str) -> None:
+ self._model = model
+ self._mode = mode
+
+ def __call__(self, **kwargs: Any) -> Any:
+ import mlx.core as mx
+
+ if self._mode == "skip_a2v":
+ from ltx_core_mlx.guidance.perturbations import (
+ BatchedPerturbationConfig,
+ Perturbation,
+ PerturbationConfig,
+ PerturbationType,
+ )
+
+ # Both directions, every block: the audio stream can no longer
+ # reach the video loss, which is what audio=None means upstream.
+ # The block multiplies the cross-attention output by 0, so values
+ # AND gradients match skipping it (a2v LoRAs stay at zero).
+ per_sample = PerturbationConfig([
+ Perturbation(PerturbationType.SKIP_A2V_CROSS_ATTN, None),
+ Perturbation(PerturbationType.SKIP_V2A_CROSS_ATTN, None),
+ ])
+ batch = int(kwargs["video_latent"].shape[0])
+ kwargs["perturbations"] = BatchedPerturbationConfig([per_sample] * batch)
+ elif self._mode == "matched_sigma":
+ # ai-toolkit: same zero latent, but at the video's noise level.
+ ats = kwargs["audio_timesteps"]
+ sigma = kwargs["timestep"].astype(ats.dtype).reshape(-1, 1)
+ kwargs["audio_timesteps"] = mx.broadcast_to(sigma, ats.shape)
+ return self._model(**kwargs)
+
+
+def _patch_image_only_audio(mode: str) -> None:
+ """Choose how image-only training handles the joint model's audio stream.
+
+ ``skip_a2v`` matches the Lightricks trainer, ``matched_sigma`` matches
+ ai-toolkit, ``clean_zero`` is the pre-iter7 behaviour (no patch). Applies
+ only to the dummy-audio branch: a run that trains real audio
+ (``generate_audio``) is left exactly as the vendored trainer builds it.
+ """
+ if mode not in IMAGE_AUDIO_MODES:
+ raise ValueError(f"image_audio must be one of {IMAGE_AUDIO_MODES}, got {mode!r}")
+ import ltx_trainer_mlx.trainer as _trainer
+
+ cls = _trainer.LtxvTrainer
+ orig = getattr(cls, "_phos_orig_build_loss_fn", None)
+ if orig is None:
+ orig = cls._build_loss_fn
+ cls._phos_orig_build_loss_fn = orig
+
+ if mode == "clean_zero":
+ cls._build_loss_fn = orig
+ return
+
+ def patched(self) -> Any:
+ loss_fn = orig(self)
+ if self._training_strategy.requires_audio:
+ return loss_fn
+
+ def image_only_loss_fn(batch: Any) -> Any:
+ real = self._transformer
+ self._transformer = _ImageOnlyAudioTransformer(real, mode)
+ try:
+ return loss_fn(batch)
+ finally:
+ self._transformer = real
+
+ return image_only_loss_fn
+
+ cls._build_loss_fn = patched
+ logger.info("image-only audio stream: %s", mode)
+
+
def _patch_strategy_for_image_only() -> None:
"""Force `first_frame_conditioning_p=0.0` for image-only training.
@@ -311,6 +501,11 @@ def main() -> int:
_patch_strategy_for_image_only()
_patch_compute_video_positions_fps_kwarg()
_patch_lora_target_exclude_audio()
+ _patch_contiguous_checkpoint_save()
+ # The defaults of train_character.RECIPE_SWITCHES (the legacy recipe),
+ # stated explicitly; the yaml still owns scheduler_type on this path.
+ _patch_adam_bias_correction(False)
+ _patch_image_only_audio("clean_zero")
t0 = time.time()
trainer = LtxvTrainer(config)
diff --git a/lora_lab/train_audio.py b/lora_lab/train_audio.py
index 783e6d9..3db05ff 100644
--- a/lora_lab/train_audio.py
+++ b/lora_lab/train_audio.py
@@ -371,6 +371,9 @@ def run_training(
lab_train._patch_loader_prefer_dev_transformer()
lab_train._patch_strategy_for_image_only()
lab_train._patch_compute_video_positions_fps_kwarg()
+ # The voice adapter saves through the same _save_checkpoint, so without
+ # this it is written scrambled exactly like the character one (#62).
+ lab_train._patch_contiguous_checkpoint_save()
_restore_audio_lora_targets()
total_steps = int(config_dict["optimization"]["steps"])
diff --git a/lora_lab/train_character.py b/lora_lab/train_character.py
index eeba6d1..33f2a01 100644
--- a/lora_lab/train_character.py
+++ b/lora_lab/train_character.py
@@ -52,7 +52,12 @@ Spec JSON schema (everything except `advanced` is required):
"lr": null | float,
"resolution": null | int,
"caption_strategy": null | "class_word" | "trigger_only" | "auto_caption",
- "crop_strategy": null | "center" // "face_centered" not yet implemented
+ "crop_strategy": null | "center", // "face_centered" not yet implemented
+ // iter7 recipe switches (RECIPE_SWITCHES; null = default):
+ "adam_bias_correction": null | true | false,
+ "scheduler_type": null | "linear" | "constant",
+ "image_audio": null | "skip_a2v" | "matched_sigma" | "clean_zero",
+ "lora_target_families": null | "video" | "all_attention"
}
}
@@ -139,8 +144,63 @@ TARGET_MODULES = ["to_q", "to_k", "to_v", "to_out"]
# Bumped when the trainer's behaviour changes, so a sidecar dates its file.
# "iter5" had been frozen in every sidecar since the yaml era regardless of
-# what changed; iter6 = truthful base_model + width/height honored.
-LORA_LAB_VERSION = "iter6"
+# what changed; iter6 = truthful base_model + width/height honored; iter7 =
+# adapters saved contiguous (train._patch_contiguous_checkpoint_save — every
+# earlier adapter on safetensors 0.8.0 was written scrambled, #62) plus the
+# RECIPE_SWITCHES below.
+LORA_LAB_VERSION = "iter7"
+
+# Training-recipe switches from the #62 comparison against the trainers known
+# to bind a face (Lightricks ltx-trainer, ostris ai-toolkit) — see the PR #89
+# investigation log (tanis2000/Phosphene, branch issue-62,
+# docs/ISSUE_62_VALERIOSAN_2026-09-30.md), "Comparison against known-working
+# trainers". Each maps to (default, allowed values). The DEFAULT is the legacy
+# recipe, the one every adapter before iter7 trained with: with the save fixed
+# it fits its training images and renders a learned person, and the screen
+# ("Screen results with the save fixed") found the reference-trainer values
+# halve fit at equal steps with no gain in trigger binding. The other values
+# stay available so a spec can A/B one switch at a time.
+#
+# adam_bias_correction PyTorch AdamW always bias-corrects; MLX's AdamW
+# defaults to not, and the vendored trainer never
+# asked (lora_lab.train._patch_adam_bias_correction).
+# scheduler_type Lightricks default: linear decay to 0.1x over the
+# run. ai-toolkit keeps it constant.
+# image_audio how the stand-in audio stream of an image-only run
+# reaches the video: skipped (Lightricks), at the
+# video's sigma (ai-toolkit) or clean at sigma 0 (old).
+# lora_target_families "all_attention" = the Lightricks default and
+# bizarrotrn_v2's 1152 modules. Under skip_a2v the
+# audio families get no gradient and stay exactly
+# zero; under the other two modes they train on the
+# stand-in audio — the 2026-05-15 Aria v2 lip-sync
+# breakage (the screen's arm C trained audio_attn2
+# hardest).
+RECIPE_SWITCHES: dict[str, tuple[Any, tuple[Any, ...]]] = {
+ "adam_bias_correction": (False, (True, False)),
+ "scheduler_type": ("constant", ("linear", "constant")),
+ "image_audio": ("clean_zero", ("skip_a2v", "matched_sigma", "clean_zero")),
+ "lora_target_families": ("video", ("all_attention", "video")),
+}
+
+
+def resolve_recipe(cfg: dict[str, Any]) -> dict[str, Any]:
+ """The recipe switches for one run: spec value if given, else the default.
+
+ Raises ValueError on a value outside the allowed set rather than guessing,
+ so a typo in a hand-edited spec cannot silently run the default arm.
+ """
+ out: dict[str, Any] = {}
+ for key, (default, allowed) in RECIPE_SWITCHES.items():
+ value = cfg.get(key)
+ if value is None:
+ value = default
+ if isinstance(default, bool) and isinstance(value, str):
+ value = value.strip().lower() in ("1", "true", "yes", "on")
+ if value not in allowed:
+ raise ValueError(f"{key} must be one of {list(allowed)}, got {value!r}")
+ out[key] = value
+ return out
def _resolved_base_label() -> str:
@@ -202,7 +262,8 @@ def resolve_preset(preset: str, advanced: dict[str, Any] | None) -> dict[str, An
# ~1 latent token at 512²") was silently dropped here and every
# panel-driven training fell back to resolution×resolution. An
# explicit allowlist instead: preset keys plus the geometry pair.
- _extra_ok = ("width", "height")
+ _extra_ok = ("width", "height", "checkpoint_keep_last_n",
+ "enable_gradient_checkpointing", *RECIPE_SWITCHES)
for k, v in advanced.items():
if v is not None and (k in cfg or k in _extra_ok):
cfg[k] = v
@@ -303,8 +364,10 @@ def load_spec(spec_path: Path) -> dict[str, Any]:
if not isinstance(spec.get("advanced"), dict):
spec["advanced"] = {}
for k in ("rank", "alpha", "steps", "lr", "resolution",
- "width", "height",
- "target_modules", "caption_strategy", "crop_strategy"):
+ "width", "height", "checkpoint_keep_last_n",
+ "enable_gradient_checkpointing",
+ "target_modules", "caption_strategy", "crop_strategy",
+ *RECIPE_SWITCHES):
if k in spec and k not in spec["advanced"]:
spec["advanced"][k] = spec[k]
cs = spec["advanced"].get("caption_strategy")
@@ -612,6 +675,7 @@ def build_trainer_config(
output_dir: Path,
) -> dict[str, Any]:
"""Compose the LtxTrainerConfig dict from a resolved preset + paths."""
+ recipe = resolve_recipe(cfg)
return {
"model": {
"model_path": DEFAULT_MODEL_PATH,
@@ -631,7 +695,17 @@ def build_trainer_config(
"gradient_accumulation_steps": 1,
"max_grad_norm": 1.0,
"weight_decay": 0.0,
- "scheduler_type": "constant",
+ # "constant" is the legacy default; "linear" uses the trainer's
+ # defaults, start 1.0 -> end 0.1 over `steps` — the Lightricks
+ # t2v_lora.yaml schedule (RECIPE_SWITCHES).
+ "scheduler_type": recipe["scheduler_type"],
+ # Per-block recompute (ltx_core_mlx transformer model.py, which
+ # passes the LoRA params into mx.checkpoint explicitly so they
+ # still get gradients). Off by default: 512 px fits without it.
+ # At 768x768 on a 64 GB Mac the uncheckpointed run hit a 54.8 GB
+ # footprint, swapped ~31 GB of GPU memory and logged no step in
+ # 28 minutes; recompute trades speed for that memory.
+ "enable_gradient_checkpointing": bool(cfg.get("enable_gradient_checkpointing") or False),
},
"data": {
"preprocessed_data_root": str(data_root),
@@ -653,7 +727,13 @@ def build_trainer_config(
# Save every ~10% of total steps so the user has fallbacks if a long
# run is interrupted, but keep at least one mid-run checkpoint.
"interval": max(1, int(cfg["steps"]) // 5),
- "keep_last_n": 2,
+ # keep_last_n=2 left only the final checkpoint of the #62 v2/v3
+ # runs on disk, so "was it over-trained?" could not be answered
+ # after the fact. A spec may raise it; use -1 to keep every save.
+ # NOT 5: when steps is a multiple of the interval the final step
+ # is recorded twice (interval save + end-of-run save, trainer.py
+ # :216/:285), so 5 silently pruned the first checkpoint.
+ "keep_last_n": int(cfg.get("checkpoint_keep_last_n") or 2),
},
"seed": 42,
"output_dir": str(output_dir),
@@ -679,14 +759,31 @@ def run_training(
config_dict = build_trainer_config(cfg=cfg, data_root=data_root, output_dir=output_dir)
config = LtxTrainerConfig.model_validate(config_dict)
+ recipe = resolve_recipe(cfg)
# Apply the same patches train.py uses: dev transformer + image-only safety
- # + fps→frame_rate kwarg shim + audio-attn exclusion. These all run as
- # cheap monkey-patches before LtxvTrainer is instantiated.
+ # + fps→frame_rate kwarg shim + audio-attn exclusion, then the iter7
+ # recipe switches. These all run as cheap monkey-patches before
+ # LtxvTrainer is instantiated.
lab_train._patch_loader_prefer_dev_transformer()
lab_train._patch_strategy_for_image_only()
lab_train._patch_compute_video_positions_fps_kwarg()
- lab_train._patch_lora_target_exclude_audio()
+ # Not a recipe switch: without it the saved adapter is scrambled (#62).
+ lab_train._patch_contiguous_checkpoint_save()
+ lab_train._patch_lora_target_exclude_audio(recipe["lora_target_families"] == "video")
+ lab_train._patch_adam_bias_correction(recipe["adam_bias_correction"])
+ lab_train._patch_image_only_audio(recipe["image_audio"])
+ emit("log", line="recipe: " + ", ".join(f"{k}={v}" for k, v in recipe.items()))
+ if recipe["lora_target_families"] == "all_attention" and recipe["image_audio"] == "skip_a2v":
+ emit(
+ "warning",
+ stage="config",
+ message=(
+ "lora_target_families=all_attention with image_audio=skip_a2v: "
+ "the audio-family and a2v adapters get no gradient and are saved "
+ "as exact zeros. Pair all_attention with matched_sigma to train them."
+ ),
+ )
# Pin Python/numpy RNG before LtxvTrainer touches them. The upstream
# trainer seeds `mx.random` with `cfg.seed=42` (see ltx_trainer_mlx/
@@ -713,6 +810,13 @@ def run_training(
# Roughly every ~2% of total steps, with bounds [10, 250].
emit_every = max(10, min(250, total_steps // 50 or 10))
last_loss: float | None = None
+ # Mean over the steps since the last emit. The emitted loss used to be
+ # the single most recent step's, i.e. one sample at a random sigma every
+ # ~2% of the run: timestep variance swamped any trend, and the #62 v2/v3
+ # curves could not say whether training converged. Batch 1 makes the
+ # per-step value this noisy; the interval mean is what is readable.
+ loss_sum = 0.0
+ loss_n = 0
# Sniff per-step loss without forking the trainer: monkey-patch
# TrainingProgress.update_training. It always gets called (even with
@@ -722,9 +826,11 @@ def run_training(
_orig_update = tp_mod.TrainingProgress.update_training
def _sniff_update(self, *, loss, lr, step_time, advance=True): # noqa: ANN001
- nonlocal last_loss
+ nonlocal last_loss, loss_sum, loss_n
try:
last_loss = float(loss)
+ loss_sum += last_loss
+ loss_n += 1
except Exception: # noqa: BLE001
pass
return _orig_update(self, loss=loss, lr=lr, step_time=step_time, advance=advance)
@@ -732,7 +838,7 @@ def run_training(
tp_mod.TrainingProgress.update_training = _sniff_update
def _cb(step: int, total: int, _videos: list[Path]) -> None:
- nonlocal last_emit_step
+ nonlocal last_emit_step, loss_sum, loss_n
if step - last_emit_step < emit_every and step != total:
return
last_emit_step = step
@@ -742,16 +848,22 @@ def run_training(
if step > 0:
per_step = elapsed / step
eta = max(0, int(per_step * (total - step)))
- loss_val = round(last_loss, 4) if last_loss is not None else None
+ if loss_n:
+ loss_val = round(loss_sum / loss_n, 4)
+ else:
+ loss_val = round(last_loss, 4) if last_loss is not None else None
+ n_val = loss_n
+ loss_sum, loss_n = 0.0, 0
emit(
"train_progress",
step=step,
loss=loss_val,
+ loss_n=n_val,
eta_s=eta,
)
# Panel-side alias: mlx_ltx_panel.py parses {"event":"step"} with
# {step, total, loss} fields and renders the progress bar from it.
- emit("step", step=step, total=total, loss=loss_val, eta_s=eta)
+ emit("step", step=step, total=total, loss=loss_val, loss_n=n_val, eta_s=eta)
# Silence the trainer's own logging to stdout — only our JSON-lines should
# reach stdout. Send everything else to stderr so it's still capturable.
@@ -884,6 +996,9 @@ def write_sidecar(
int(cfg.get("height") or cfg.get("resolution") or 576),
],
"lora_lab_version": LORA_LAB_VERSION,
+ # Which arm of the #62 recipe switches trained this file. Absent on
+ # anything before iter7, which all trained as the legacy values.
+ "recipe": resolve_recipe(cfg),
"loadable_via": "ltx_core_mlx.loader.fuse_loras.apply_loras",
}
if strength is not None:
@@ -988,9 +1103,15 @@ def run_pipeline(spec_path: Path) -> int:
image_count = len(source_files)
+ try:
+ recipe = resolve_recipe(cfg)
+ except ValueError as exc:
+ emit_error_and_exit("config", str(exc))
+
estimated_wall_s = estimate_wall_seconds(image_count, preset, advanced)
emit(
"plan",
+ recipe=recipe,
preset=preset,
rank=int(cfg["rank"]),
alpha=int(cfg["alpha"]),
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 8d4d1d6..1414323 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -3388,6 +3388,54 @@ def _suggest_trigger_token() -> str:
return token
+def _caption_declared_trigger(text: str) -> str | None:
+ """Best-effort extraction of the trigger token a caption file actually
+ uses, for error messages when it disagrees with the job's configured
+ trigger (#62, 2026-09-30 — a dataset reused across training attempts
+ silently carried a DIFFERENT trigger's captions forward).
+
+ The canonical shape written by both the trainer's own fallback and
+ caption_with_gemma.py is `[VISUAL]: <trigger>, <body>`, so the token
+ right after `[VISUAL]: ` is authoritative when present. Anything else
+ (a naked `<trigger> man` caption, or free-form user text) falls back to
+ the first comma-separated segment, which is where every caption
+ convention this trainer has ever used puts the trigger.
+ """
+ m = re.match(r"\s*\[VISUAL\]:\s*([^\s,]+)", text)
+ if m:
+ return m.group(1)
+ first = text.split(",", 1)[0].strip()
+ return first or None
+
+
+def _caption_trigger_mismatches(
+ caption_files: list[Path], trigger: str
+) -> tuple[list[str], tuple[str, int] | None]:
+ """Which of ``caption_files`` do NOT contain ``trigger`` (case-insensitive
+ substring match), and what trigger they carry instead.
+
+ Returns ``(mismatched_tokens, dominant_other)`` — one entry in
+ ``mismatched_tokens`` per file that doesn't mention ``trigger`` (its own
+ declared trigger via :func:`_caption_declared_trigger`, or ``"?"`` if
+ none could be extracted), and ``dominant_other`` is the most common real
+ (non-``"?"``) token among them with its count, or ``None`` if every
+ mismatch was unparseable. Unreadable files are skipped, not counted as
+ mismatches — an I/O error here is not evidence about caption content.
+ """
+ mismatched: list[str] = []
+ for cap in caption_files:
+ try:
+ text = cap.read_text(encoding="utf-8", errors="replace")
+ except OSError:
+ continue
+ if trigger.lower() not in text.lower():
+ mismatched.append(_caption_declared_trigger(text) or "?")
+ dominant = collections.Counter(
+ t for t in mismatched if t != "?"
+ ).most_common(1)
+ return mismatched, (dominant[0] if dominant else None)
+
+
def _train_estimate_seconds(preset: str, image_count: int, *,
steps_override: int | None = None,
is_style: bool = False) -> int:
@@ -9262,7 +9310,7 @@ H3_TRISTEP_NOTE = ("Fast: 3 steps — about 4× faster, great for drafts and mos
"shots (TaoMate's 3-step adapter on the same H3 model). "
"Turbo is never stacked on it.")
# Canvases that offer it, and the ones where it is the default once installed.
-H3_TRISTEP_QUALITIES = ("draft", "preview", "standard", "high")
+H3_TRISTEP_QUALITIES = ("draft", "preview", "fast_hd", "standard", "high")
H3_TRISTEP_DEFAULT_QUALITIES = H3_TRISTEP_QUALITIES
# End-to-end wall clocks for TriStep cells, M4 Max, keyed (quality, length).
# Keyed (quality, length, mode). All with the character + vh5tape LoRAs on top
@@ -9283,7 +9331,18 @@ H3_TRISTEP_MEASURED_ETA: dict[tuple[str, str, str], tuple[float, str]] = {
# 8.2–9.9 min (panel history, 2026-09-16/17); 768×448 is interpolated between
# them on output pixels (~4 min, not measured). Other lengths scale by frames.
FACE_FIX_DRAFT_5S_MIN = 2.5
-FACE_FIX_5S_MIN = {"draft": 2.5, "preview": 2.0, "standard": 4.0, "high": 9.0}
+# Fast HD = a 640×384 H3 render on the 3-step Fast pass, then the LTX x2
+# Upscale & Face Fix "face kept" recipe (start from the clip,
+# FAST_HD_FACEFIX_STEPS refine step) to 1280×768. Measured on a 5 s (124 f)
+# Bizarro close-up, same prompt and seed, M4 Max 64 GB: H3 640×384 Fast 181 s;
+# x2 at 1 step 158 s (ArcFace 0.891 vs refs) and at 3 steps 357 s (0.850 — the
+# extra steps redraw the face AND erase the speed win: 538 s total against High
+# Fast's 535 s at 0.914). So 1 step: 339 s total, 37% under High Fast. Table in
+# docs/H3_ENGINE.md ("Fast HD").
+FAST_HD_FACEFIX_STEPS = 1
+FAST_HD_FACEFIX_5S_MIN = 2.7
+FACE_FIX_5S_MIN = {"draft": 2.5, "preview": 2.0, "standard": 4.0, "high": 9.0,
+ "fast_hd": FAST_HD_FACEFIX_5S_MIN}
# ============================================================================
# H3 RENDER SHAPE — two independent axes, priced by one measured cost model
@@ -10765,6 +10824,25 @@ def _h3_qualities() -> dict[str, dict]:
"note": H3_TIER_DRAFT_NOTE,
"offered": True,
},
+ # 4.19 "Fast HD": draft-then-sharpen. H3 renders the scene, motion,
+ # dialogue and sound at 640×384 on the 3-step Fast pass; LTX's x2
+ # Upscale & Face Fix then redraws the pixels at 1280×768, starting
+ # from the clip itself so the face is refined, not re-imagined. One
+ # click, two queued jobs, delivered as one clip beside its draft.
+ "fast_hd": {
+ "key": "fast_hd", "label": "Fast HD", "order": 0.5,
+ "width": 640, "height": 384,
+ "final_width": 1280, "final_height": 768,
+ "fast_hd": True,
+ # Same canvas as Draft, but the H3 pass decodes with the full VAE
+ # (the Face Fix starts from it), so it is not a "draft" tier.
+ "blurb": "H3 makes the shot fast at 640×384, then LTX's Upscale & "
+ "Face Fix sharpens it to 1280×768 from the clip itself, "
+ "keeping the face. About two thirds of High's wait on the "
+ "Fast pass; fine detail comes from the upscaler, so check "
+ "faces on your own shots.",
+ "offered": True,
+ },
"standard": {
"key": "standard", "label": "Standard", "order": 1,
"width": 768, "height": 448,
@@ -10843,6 +10921,11 @@ def _h3_qualities() -> dict[str, dict]:
q["wide"] = (int(q["width"]) * 9 == int(q["height"]) * 16)
q["canvas"] = f"{q['width']}×{q['height']}"
q["spec"] = f"{q['canvas']} · {q['aspect']}"
+ if q.get("fast_hd"):
+ # What the user gets is the upscaled clip; say both sizes.
+ q["canvas"] = f"{q['final_width']}×{q['final_height']}"
+ q["spec"] = f"{q['width']}×{q['height']} → {q['canvas']} · {q['aspect']}"
+ q.setdefault("fast_hd", False)
q.setdefault("draft", False)
q.setdefault("note", "")
# 0 = no canvas opinion; the length's own count applies.
@@ -10995,7 +11078,9 @@ def _build_h3_tiers() -> dict[str, dict]:
# the model (no mode term) covers the rest.
for mode_key, suffix in (("t2v", ""), ("i2v", "_i2v")):
m_min, m_eta, m_meas = tri_min, _fmt_eta(tri_min), False
- hit = H3_TRISTEP_MEASURED_ETA.get((q["key"], ln["key"], mode_key))
+ # Fast HD's H3 half IS a Draft-canvas Fast render.
+ hit = H3_TRISTEP_MEASURED_ETA.get(
+ ("draft" if q.get("fast_hd") else q["key"], ln["key"], mode_key))
if hit:
m_min, m_meas = hit[0] * hw, True
m_eta = hit[1] if hw == 1.0 else _fmt_eta(m_min)
@@ -11009,6 +11094,11 @@ def _build_h3_tiers() -> dict[str, dict]:
# An LTX pass: the chip factor only, not H3's RAM lane.
tristep["facefix_min"] = round(
ff * _hw_speed_factor("h3") * frames / 124.0, 2)
+ if q.get("fast_hd"):
+ # Fast HD never renders on Best: the 3-step pass IS the
+ # recipe, so the cell's own price is Fast + the fix.
+ eta_min = tristep["tristep_min"] + tristep.get("facefix_min", 0.0)
+ eta, eta_measured = _fmt_eta(eta_min), False
spec = f"{w}×{h} · {frames}f"
if windows > 1:
spec += f" · {windows}×5s"
@@ -11055,6 +11145,9 @@ def _build_h3_tiers() -> dict[str, dict]:
"notes": notes,
"note": " ".join(notes),
"draft": bool(q["draft"]),
+ "fast_hd": bool(q.get("fast_hd")),
+ "final_width": int(q.get("final_width") or w),
+ "final_height": int(q.get("final_height") or h),
"dense": bool(ln["dense"]),
"offered": bool(q["offered"] and ln["offered"]),
**tristep,
@@ -11155,6 +11248,17 @@ def h3_cell_gate(cell: dict) -> tuple[bool, str]:
f"`--chain-windows` on the installed H3 runner. Re-run "
f"'Install Hailuo H3' from the Phosphene sidebar to update the "
f"clone — your weights stay.")
+ if cell.get("fast_hd"):
+ if cell.get("dense"):
+ return (False, "Fast HD is built from 5 s windows; pick 3s, 5s, 10s or 15s.")
+ _tri = h3_tristep_status() if h3_available() else {"available": False}
+ if not _tri.get("available"):
+ return (False, "Fast HD renders on H3's Fast (3-step) pass — install "
+ "Fast first (one click on Speed → Fast, 180 MB).")
+ if not face_fix_adapter_ready():
+ return (False, f"Fast HD finishes with {FACE_FIX_NAME}, which needs the "
+ "LTX-2.5 Pixel Spatial Upscaler adapter (0.3 GB) — "
+ "download it in Settings → Models.")
allowed = H3_LENGTHS[cell["length"]].get("qualities") or ()
if allowed and cell["quality"] not in allowed:
return (False,
@@ -12729,9 +12833,32 @@ H3_UPSCALE_DEFAULT = "fit_720p"
H3_ORIENTATIONS = ("landscape", "portrait")
H3_ORIENTATION_DEFAULT = "landscape"
# Modes H3 can serve. Text = prompt only; Image = FL2VA first-frame
-# conditioning. Everything else (FFLF, Extend, Remix, Character, A2V) is
-# LTX-pipeline-specific and has no H3 equivalent.
-H3_MODES = ("t2v", "i2v")
+# conditioning; Keyframes = first/last/timed stills (the official FL2VA task,
+# timed frames on the same clock); Extend = continue a clip from its last 17
+# frames and their sound; a2v = Lip-sync (the picture follows a soundtrack
+# held clean in the target audio rows); v2a = Add sound (the picture held, only
+# the audio generated). Every mode past Image needs a runner flag the panel
+# probes (h3_supports_keyframes / _extend / _audio_drive / _video_to_audio), so
+# an older pack hides the control instead of failing mid-render. Remix and
+# Character stay LTX-pipeline-specific.
+H3_MODES = ("t2v", "i2v", "keyframe", "extend", "a2v", "v2a")
+# Modes past Text/Image and the runner capability each one needs — the one map
+# make_job, the worker and the UI gate read.
+H3_MODE_CAPABILITY = {
+ "keyframe": "keyframes",
+ "extend": "extend",
+ "a2v": "audio_drive",
+ "v2a": "video_to_audio",
+}
+# Carried context between chained windows, in frames: one 17-frame VAE clip
+# (0.7 s) of picture plus its sound. Measured on seams before it shipped as
+# the default; `h3_continuity=off` keeps the old one-still hand-over.
+H3_CONTEXT_FRAMES = 17
+# Every window decodes on its own and lands a percent or two off its
+# predecessor's grade; easing the new window onto the carried last frame over
+# 24 frames took the colour step at the seam from 13x the clip's own
+# frame-to-frame change to 1.7x on the first measured chain (H3_BUILD_REPORT).
+H3_SEAM_COLOUR_FRAMES = 24
def _h3_model_roots() -> list[Path]:
@@ -15274,6 +15401,54 @@ def h3_supports_chain_prompts() -> bool:
return _h3_runner_has_flag("--chain-prompts")
+def h3_supports_keyframes() -> bool:
+ """Whether the INSTALLED runner takes a last frame and timed keyframes
+ (`--last-frame`, `--keyframe PATH@WHEN`) — Start & end frame and
+ Keyframes on H3. Same probe as every other capability: the script text."""
+ return _h3_runner_has_flag("--last-frame") and _h3_runner_has_flag("--keyframe")
+
+
+def h3_supports_continuation() -> bool:
+ """Whether the INSTALLED runner carries real context between chained
+ windows (`--chain-context-frames`): the last 17 frames and their sound,
+ not one still and a fresh seed."""
+ return _h3_runner_has_flag("--chain-context-frames")
+
+
+def h3_supports_extend() -> bool:
+ """Whether the INSTALLED runner can continue an existing clip (`--extend-from`)."""
+ return _h3_runner_has_flag("--extend-from") and h3_supports_continuation()
+
+
+def h3_supports_audio_drive() -> bool:
+ """Whether the INSTALLED runner can render to a supplied soundtrack
+ (`--audio-drive`, H3 lip-sync)."""
+ return _h3_runner_has_flag("--audio-drive")
+
+
+def h3_supports_video_to_audio() -> bool:
+ """Whether the INSTALLED runner can score a silent clip (`--video-to-audio`)."""
+ return _h3_runner_has_flag("--video-to-audio")
+
+
+H3_MODE_LABELS = {"keyframe": "keyframes", "extend": "Extend",
+ "a2v": "Lip-sync", "v2a": "Add sound"}
+
+
+def h3_mode_supported(mode: str) -> bool:
+ """Can the INSTALLED runner serve this H3 mode? Text/Image always (their
+ flags are older than every gate here); the rest per H3_MODE_CAPABILITY."""
+ cap = H3_MODE_CAPABILITY.get(str(mode or ""))
+ if cap is None:
+ return True
+ return {
+ "keyframes": h3_supports_keyframes,
+ "extend": h3_supports_extend,
+ "audio_drive": h3_supports_audio_drive,
+ "video_to_audio": h3_supports_video_to_audio,
+ }[cap]()
+
+
def h3_supports_memory_limits() -> bool:
"""Whether the INSTALLED runner accepts `--memory-gb` / `--wired-gb`."""
return (_h3_runner_has_flag("--memory-gb")
@@ -15662,6 +15837,13 @@ def h3_status() -> dict:
# what each window should do. False hides the control and leaves the
# cell carrying H3_TIER_CHAIN_NOTE_LEGACY instead.
"chain_prompts": available and h3_supports_chain_prompts(),
+ # 4.19 H3 capabilities, each probed on the INSTALLED runner so an older
+ # pack hides the control instead of failing 30 s into a render.
+ "keyframes": available and h3_supports_keyframes(),
+ "continuation": available and h3_supports_continuation(),
+ "extend": available and h3_supports_extend(),
+ "audio_drive": available and h3_supports_audio_drive(),
+ "video_to_audio": available and h3_supports_video_to_audio(),
# The `?` copy for that control, so the sentence explaining the
# mechanic lives next to the mechanic.
"chain_prompt_help": H3_CHAIN_PROMPT_HELP,
@@ -16917,7 +17099,9 @@ ENGINES: tuple[dict, ...] = (
"builtin": True,
"probe": None,
"modes": None,
- "excluded_modes": (),
+ # Add sound (v2a) scores a silent clip with H3's joint audio; LTX has
+ # no picture-held audio pass, so the mode is H3's alone.
+ "excluded_modes": ("v2a",),
"serves_label": "every mode",
"surfaces": ("video",),
# LTX fuses as many LoRAs as you stack, from mlx_models/loras/.
@@ -16938,7 +17122,7 @@ ENGINES: tuple[dict, ...] = (
# H3-16: named the modes it lacks (Text and Image only) but not that
# it takes LoRAs from its own library, the one real capability a
# user comparing rows would want stated next to LTX's.
- "tagline": "joint video + dialogue + sound, its own LoRAs. Text and Image only.",
+ "tagline": "joint video + dialogue + sound, its own LoRAs. Keyframes, Extend, Lip-sync and Add sound too.",
"mark": "eng-mark-h3",
"accent": "#FF2E9F",
"accent_dim": "rgba(255,46,159,0.14)",
@@ -16947,7 +17131,7 @@ ENGINES: tuple[dict, ...] = (
"probe": "h3",
"modes": H3_MODES,
"excluded_modes": ("character", "i2v_clean_audio"),
- "serves_label": "Text and Image",
+ "serves_label": "Text, Image, Keyframes, Extend, Lip-sync and Add sound",
"surfaces": ("video",),
# H3 takes ONE adapter through the same `--lora` flag Turbo rides, out
# of its own library (see _h3_loras_dir). The picker is additionally
@@ -20051,6 +20235,87 @@ def _ensure_downscaled(src: Path, max_dim: int = 768, align: int = 32) -> Path:
return cached
+def _extend_audio_master_for(src: Path) -> Path | None:
+ """The lossless audio master an earlier Extend left for `src` (its
+ sidecar's `extend_audio_master`), or None when there is none on disk."""
+ try:
+ data = json.loads(src.with_suffix(src.suffix + ".json").read_text(encoding="utf-8")) or {}
+ except (OSError, ValueError):
+ return None
+ cand = data.get("extend_audio_master") if isinstance(data, dict) else None
+ try:
+ return Path(cand) if cand and Path(cand).is_file() else None
+ except OSError:
+ return None
+
+
+def deliver_extend(src: Path, generated: Path, generated_audio: Path | None,
+ final_out: Path, work: Path, *, engine: str, codec: dict,
+ direction: str = "after", new_frames: int | None = None,
+ generated_lossless: bool = True, picked: Path | None = None) -> dict:
+ """Write an Extend's delivery: the SOURCE file's own frames, untouched,
+ plus the frames the model added (issue #48). Returns the splice report
+ the sidecar records.
+
+ Both engines carry the source region through the model without
+ re-denoising it, but used to deliver the pipeline's own copy of it — so
+ every round of an extend chain re-encoded (and, on LTX, VAE- and
+ vocoder-round-tripped) the WHOLE accumulated clip, and the damage
+ compounded: the "made out of particles" picture and the audio mush in
+ the report. `extend_splice` keeps the source's H.264 stream bit-exact
+ when it can, decodes it exactly once when it cannot, and encodes the
+ soundtrack once from a lossless master (see that module's docstring for
+ the measurements). The model's conditioning is not touched.
+
+ Never loses a render: if the splice cannot produce a verified file, the
+ model's own output is delivered exactly as before this change and the
+ log says so."""
+ import extend_splice as xs # noqa: PLC0415
+ master_out = OUTPUT / ".extend" / "masters" / (final_out.name + ".flac")
+ try:
+ n_gen = xs.probe(FFPROBE, generated)["frames"]
+ if engine == "h3":
+ layout = xs.h3_layout(n_gen, int(new_frames or 0))
+ else:
+ layout = xs.ltx_layout(xs.probe(FFPROBE, src)["frames"], n_gen, direction)
+ report = xs.splice(
+ ffmpeg=FFMPEG, ffprobe=FFPROBE, source=src, generated=generated,
+ generated_audio=generated_audio, out=final_out, layout=layout, work=work,
+ pix_fmt=codec["pix_fmt"], crf=codec["crf"],
+ generated_lossless=generated_lossless,
+ # The master hangs off whichever sidecar the earlier render wrote:
+ # its own (an LTX extend) or its export's (H3 shows the `_720p`
+ # file, and that is the one with a sidecar). splice() still checks
+ # the master's length against the source before trusting it.
+ source_master=(_extend_audio_master_for(src)
+ or (_extend_audio_master_for(picked) if picked else None)),
+ master_out=master_out,
+ run=run_ffmpeg_tracked)
+ except JobCancelled:
+ raise
+ except Exception as exc: # noqa: BLE001
+ push(f"Extend: could not keep {src.name} as it was ({exc}) — delivering the "
+ f"model's own output for this round instead.")
+ if generated_lossless:
+ cmd = [str(FFMPEG), "-y", "-v", "error", "-i", str(generated)]
+ if generated_audio and Path(generated_audio).is_file():
+ cmd += ["-i", str(generated_audio), "-map", "0:v:0", "-map", "1:a:0"]
+ cmd += ["-c:v", "libx264", "-pix_fmt", codec["pix_fmt"], "-crf", codec["crf"],
+ "-c:a", "aac", "-b:a", "192k", "-movflags", "+faststart", str(final_out)]
+ run_ffmpeg_tracked(cmd, "Extend: encode")
+ elif generated != final_out:
+ os.replace(generated, final_out)
+ return {"video": "fallback", "error": str(exc)[:300]}
+ push(f"Extend: delivered {final_out.name} — source {report['video']} "
+ f"({layout.source_frames} frames"
+ + (", bit-exact" if report["video"] == "copy" else "")
+ + f") + {layout.new_frames} new, audio from the {report['audio']} source "
+ f"track, {report['fade_ms']:g} ms crossfade at {report['seam_seconds']:.2f}s"
+ + (f" [{report['video_note']}]" if report.get("video_note") else ""))
+ shutil.rmtree(work, ignore_errors=True)
+ return report
+
+
# ============================================================================
# Ingredients (multi-reference) — sheet compositing + conditioning clip
# ============================================================================
@@ -29782,6 +30047,13 @@ def _engine_would_be_h3(requested: str, mode: str) -> bool:
return False
if not engine_serves_mode(engine_by_id("h3") or {}, (mode or "t2v")):
return False
+ # make_job's older-runner fallback (Codex 4.19.0): a Keyframes / Extend /
+ # Lip-sync job on a runner that predates the mode renders on LTX, so a
+ # character on it is an LTX character, not "H3 cannot load the character".
+ # Add sound has no LTX lane and stays H3 (the worker refuses it).
+ m = mode or "t2v"
+ if m != "v2a" and h3_available() and not h3_mode_supported(m):
+ return False
return bool(h3_capable())
@@ -30770,7 +31042,7 @@ def a2v_requested_scale(params: dict):
# from make_job before this matters (their own branches validate them).
QUEUEABLE_VIDEO_MODES = frozenset((
"t2v", "i2v", "i2v_clean_audio", "extend", "keyframe", "a2v", "retake",
- "restore", "ingredients", "control", "upscale", "sharp_export",
+ "restore", "ingredients", "control", "upscale", "sharp_export", "v2a",
))
_IMAGE_CONDITIONED_MODES = ("i2v", "i2v_clean_audio")
INPUT_MISSING_IMAGE = ("Image mode needs a reference image — drop one into the "
@@ -30854,10 +31126,10 @@ def job_input_refusal(params: dict) -> str | None:
if not src or not _exists(src):
return (f"source video for Colorize not found: {src!r}. Pick a B&W "
"clip in the Colorize source picker (or paste a path).")
- elif m in ("extend", "retake"):
+ elif m in ("extend", "retake", "v2a"):
src = _path("video_path")
if not src or not _exists(src):
- what = "Extend" if m == "extend" else "Retake"
+ what = {"extend": "Extend", "retake": "Retake"}.get(m, "Add sound")
return (f"{what} needs the clip it continues - pick a finished clip "
f"(source {src!r} is not on disk).")
elif m == "a2v":
@@ -31369,6 +31641,10 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
_engine = (f("engine", ENGINE_DEFAULT) or ENGINE_DEFAULT).strip().lower()
if _engine not in ENGINE_IDS:
_engine = ENGINE_DEFAULT
+ if mode_in == "v2a":
+ # Add sound exists on one engine only; a form or curl that left the
+ # engine field at its default still means H3.
+ _engine = "h3"
# An engine can be in the table and still not be renderable (Flux Video is
# `announced` — no weights exist). Refuse it here, not at the worker.
if (engine_by_id(_engine) or {}).get("state") == "announced":
@@ -31453,6 +31729,14 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
push(f"engine=h3 requested for mode={mode_in!r} — Hailuo H3 only "
f"serves {', '.join(H3_MODES)}; falling back to LTX.")
_engine = "ltx"
+ elif (mode_in != "v2a" and h3_available() and not h3_mode_supported(mode_in)):
+ # A mode the INSTALLED runner predates: render it on LTX with a
+ # sentence rather than queue an argparse failure. (Add sound has no
+ # LTX lane; the worker refuses it with the update sentence.)
+ push(f"Hailuo H3 can render {H3_MODE_LABELS.get(mode_in, mode_in)} once "
+ "its runner is updated (Update in Pinokio, or 'Update Hailuo H3 "
+ "runner') — rendering this one on LTX.")
+ _engine = "ltx"
elif not h3_capable():
# Same verdict the refusal raises: the floor depends on the lane,
# and on a 46-60 GB Mac the answer is a build step, not a number.
@@ -31516,6 +31800,16 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
push(f"Fast runs {H3_TRISTEP_FORWARDS} forwards on "
f"its own ladder — ignoring the {_h3_steps}-step override.")
_h3_steps = 0
+ if H3_TIERS[_h3_tier].get("fast_hd"):
+ # Fast HD is a recipe, not a canvas: the 3-step Fast pass, then the
+ # x2 Upscale & Face Fix. Both are forced here so a stale Speed pill
+ # or Export choice cannot quietly render half of it.
+ if not _h3_tristep and h3_available():
+ push("Fast HD always renders on Fast (3 steps).")
+ _h3_tristep = bool(h3_available()) or _h3_tristep
+ _h3_turbo = False
+ _h3_steps = 0
+ _h3_upscale = "ltx_x2"
# Per-window prompts, matched to the cell that will ACTUALLY render.
# Normalising after the fallback above is the whole point: a 15 s
# request that degraded to 5 s has one window, and three prompts on a
@@ -31676,6 +31970,17 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
# action/dialogue. Same allowlist trap: leave it out and it no-ops.
"h3_chain_prompts_complete": f("h3_chain_prompts_complete", "").strip().lower()
in ("1", "true", "on", "yes"),
+ # 4.19: carried context between H3 windows (the last 17 frames and
+ # their sound ride into the next window). On unless the form says
+ # "off" — "off" is the old one-still hand-over, kept for A/B and
+ # for a runner that predates it. SAME allowlist trap as every key.
+ "h3_continuity": (f("h3_continuity", "on").strip().lower()
+ not in ("0", "false", "off", "no")),
+ # Extend on H3: how many seconds to add after the source clip. The
+ # LTX lane's `extend_frames` counts its 8-frame latents and cannot
+ # say this. SAME allowlist trap.
+ "h3_extend_seconds": _safe_float(f("h3_extend_seconds", "5"), 5.0,
+ minimum=0.5),
"take": _take,
# LTX-2.5 distilled schedule preset — "" (tuned default) or
# "fast"/"vendor", already gated above to the lane that defines
@@ -31917,6 +32222,10 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
else:
job["params"]["width"] = _tier_cfg["width"]
job["params"]["height"] = _tier_cfg["height"]
+ if job["params"].get("mode") == "a2v":
+ # Lip-sync's length is the form's duration (the audio's), not the
+ # cell's: keep what was asked before the cell's frames land below.
+ job["params"]["h3_a2v_frames"] = max(1, int(job["params"].get("frames") or 0))
# DELIVERED frames — for a chained tier that is the stitched total, not
# the per-window count, so the queue card and the duration line read the
# clip the user actually gets. run_h3_job_inner splits it back out.
@@ -32943,10 +33252,12 @@ def run_train_job_inner(job: dict) -> None:
user_caps = 0
auto_caps = 0
+ user_cap_files: list[Path] = []
for img in image_files:
cap = captions_dir / (img.stem + ".txt")
if cap.exists():
user_caps += 1
+ user_cap_files.append(cap)
continue
try:
cap.write_text(fallback_text, encoding="utf-8")
@@ -32966,6 +33277,42 @@ def run_train_job_inner(job: dict) -> None:
push(f"[train] caption_strategy=user_provided but no .txt files found — "
f"auto-filled all {total_imgs} images with '{fallback_summary}'")
+ # Trigger/caption consistency check (#62, Morac2 / valeriosan_v2, 2026-09-30).
+ # `user_provided` captions are trusted verbatim above — nothing before
+ # this point ever reads what's actually IN them. A dataset carried over
+ # from an earlier training attempt (same cropped photos, old caption
+ # .txt files still sitting in captions/) silently retrains a perfectly
+ # good identity under the OLD trigger while every surface a user can
+ # see (sidecar, Train tab, Characters picker) reports the NEW one.
+ # Measured on a real case: 42/42 existing captions carried a trigger
+ # different from the one the job was submitted with; the resulting
+ # LoRA attached cleanly (576/576 modules, healthy-looking delta_rms)
+ # and simply never responded to the word the user was told to prompt
+ # with. Refuse before burning GPU hours on a run nobody can use;
+ # matches the existing "0 modules attached" refusal shape in
+ # runtime_loras.py — a contract violation caught before it produces a
+ # plausible-looking, silently-wrong result.
+ if user_cap_files:
+ mismatched, other = _caption_trigger_mismatches(user_cap_files, trigger)
+ if mismatched:
+ other_desc = (f"; the dominant one instead is {other[0]!r} "
+ f"({other[1]}/{len(mismatched)} mismatched files)"
+ if other else "")
+ if len(mismatched) == len(user_cap_files):
+ raise RuntimeError(
+ f"none of the {len(user_cap_files)} existing caption files "
+ f"contain the trigger {trigger!r} this job was submitted "
+ f"with{other_desc}. This dataset's captions/ almost "
+ "certainly carries leftovers from an earlier training run "
+ "on the same photos. Training would silently produce a "
+ f"LoRA that never responds to {trigger!r} — delete or "
+ "regenerate captions/ for this trigger before retrying."
+ )
+ push(f"[train] WARNING: {len(mismatched)} / {len(user_cap_files)} "
+ f"existing caption files do not contain the trigger "
+ f"{trigger!r}{other_desc}. Proceeding, but the resulting "
+ "LoRA may only partially respond to the intended trigger.")
+
# Output path for the trained LoRA. Going straight into
# mlx_models/loras/ so the existing picker scan finds it.
#
@@ -33653,7 +34000,7 @@ def _cover_crop_image(im, width: int, height: int, focus: float = 0.5):
def _h3_fit_first_frame(src: Path, width: int, height: int, job_id: str,
- focus: float = 0.5) -> Path:
+ focus: float = 0.5, tag: str = "firstframe") -> Path:
"""Cover-crop `src` onto the H3 canvas and return the path to use.
Why the panel does this instead of the runner: upstream's
@@ -33697,7 +34044,7 @@ def _h3_fit_first_frame(src: Path, width: int, height: int, job_id: str,
return src # runner's own early-return handles it
fitted = _cover_crop_image(im, width, height, focus)
UPLOADS.mkdir(parents=True, exist_ok=True)
- out = UPLOADS / f".h3_{job_id}_firstframe_{width}x{height}.png"
+ out = UPLOADS / f".h3_{job_id}_{tag}_{width}x{height}.png"
fitted.save(out, format="PNG")
return out
except Exception as exc: # noqa: BLE001 - never fatal
@@ -34152,6 +34499,10 @@ def _chain_upscale_after_h3(job: dict, p: dict, native_path: Path) -> None:
else (p.get("seed") if p.get("seed") not in (None, "") else "-1")),
label=str(p.get("label") or native_path.stem),
frames=_probe_video_frames(str(native_path)) or 0)
+ if str(p.get("h3_quality") or "") == "fast_hd":
+ # Fast HD's finish: the "face kept" recipe (1 step from the clip).
+ form["upscale_steps"] = str(FAST_HD_FACEFIX_STEPS)
+ form["preset_label"] = f"{str(p.get('label') or native_path.stem)} · Fast HD"
nxt = make_job(form)
nxt["params"]["source"] = "chain"
nxt["params"]["chained_from"] = job.get("id")
@@ -34177,6 +34528,280 @@ def _chain_upscale_after_h3(job: dict, p: dict, native_path: Path) -> None:
# (4.17 Codex review, H3-1.) The panel-side machinery below stays, gated.
H3_RUNNER_KEEPS_WINDOWS_ON_STOP = False
+H3_WINDOW_FRAMES = 124 # one 5 s window on the 17n+5 grid
+H3_EXTEND_MAX_SECONDS = 15.0
+H3_A2V_MAX_SECONDS = 30.0
+H3_V2A_MAX_SECONDS = 60.0
+# The runner decodes the whole source clip onto the render canvas (the new
+# part is stitched after it), so an Extend source is capped like Add sound's:
+# a minute at 1024x576 is ~2.5 GB of frames held through the render.
+H3_EXTEND_SOURCE_MAX_SECONDS = 60.0
+# The prompt contract a held soundtrack is rendered under: the picture performs
+# the supplied sound and invents none of its own. Appended when the user's
+# prompt does not already say it (the LTX lip-sync recipe's lesson: name the
+# sync, never the stillness).
+H3_A2V_CONTRACT = ("The speaker lip-syncs every syllable to the supplied "
+ "soundtrack, exactly as it is.")
+
+
+def h3_a2v_prompt(prompt: str) -> str:
+ """The lip-sync prompt with its sync contract, added once.
+
+ Inside the description field when the prompt uses H3's three-field form
+ (before `overall_soundscape:`), else at the end."""
+ text = (prompt or "").strip()
+ if "lip-sync" in text.lower() or "lip sync" in text.lower():
+ return text
+ marker = "\n\noverall_soundscape:"
+ if marker in text:
+ head, tail = text.split(marker, 1)
+ return f"{head.rstrip()} {H3_A2V_CONTRACT}{marker}{tail}"
+ return f"{text} {H3_A2V_CONTRACT}".strip()
+
+
+def h3_windows_for(frames: int, window_frames: int = H3_WINDOW_FRAMES) -> int:
+ """Windows a chain of `window_frames` windows needs to deliver `frames`
+ (each window after the first adds window_frames - 1)."""
+ frames = max(1, int(frames))
+ if frames <= window_frames:
+ return 1
+ return 1 + -(-(frames - window_frames) // (window_frames - 1))
+
+
+def h3_window_for_short(frames: int) -> int:
+ """The smallest 17n+5 window that holds `frames` (one window, no chain)."""
+ n = max(22, int(frames))
+ while n % 17 != 5:
+ n += 1
+ return n
+
+
+def _h3_keyframe_list(p: dict) -> list[tuple[str, int | None]]:
+ """[(image path, frame index or None)] in time order from the Keyframe
+ form: `keyframes_json` (first … last) when present, else the start/end
+ pair. None = "the clip's own first/last frame"."""
+ raw = str(p.get("keyframes_json") or "").strip()
+ out: list[tuple[str, int | None]] = []
+ if raw:
+ try:
+ items = json.loads(raw)
+ except json.JSONDecodeError as exc:
+ raise RuntimeError(f"keyframes_json must be valid JSON: {exc}") from exc
+ if not isinstance(items, list) or len(items) < 2:
+ raise RuntimeError("keyframes_json must be a list with at least two stills")
+ for i, item in enumerate(items):
+ img = normalize_pasted_path(str((item or {}).get("image_path") or "").strip())
+ if i in (0, len(items) - 1):
+ out.append((img, None))
+ else:
+ out.append((img, int((item or {}).get("frame_index") or 0)))
+ return out
+ start = normalize_pasted_path(str(p.get("start_image") or "").strip())
+ end = normalize_pasted_path(str(p.get("end_image") or "").strip())
+ return [(start, None), (end, None)]
+
+
+def h3_media_plan(job: dict, p: dict, mode: str, tier: dict, width: int,
+ height: int, window_frames: int, chain_windows: int,
+ frames: int, paths: dict) -> dict:
+ """The runner flags and the render shape for H3's media modes.
+
+ Text and Image pass straight through (empty argv, shape unchanged). The
+ others each name what they need and refuse what they cannot use, before
+ the GPU is touched:
+
+ * keyframe — Start & end frame / Keyframes: `--first-frame` (optional on
+ H3: an end frame alone is the official last-frame task), `--last-frame`,
+ and `--keyframe PATH@FRAME` for every beat in between, on the clip's own
+ 24 fps timeline.
+ * extend — `--extend-from SOURCE`, as many new 5 s windows as the seconds
+ asked for, `--extend-frames` to land on the exact length. Always carries
+ the source's last 17 frames and their sound.
+ * a2v — Lip-sync: the soundtrack is held in the target audio rows
+ (`--audio-drive`, the separated vocal when "voice only" is on) and the
+ user's file is what the clip delivers (`--audio-mux`).
+ * v2a — Add sound: the clip's picture is held (`--video-to-audio`), only
+ its sound is generated, and the delivery is the source's own video
+ stream with the new track.
+ """
+ out = {"argv": [], "first_frame": None, "chain_windows": chain_windows,
+ "window_frames": window_frames, "frames": frames, "notes": [],
+ "tristep_off": False}
+ if mode not in H3_MODE_CAPABILITY:
+ return out
+ flag = {"keyframe": "--last-frame", "extend": "--extend-from",
+ "a2v": "--audio-drive", "v2a": "--video-to-audio"}[mode]
+ if not h3_mode_supported(mode):
+ raise RuntimeError(f"{H3_MODE_LABELS[mode]} on Hailuo H3: "
+ + _h3_runner_behind(flag, paths["runner"],
+ "Or render it on LTX."))
+ focus = _job_crop_focus(p)
+
+ def _still(src: str, tag: str) -> Path:
+ if not src or not Path(src).is_file():
+ raise RuntimeError(f"The {tag.replace('_', ' ')} still is not on disk "
+ f"({src or 'none picked'}) — pick it again.")
+ err = h3_reference_image_error(Path(src))
+ if err:
+ raise RuntimeError(err)
+ return _h3_fit_first_frame(Path(src), width, height, job["id"], focus, tag=tag)
+
+ if mode == "keyframe":
+ kfs = _h3_keyframe_list(p)
+ start, end = kfs[0][0], kfs[-1][0]
+ if not end:
+ raise RuntimeError("Keyframes on H3 need an end frame — pick the still "
+ "the clip should land on (the start frame is optional).")
+ if start:
+ out["first_frame"] = _still(start, "start_frame")
+ out["argv"] += ["--last-frame", str(_still(end, "end_frame"))]
+ for i, (img, idx) in enumerate(kfs[1:-1], start=2):
+ # The beat's own frame on the 24 fps timeline, kept strictly
+ # inside the clip so it cannot collide with the first/last frame.
+ at = max(1, min(int(frames) - 2, int(idx or 0)))
+ out["argv"] += ["--keyframe", f"{_still(img, f'beat{i}')}@{at}"]
+ out["notes"].append(
+ "keyframes: " + " → ".join(
+ [("start" if start else "(free start)")]
+ + [f"beat at {max(1, min(int(frames) - 2, int(i or 0))) / H3_FPS:.2f}s"
+ for _, i in kfs[1:-1]]
+ + ["end"]))
+ return out
+
+ if mode == "extend":
+ src = str(p.get("video_path") or "").strip()
+ if not src or not Path(src).is_file():
+ raise RuntimeError("Extend needs the clip it continues — pick a finished clip.")
+ # Continue the NATIVE render, never the gallery's export of it (issue
+ # #48, the same fix the LTX lane got in v3.4.2). An H3 render is shown
+ # as its `_720p` export, so the picker hands Extend a lanczos-upscaled
+ # re-encode; the runner then cover-scales it back DOWN onto the
+ # canvas, and every round of a chain paid that resample twice.
+ _native = _native_render_for(Path(src))
+ if _native != Path(src):
+ out["notes"].append(f"extend: using the native render {_native.name} "
+ f"instead of the export {Path(src).name}")
+ src = str(_native)
+ if str(p.get("extend_direction") or "after") == "before":
+ out["notes"].append("H3 extends forward only — adding after the clip.")
+ seconds = max(0.5, min(H3_EXTEND_MAX_SECONDS,
+ float(p.get("h3_extend_seconds") or 5.0)))
+ new_frames = int(round(seconds * H3_FPS))
+ src_dur = probe_media_duration(src) or 0.0
+ if src_dur > H3_EXTEND_SOURCE_MAX_SECONDS:
+ raise RuntimeError(
+ f"Extend continues clips up to {H3_EXTEND_SOURCE_MAX_SECONDS:.0f}s long; "
+ f"{Path(src).name} is {src_dur:.1f}s. Extend a shorter cut of it.")
+ src_frames = _probe_video_frames(src) or 0
+ src_fps = _probe_video_fps(src) or float(H3_FPS)
+ src_frames_24 = int(round(src_frames * H3_FPS / src_fps)) if src_frames else 0
+ if src_frames_24 and src_frames_24 < 2:
+ raise RuntimeError("That clip is too short to continue.")
+ out["window_frames"] = H3_WINDOW_FRAMES
+ out["chain_windows"] = h3_windows_for(new_frames + 1)
+ out["frames"] = (src_frames_24 or 0) + new_frames
+ out["argv"] += ["--extend-from", src, "--extend-frames", str(new_frames)]
+ out["extend_source"] = src
+ out["extend_new_frames"] = new_frames
+ out["notes"].append(f"extend: +{seconds:g}s after {Path(src).name} "
+ f"({out['chain_windows']} new window(s), the last "
+ f"{H3_CONTEXT_FRAMES} frames and their sound carried in)")
+ return out
+
+ if mode == "a2v":
+ audio = str(p.get("audio") or "").strip()
+ if not audio or not Path(audio).is_file():
+ raise RuntimeError(INPUT_MISSING_AUDIO)
+ start_t = max(0.0, float(p.get("audio_start_time") or 0.0))
+ total = probe_media_duration(audio) or 0.0
+ avail = max(0.0, total - start_t) if total else None
+ want = int(p.get("h3_a2v_frames") or frames) / float(H3_FPS)
+ if avail is not None:
+ if avail <= 0.2:
+ raise RuntimeError(f"Start at {start_t:.1f}s is past the end of "
+ f"{Path(audio).name} ({total:.1f}s).")
+ want = min(want, avail)
+ want = min(want, H3_A2V_MAX_SECONDS)
+ # The track decides the length. A short line still renders one whole
+ # 22-frame window (the model's smallest), but --chain-total-frames trims
+ # delivery back to the audio, so a 0.5 s line is not padded with silence.
+ delivered = max(6, int(round(want * H3_FPS)))
+ if delivered <= H3_WINDOW_FRAMES:
+ out["window_frames"] = h3_window_for_short(delivered)
+ out["chain_windows"] = 1
+ else:
+ out["window_frames"] = H3_WINDOW_FRAMES
+ out["chain_windows"] = h3_windows_for(delivered)
+ out["frames"] = delivered
+ drive, note = a2v_conditioning_audio(p, audio)
+ if note:
+ out["notes"].append(note)
+ out["argv"] += ["--audio-drive", str(drive),
+ "--audio-drive-offset", f"{start_t:.3f}"]
+ if str(drive) != audio:
+ out["argv"] += ["--audio-mux", audio]
+ image = str(p.get("image") or "").strip()
+ if image and Path(image).is_file():
+ out["first_frame"] = _still(image, "face")
+ if out["chain_windows"] > 1:
+ out["argv"] += ["--chain-windows", str(out["chain_windows"])]
+ out["argv"] += ["--chain-total-frames", str(delivered)]
+ out["notes"].append(f"lip-sync: {delivered / H3_FPS:.2f}s of "
+ f"{Path(audio).name} from {start_t:.1f}s")
+ return out
+
+ # v2a
+ src = str(p.get("video_path") or "").strip()
+ if not src or not Path(src).is_file():
+ raise RuntimeError("Add sound needs the clip to score — pick a finished clip.")
+ dur = probe_media_duration(src) or 0.0
+ if dur <= 0:
+ raise RuntimeError(f"{Path(src).name} has no readable video.")
+ if dur > H3_V2A_MAX_SECONDS:
+ raise RuntimeError(f"Add sound scores up to {H3_V2A_MAX_SECONDS:.0f}s at a time; "
+ f"{Path(src).name} is {dur:.1f}s. Cut it shorter first.")
+ delivered = int(round(dur * H3_FPS))
+ out["window_frames"] = H3_WINDOW_FRAMES
+ out["chain_windows"] = h3_windows_for(delivered)
+ out["frames"] = delivered
+ out["argv"] += ["--video-to-audio", src]
+ out["notes"].append(f"add sound: {dur:.2f}s of {Path(src).name}, "
+ "picture kept exactly as it is")
+ return out
+
+
+
+def _h3_drop_runner_wavs(out_path: Path, since: float, *, keep_main: bool = False) -> list[str]:
+ """Remove the intermediate WAVs the H3 runner leaves beside its mp4.
+
+ The runner (minimax_h3_mlx/media.py save_mp4 / mux_audio_onto_video)
+ writes the soundtrack to ``<out>.wav`` (and ``<out>_source.wav`` when it
+ time-stretches) only to mux it, and never removes it. In OUTPUT that is
+ a stray file per render that the gallery and the Editor's sound pool list
+ as a separate audio output: 188 of them had piled up on one install. The
+ mp4 carries the same sound.
+
+ Only files this render wrote are touched: same stem as the job's own
+ output path AND modified at or after the job started, so a user's own
+ WAV that happens to share the name is never removed. ``keep_main`` keeps
+ ``<out>.wav`` for a caller that still needs it (Extend moves it into its
+ splice work dir first). #48's FLAC masters live in OUTPUT/.extend/masters
+ and are never matched here.
+ """
+ out_path = Path(out_path)
+ names = [out_path.with_name(out_path.stem + "_source.wav")]
+ if not keep_main:
+ names.append(out_path.with_suffix(".wav"))
+ removed: list[str] = []
+ for w in names:
+ try:
+ if w.is_file() and not w.is_symlink() and w.stat().st_mtime >= since - 1.0:
+ w.unlink()
+ removed.append(w.name)
+ except OSError:
+ continue
+ return removed
+
def run_h3_job_inner(job: dict) -> None:
"""Render one job on the Hailuo H3 engine (optional subprocess pack).
@@ -34552,6 +35177,43 @@ def run_h3_job_inner(job: dict) -> None:
f"conditioning (keeps its proportions — the runner would "
f"stretch the first keyframe onto the canvas).")
+ # ---- 4.19: keyframes, extend, lip-sync, add sound --------------------
+ # Each is one or two runner flags; the shape bookkeeping (how many windows,
+ # how many frames are delivered) is what the rest of this function reads.
+ plan = h3_media_plan(job, p, mode, tier, width, height, window_frames,
+ chain_windows, frames, paths)
+ if mode in ("extend", "a2v", "v2a"):
+ # One prompt for the whole clip on these modes; a shot list belongs to
+ # a chained Text/Image/Keyframes render.
+ chain_prompts = []
+ if mode == "a2v":
+ prompt = h3_a2v_prompt(prompt)
+ mode_argv: list[str] = plan["argv"]
+ if plan.get("first_frame") is not None:
+ first_frame = plan["first_frame"]
+ chain_windows = plan["chain_windows"]
+ window_frames = plan["window_frames"]
+ frames = plan["frames"]
+ if mode in H3_MODE_CAPABILITY:
+ # The clip these modes deliver (source + new frames, the track's
+ # length, the scored clip's length) — not the cell's — so the Now card
+ # and the sidecar read the real duration.
+ p["frames"] = frames
+ for _note in plan.get("notes") or []:
+ push(f"[h3] {_note}")
+ if plan.get("tristep_off") and tristep:
+ tristep = False
+ p["h3_tristep"] = False
+ steps = int(p.get("h3_steps") or tier["steps"])
+ # Carried context between chained windows (and always for Extend and Add
+ # sound, where it is the point). Off only when the job says so or the
+ # runner predates it — the old one-still hand-over then runs unchanged.
+ context_frames = 0
+ if (chain_windows > 1 or mode in ("extend", "v2a")) and h3_supports_continuation():
+ if p.get("h3_continuity", True) or mode in ("extend", "v2a"):
+ context_frames = H3_CONTEXT_FRAMES
+ p["h3_context_frames"] = context_frames
+
# Seed: the panel keeps "-1" = random. H3's runner has no random mode, so
# resolve it here and record what we used (matches the LTX seed_used
# contract the ⓘ modal + Load Params already read).
@@ -34658,10 +35320,22 @@ def run_h3_job_inner(job: dict) -> None:
_native_crf = min(18, max(0, int(float(job_codec["crf"]))))
except (TypeError, ValueError):
_native_crf = 18
- if _native_crf != 18 and _h3_runner_has_flag("--crf"):
+ # Extend: the runner's file is an INTERMEDIATE — the delivery is spliced
+ # from it after the run (the source's own frames + only the new ones,
+ # issue #48) — so ask for it lossless and encode the new part once.
+ h3_extend_lossless = mode == "extend" and _h3_runner_has_flag("--crf")
+ if h3_extend_lossless:
+ cmd += ["--crf", "0"]
+ native_codec["crf"] = str(_native_crf) # what the splice encodes at
+ elif _native_crf != 18 and _h3_runner_has_flag("--crf"):
cmd += ["--crf", str(_native_crf)]
native_codec["crf"] = str(_native_crf)
- if chain_windows > 1:
+ if mode == "extend":
+ # New windows after the source; --extend-frames trims the last one.
+ cmd += ["--chain-windows", str(chain_windows)]
+ elif mode in ("v2a", "a2v"):
+ pass # the media plan carries this shape's own window flags
+ elif chain_windows > 1:
# Window chaining: each window after the first is conditioned on its
# predecessor's last decoded frame, and --chain-total-frames trims the
# stitched clip to the tier's delivered length. The audio cross-fade
@@ -34672,6 +35346,11 @@ def run_h3_job_inner(job: dict) -> None:
cmd += ["--chain-prompts", str(chain_prompts_path)]
if first_frame is not None:
cmd += ["--first-frame", str(first_frame)]
+ cmd += mode_argv
+ if context_frames:
+ cmd += ["--chain-context-frames", str(context_frames)]
+ if mode != "v2a" and _h3_runner_has_flag("--seam-colour-frames"):
+ cmd += ["--seam-colour-frames", str(H3_SEAM_COLOUR_FRAMES)]
# Skip the 26 GB text encoder when this exact prompt+first-frame has been
# encoded before. On the Q8 path that phase IS the run peak (25.71 GiB vs
# 21.28-24.68 GiB for denoise), so a hit lowers the ceiling as well as
@@ -34738,7 +35417,8 @@ def run_h3_job_inner(job: dict) -> None:
# tensor). Runner refuses the flag on chained renders, so gate to one
# window; the cache is a few hundred MB and rides the output's lifecycle.
stage_a_path = None
- if tier.get("draft") and chain_windows == 1 and h3_supports_stage_a():
+ if (tier.get("draft") and chain_windows == 1 and h3_supports_stage_a()
+ and mode in ("t2v", "i2v")):
stage_a_path = out_path.with_suffix(".stage_a")
cmd += ["--save-stage-a", str(stage_a_path)]
if turbo:
@@ -35206,6 +35886,10 @@ def run_h3_job_inner(job: dict) -> None:
STATE["pid"] = None
STATE["h3_pgid"] = None
_proc_guard_clear("h3")
+ # Whatever happened (done, stopped, failed), the runner's mux WAVs are
+ # intermediates. Extend still needs <out>.wav for its splice; it is
+ # dropped after that below.
+ _h3_drop_runner_wavs(out_path, t0, keep_main=(mode == "extend"))
if not out_path.is_file():
raise RuntimeError(
@@ -35227,6 +35911,39 @@ def run_h3_job_inner(job: dict) -> None:
if _loras else ". Please report it with the log.")
+ f" (clip hidden: {out_path.name})")
+ h3_splice_report = None
+ if mode == "extend" and plan.get("extend_source"):
+ # Issue #48: the runner delivers its own copy of the source (decoded,
+ # put on the canvas, audio resampled to 32 kHz, the whole clip
+ # re-encoded) — one more lossy generation over the entire clip on
+ # every round of a chain. Splice the delivery from the source file
+ # itself + the new frames instead; the runner's file and its leftover
+ # 32 kHz wav are the intermediate.
+ ext_work = OUTPUT / ".extend" / str(job["id"])
+ ext_work.mkdir(parents=True, exist_ok=True)
+ h3_gen = ext_work / "generated.mp4"
+ h3_gen_wav = ext_work / "generated.wav"
+ os.replace(out_path, h3_gen)
+ try:
+ os.replace(out_path.with_suffix(".wav"), h3_gen_wav)
+ except OSError:
+ h3_gen_wav = None
+ h3_splice_report = deliver_extend(
+ Path(plan["extend_source"]), h3_gen, h3_gen_wav, out_path, ext_work,
+ engine="h3", new_frames=int(plan.get("extend_new_frames") or 0),
+ picked=Path(str(p.get("video_path") or "")) if p.get("video_path") else None,
+ codec={"pix_fmt": native_codec["pix_fmt"], "crf": native_codec["crf"]},
+ generated_lossless=h3_extend_lossless)
+ if mode == "extend":
+ _h3_drop_runner_wavs(out_path, t0)
+
+ if mode == "v2a":
+ # The delivery is the source's own stream: record ITS size, not the
+ # canvas the picture was read at for conditioning.
+ _vw, _vh = _probe_video_dims(str(out_path))
+ if _vw and _vh:
+ width, height = _vw, _vh
+
# ---- export pass: the SAME post-process an LTX render gets ------------
# Most tiers write 768×448 (12:7), which is neither 720p nor 1080p and looks
# like a bug next to LTX output in the gallery. Run the identical ffmpeg
@@ -35241,6 +35958,11 @@ def run_h3_job_inner(job: dict) -> None:
h3_upscale_mode = (p.get("h3_upscale") or H3_UPSCALE_DEFAULT).strip().lower()
if h3_upscale_mode not in H3_UPSCALE_MODES:
h3_upscale_mode = H3_UPSCALE_DEFAULT
+ if mode == "v2a":
+ # Add sound delivers the source's own video stream, untouched: no
+ # export re-encode, no Face Fix redraw — the picture is the user's.
+ h3_upscale_mode = "off"
+ p["h3_upscale"] = "off"
upscale_plan = None
try:
upscale_plan = compute_upscale_plan(width, height, h3_upscale_mode)
@@ -35300,6 +36022,12 @@ def run_h3_job_inner(job: dict) -> None:
"output": str(final_target),
"raw_output": str(native_path),
"native_output": str(native_path),
+ # Issue #48 — how an Extend's delivery was assembled, and the lossless
+ # audio master the next extend of this clip (either engine) starts from.
+ **({"extend_splice": h3_splice_report,
+ "extend_audio_master": h3_splice_report.get("audio_master"),
+ "extend_source": plan.get("extend_source")}
+ if h3_splice_report else {}),
"params": {
**p,
"engine": "h3",
@@ -36584,6 +37312,13 @@ def run_job_inner(job: dict) -> None:
out_name = Path(src).stem + f"_ext{p['extend_frames']}_{stamp}.mp4"
final_out = OUTPUT / out_name
job["raw_path"] = str(final_out)
+ # Issue #48: the helper writes the model's output LOSSLESS into a
+ # dot-folder (invisible to every gallery listing) and the delivery is
+ # spliced from it below — the source's own frames + only the new ones.
+ ext_work = OUTPUT / ".extend" / str(job["id"])
+ ext_work.mkdir(parents=True, exist_ok=True)
+ gen_out = ext_work / "generated.mp4"
+ gen_wav = ext_work / "generated.wav"
# Extend memory profile: pipe loads the ~10–12 GB dev transformer
# (Q4-quantized) and does CFG-guided denoising over the source's
@@ -36617,7 +37352,8 @@ def run_job_inner(job: dict) -> None:
"video_path": src,
"extend_frames": p["extend_frames"],
"direction": p["extend_direction"],
- "output_path": str(final_out),
+ "output_path": str(gen_out),
+ "audio_wav_path": str(gen_wav),
"seed": p["seed"],
"steps": steps,
"cfg_scale": cfg_scale,
@@ -36634,6 +37370,10 @@ def run_job_inner(job: dict) -> None:
if "seed_used" in result:
push(f"seed used: {result['seed_used']}")
p["seed_used"] = result["seed_used"]
+ splice_report = deliver_extend(
+ Path(src), gen_out, gen_wav, final_out, ext_work, engine="ltx", picked=picked_src,
+ direction=p.get("extend_direction") or "after",
+ codec=output_codec_settings())
sidecar = {
"output": str(final_out), "raw_output": str(final_out),
@@ -36656,6 +37396,10 @@ def run_job_inner(job: dict) -> None:
"extend_picked": str(picked_src),
"extend_source": src,
"extend_new_frames": int(p["extend_frames"]) * 8,
+ # How the delivery was assembled (copy / reencode / generated) and
+ # the lossless audio master the NEXT extend of this clip starts from.
+ "extend_splice": splice_report,
+ "extend_audio_master": splice_report.get("audio_master"),
}
write_sidecar(final_out.with_suffix(final_out.suffix + ".json"), sidecar)
job["output_path"] = str(final_out)
diff --git a/mlx_warm_helper.py b/mlx_warm_helper.py
index 7abb150..bfd97aa 100644
--- a/mlx_warm_helper.py
+++ b/mlx_warm_helper.py
@@ -494,6 +494,55 @@ def _source_fps(video_path: str, fallback=None) -> float:
return 24.0
+@contextmanager
+def _env_override(**values):
+ """Set environment variables for the duration of a block, then restore
+ them exactly (absent stays absent). The patched encoder in
+ `video_vae.decode_and_stream` reads LTX_OUTPUT_PIX_FMT / LTX_OUTPUT_CRF
+ at call time, so this is how one call asks it for a lossless file."""
+ saved = {k: os.environ.get(k) for k in values}
+ try:
+ os.environ.update({k: str(v) for k, v in values.items()})
+ yield
+ finally:
+ for k, v in saved.items():
+ if v is None:
+ os.environ.pop(k, None)
+ else:
+ os.environ[k] = v
+
+
+def _decode_extend_stems(pipe, video_lat, audio_lat, video_out: str, wav_out: str,
+ frame_rate: float) -> None:
+ """Decode an Extend result the way `_decode_and_save_video` does, but keep
+ both halves lossless: the vocoder's 48 kHz PCM as a wav at `wav_out`, and
+ the decoded frames as yuv444p crf 0 at `video_out` (the wav muxed in).
+
+ Issue #48. The panel builds the delivery from these — the source's own
+ frames plus only the new ones — so the new region must not carry a lossy
+ generation of its own before it is encoded once at the user's preset.
+ Same blocks, same order, same phase label as the upstream wrapper (the
+ panel's post-decode watchdog keys on "[Decoding video + audio + muxing]
+ done in"), and the same DiT drop before the decode."""
+ from ltx_core_mlx.utils.memory import aggressive_cleanup
+ from ltx_pipelines_mlx.utils._orchestration import save_waveform
+ from ltx_pipelines_mlx.utils.progress import phase
+
+ if pipe.low_memory and pipe.dit is not None:
+ pipe.dit = None
+ pipe._loaded = False
+ aggressive_cleanup()
+ with phase("Decoding video + audio + muxing", verbose=getattr(pipe, "verbose", True)):
+ waveform = pipe.audio_decoder_block(audio_lat)
+ if pipe.low_memory:
+ aggressive_cleanup()
+ save_waveform(waveform, wav_out, sample_rate=48000)
+ with _env_override(LTX_OUTPUT_PIX_FMT="yuv444p", LTX_OUTPUT_CRF="0"):
+ pipe.video_decoder_block.decode_and_stream(
+ video_lat, video_out, frame_rate=frame_rate, audio_path=wav_out)
+ aggressive_cleanup()
+
+
def _retake_latent_window(start_sec: float, end_sec: float, fps: float,
source_frames: int) -> dict:
"""Seconds on the source clip -> RetakePipeline's LATENT frame interval.
@@ -3833,8 +3882,17 @@ for line in sys.__stdin__:
# LIPSYNC-3 (same class as Retake): extend_from_video encodes the
# source at ITS OWN rate, so decode at it too — a 12-fps native
# render saved at the panel's 24 played twice as fast.
- pipe._decode_and_save_video(video_lat, audio_lat, p["output_path"],
- frame_rate=_source_fps(video_path, p.get("frame_rate")))
+ _ext_fps = _source_fps(video_path, p.get("frame_rate"))
+ if p.get("audio_wav_path"):
+ # Issue #48: the panel splices the delivery itself (the source's
+ # own frames + only the new ones), so it needs the model's
+ # output WITHOUT a lossy generation on it — lossless video and
+ # the vocoder's 48 kHz PCM, not the preset-encoded mp4 + AAC.
+ _decode_extend_stems(pipe, video_lat, audio_lat, p["output_path"],
+ p["audio_wav_path"], _ext_fps)
+ else:
+ pipe._decode_and_save_video(video_lat, audio_lat, p["output_path"],
+ frame_rate=_ext_fps)
elapsed = round(time.time() - t0, 2)
_last_activity = time.time()
emit({
diff --git a/panel/routes_files.py b/panel/routes_files.py
index 5f10faa..6b622f0 100644
--- a/panel/routes_files.py
+++ b/panel/routes_files.py
@@ -612,6 +612,17 @@ def post_output_delete(h, path, qs, ctype) -> None:
if not any(p_resolved.is_relative_to(r) for r in roots):
continue
_expand_for_media(p_resolved, seen, candidates)
+ # An Extend's lossless audio master (issue #48) — a FLAC in the
+ # outputs' `.extend/masters` dot-folder that only the next extend of
+ # this clip reads — goes with the clip instead of piling up.
+ v = meta.get("extend_audio_master")
+ if v:
+ try:
+ m_resolved = P.Path(str(v)).resolve()
+ except OSError:
+ m_resolved = None
+ if m_resolved is not None and any(m_resolved.is_relative_to(r) for r in roots):
+ _add(seen, candidates, m_resolved)
# (b) filename-pattern expansion. Always include the clicked
# file. Then derive base + every known upscale suffix and add
diff --git a/scripts/assert_registry.py b/scripts/assert_registry.py
index 391c19c..067a95f 100644
--- a/scripts/assert_registry.py
+++ b/scripts/assert_registry.py
@@ -44,6 +44,7 @@ from __future__ import annotations
import importlib.util
import json
import os
+import re
import sys
import tempfile
from pathlib import Path
@@ -59,6 +60,23 @@ os.environ["PHOSPHENE_DISABLE_VERSION_CHECK"] = "1"
os.environ.setdefault("LTX_PORT", "8299")
sys.path.insert(0, str(ROOT))
+# IMPORT THE PANEL WITH THE MODEL LOCATIONS PINOKIO GIVES IT (issue #90).
+# start.js exports LTX_MODEL / LTX_MODEL_HQ / LTX_GEMMA / LTX_MODELS_DIR /
+# LTX_Q8_LOCAL as fixed {{cwd}} paths on every launch. Without them the panel
+# falls back to the HF repo id for LTX_MODEL whenever mlx_models/ltx-2.3-mlx-q4
+# is absent — which, since install.js stopped downloading LTX-2.3, is every
+# fresh install — so this gate judged `_canonical_layout()` (and with it the
+# anti-mosaic preflight) on an environment no user's panel ever runs in, and
+# failed on any install without the optional 2.3 pack. Read from start.js
+# itself so the two cannot drift; a caller's own value still wins.
+_START_JS = (ROOT / "start.js").read_text(encoding="utf-8")
+for _key in ("LTX_MODEL", "LTX_MODEL_HQ", "LTX_GEMMA", "LTX_MODELS_DIR", "LTX_Q8_LOCAL"):
+ _m = re.search(r'^\s*%s:\s*"([^"]+)"' % _key, _START_JS, re.M)
+ if not _m:
+ raise SystemExit(f"assert_registry: start.js no longer exports {_key}; "
+ "update the launch environment this gate imports with")
+ os.environ.setdefault(_key, _m.group(1).replace("{{cwd}}", str(ROOT)))
+
# The alias must NOT be "panel": that name now belongs to the route-handler
# package (panel/routes_*.py, slice 4 of docs/ARCHITECTURE.md), and the panel
# module itself does `from panel.routes import ...` at import time — a
@@ -70,7 +88,8 @@ p = importlib.util.module_from_spec(spec)
sys.modules["phos_panel_under_test"] = p
spec.loader.exec_module(p)
-OK = FAIL = DEFECT = 0
+OK = FAIL = DEFECT = SKIP = 0
+_skips: list[str] = []
_failures: list[str] = []
@@ -112,6 +131,37 @@ def no_raise(label, fn):
_failures.append(f"{label}: raised {type(exc).__name__}: {exc}")
+def skip(label, reason):
+ """A check this install cannot answer. Printed, counted, never a pass."""
+ global SKIP
+ SKIP += 1
+ _skips.append(f"{label}: {reason}")
+
+
+def not_installed(quant, version_id):
+ """A reason string when (version, quant) is an OPT-IN pack this install
+ never downloaded, else "" (issue #90).
+
+ install.js downloads the DEFAULT generation's q4 pack; every other pack
+ (the LTX-2.3 packs since "LTX-2.3 is no longer downloaded", the q8 High
+ packs) is fetched from Settings -> Models only when wanted. Asserting
+ such a pack "complete" on an install that never asked for it failed this
+ gate on every fresh install. Not one of the pack's files on disk means
+ not installed -> SKIP. ANY of them present means installed, and a
+ partial pack is still a FAIL — that is the June-2026 mosaic this gate
+ exists for. The default generation's q4 is never optional."""
+ if quant == "q4" and p.model_version(version_id).get("default"):
+ return ""
+ repo = p.pack_repo(quant, version_id)
+ if not repo:
+ return ""
+ missing = set(p.pack_missing_files(quant, version_id))
+ if missing and missing >= set(repo["files"]):
+ return (f"{p.model_version(version_id)['label']} {quant.upper()} pack is "
+ f"not installed here ({p.pack_path(quant, version_id)})")
+ return ""
+
+
def known_defect(tag, label, got, current, should_be):
"""Pin a WRONG behaviour so the gate stays green and the bug stays visible.
@@ -230,8 +280,18 @@ eq("the add-on is a guest in the q8 directory",
# Storyboard), but both fragments come from this one registry-backed helper.
# Exercise BOTH generations: checking only the active default is how literal
# "Install Q8 (30 GB)" copy passed while the LTX23 pin needed 37 GB.
-_q23_copy = p.q8_character_install_copy("ltx23")
-_q25_copy = p.q8_character_install_copy("ltx25")
+#
+# Read as a Q8-capable Mac (issue #90): below the Q8 RAM floor the helper
+# deliberately drops the "Install ... (size)" offer (SYS-18) and names the
+# pack without a size, so on a <48 GB Mac the size assertions below failed
+# for a reason that is correct behaviour there.
+_saved_caps = p.SYSTEM_CAPS
+p.SYSTEM_CAPS = p.CAPABILITIES["standard"]
+try:
+ _q23_copy = p.q8_character_install_copy("ltx23")
+ _q25_copy = p.q8_character_install_copy("ltx25")
+finally:
+ p.SYSTEM_CAPS = _saved_caps
eq("2.3 character install copy names its own pack",
"LTX 2.3" in _q23_copy and "37 GB" in _q23_copy, True)
eq("2.3 character install copy never advertises the 2.5 pack",
@@ -269,10 +329,19 @@ eq("q8_available_anywhere delegates", p.q8_available_anywhere(), p.pack_availabl
eq("an unregistered quant invents no missing files", p.pack_missing_files("q9"), [])
for vid in ("ltx23", "ltx25"):
for q in ("q4", "q8"):
+ if not_installed(q, vid):
+ skip(f"this install is complete ({vid}/{q})", not_installed(q, vid))
+ continue
eq(f"this install is complete ({vid}/{q})", p.pack_missing_files(q, vid), [])
eq(f"this install has {vid}'s text encoder", p.text_encoder_missing_files(vid), [])
-eq("the HQ surface is complete on this box", p.hq_surface_missing("ltx25"), [])
-eq("2.3 has no HQ surface of its own to be missing", p.hq_surface_missing("ltx23"), [])
+if not_installed("q8", "ltx25"):
+ skip("the HQ surface is complete on this box", not_installed("q8", "ltx25"))
+else:
+ eq("the HQ surface is complete on this box", p.hq_surface_missing("ltx25"), [])
+if not_installed("q8", "ltx23"):
+ skip("2.3 has no HQ surface of its own to be missing", not_installed("q8", "ltx23"))
+else:
+ eq("2.3 has no HQ surface of its own to be missing", p.hq_surface_missing("ltx23"), [])
# =============================================================================
# 6. cap_tier — the machine's RAM vs the version's ceiling
@@ -335,10 +404,12 @@ _saved_canon = p._canonical_layout
p._canonical_layout = lambda: True
try:
for vid in ("ltx23", "ltx25"):
- no_raise(f"a complete pack passes ({vid}/q4)",
- lambda vid=vid: p.ltx_pack_preflight("q4", "X", vid))
- no_raise(f"a complete pack passes ({vid}/q8)",
- lambda vid=vid: p.ltx_pack_preflight("q8", "X", vid))
+ for q in ("q4", "q8"):
+ if not_installed(q, vid):
+ skip(f"a complete pack passes ({vid}/{q})", not_installed(q, vid))
+ continue
+ no_raise(f"a complete pack passes ({vid}/{q})",
+ lambda vid=vid, q=q: p.ltx_pack_preflight(q, "X", vid))
no_raise("an unregistered quant is a no-op", lambda: p.ltx_pack_preflight("q9", "X"))
with tempfile.TemporaryDirectory() as td:
@@ -378,7 +449,11 @@ try:
pack["path"] = saved
p.pack_available_anywhere = _saved_anywhere
eq("the 2.3 q8 path is restored", p.pack_path("q8", "ltx23"), p.Q8_LOCAL_PATH)
- no_raise("preflight is quiet again", lambda: p.ltx_pack_preflight("q8", "X", "ltx23"))
+ if not_installed("q8", "ltx23"):
+ skip("preflight is quiet again", not_installed("q8", "ltx23"))
+ else:
+ no_raise("preflight is quiet again",
+ lambda: p.ltx_pack_preflight("q8", "X", "ltx23"))
finally:
p._canonical_layout = _saved_canon
@@ -526,9 +601,15 @@ _SHIPPED_CANVASES = {
"high": (1024, 576),
"high_720p": (1280, 704),
}
+# The NATIVE canvas is the contract (issue #90): on a <48 GB Mac the tier's
+# t2v_max_dim clamps the rendered canvas at import and records the shipped
+# one as native_width/native_height (EST-13), so comparing the live width
+# failed on every Compact-tier Mac for behaviour that is correct there.
for _k, _wh in _SHIPPED_CANVASES.items():
+ _cell = p.LTX_QUALITIES[_k]
eq(f"{_k} keeps its shipped canvas",
- (p.LTX_QUALITIES[_k]["width"], p.LTX_QUALITIES[_k]["height"]), _wh)
+ (int(_cell.get("native_width") or _cell["width"]),
+ int(_cell.get("native_height") or _cell["height"])), _wh)
eq("no quality key has been added or dropped without updating this gate",
sorted(p.LTX_QUALITIES), sorted(_SHIPPED_CANVASES))
@@ -571,7 +652,31 @@ for _key in p.LTX_MEASURED_ETA:
# lengths remain modelled.
eq("high at 5s is the measured row",
p.LTX_TIERS["high_5s"]["eta_measured"], True)
-eq("high uses the owner-approved label", p.LTX_TIERS["high_5s"]["eta"], "~4 min")
+# The LABEL is chip-dependent by design (issue #90): `_build_ltx_tiers` prints
+# the measured row's own string only at the M4 Max baseline (hw == 1.0) and
+# a computed `_fmt_eta(minutes * hw)` everywhere else, so an M4 Pro (hw 1.7)
+# reads "~7 min". Asserting the literal "~4 min" against the live table made
+# this gate pass or fail by which Mac ran it. What is asserted instead is the
+# selector itself, with the speed factor pinned, plus that the live table is
+# the selector's answer for whatever this Mac's factor is.
+_high_row = p.LTX_MEASURED_ETA[(p.ACTIVE_MODEL_VERSION, "high", "5s", "q8")]
+eq("high's measured row carries the owner-approved label", _high_row[1], "~4 min")
+_saved_hw = p._ltx_speed_factor
+try:
+ p._ltx_speed_factor = lambda: 1.0
+ eq("high uses the owner-approved label at the M4 Max baseline (hw 1.0)",
+ p._build_ltx_tiers()["high_5s"]["eta"], "~4 min")
+ p._ltx_speed_factor = lambda: 1.7
+ _slow = p._build_ltx_tiers()["high_5s"]
+ eq("...a slower Mac (hw 1.7) prices the measured row by its own factor",
+ _slow["eta"], p._fmt_eta(_high_row[0] * 1.7))
+ eq("...and that is not the M4 Max label", _slow["eta"] != "~4 min", True)
+finally:
+ p._ltx_speed_factor = _saved_hw
+_hw_here = p._ltx_speed_factor()
+eq(f"the live high label is the selector's answer for this Mac (hw {_hw_here:.2f})",
+ p.LTX_TIERS["high_5s"]["eta"],
+ "~4 min" if _hw_here == 1.0 else p._fmt_eta(_high_row[0] * _hw_here))
eq("...and High is measured at its shipped canvas",
(p.LTX_TIERS["high_5s"]["width"],
p.LTX_TIERS["high_5s"]["height"],
@@ -593,8 +698,12 @@ for _ln in p.LTX_LENGTHS:
print()
for f in _failures:
print("FAIL " + f)
+for s_ in _skips:
+ print("SKIP " + s_)
print()
-print(f"{OK} passed, {FAIL} failed, {DEFECT} known defect(s) pinned")
+print(f"{OK} passed, {FAIL} failed, {SKIP} skipped, {DEFECT} known defect(s) pinned")
+if SKIP:
+ print("A skip is NOT a pass: those checks need the pack installed. See the SKIP lines.")
if DEFECT:
print("A pinned defect is NOT a pass. See the DEFECT lines above.")
raise SystemExit(1 if FAIL else 0)
diff --git a/scripts/assert_schedules.py b/scripts/assert_schedules.py
index 396487d..bc5553c 100644
--- a/scripts/assert_schedules.py
+++ b/scripts/assert_schedules.py
@@ -47,8 +47,10 @@ constants. ~1 s.
from __future__ import annotations
+import atexit
import importlib.util
import os
+import shutil
import sys
import tempfile
import types
@@ -130,17 +132,80 @@ def load_panel(version_id: str | None):
mod = importlib.util.module_from_spec(spec)
sys.modules["panel_under_test"] = mod
spec.loader.exec_module(mod)
+ use_fixture_character(mod)
return mod
+# THE CHARACTER CASES MUST NOT DEPEND ON WHO RUNS THE GATE (issue #90).
+# They used to name `bizarrotrn`, the maintainer's own reference character —
+# user data that is not in the repo — so on every other install make_job
+# refused with "character 'bizarrotrn' not found" and five cases failed for a
+# reason that says nothing about schedules. The gate now builds a throwaway
+# character the way the Characters tab discovers one (`list_characters()`
+# scans LORAS_DIR for `<trigger>_v2.safetensors` + `<trigger>.audio.safetensors`
+# and reads mlx_models/characters/<trigger>/bundle.json), in a temp dir, and
+# points the panel module under test at it. The real discovery code, the
+# real face+voice contract and the real make_job still run.
+#
+# One thing is pinned: the per-file LTX compatibility read. It compares the
+# adapter's tensor names against whichever LTX transformer this machine has
+# installed (none, 2.3 or 2.5), so it would make the gate machine-dependent
+# again, and adapter compatibility is test_lora_compat.py's job, not this
+# gate's. It is answered as "unknown", the same answer an install without the
+# active transformer gets — which make_job lets through.
+FIXTURE_CHARACTER = "schedgatetrn"
+_FIXTURE_ROOT = Path(tempfile.mkdtemp(prefix="phos-sched-character-"))
+atexit.register(shutil.rmtree, _FIXTURE_ROOT, True)
+
+
+def _write_empty_safetensors(path: Path) -> None:
+ """A valid safetensors file with no tensors: 8-byte LE header length,
+ then the JSON header, space-padded to 8 bytes as the format requires."""
+ import json
+ import struct
+ header = json.dumps({"__metadata__": {"fixture": "assert_schedules"}}).encode()
+ header += b" " * (-len(header) % 8)
+ path.write_bytes(struct.pack("<Q", len(header)) + header)
+
+
+def _build_fixture_character() -> tuple[Path, Path]:
+ loras = _FIXTURE_ROOT / "loras"
+ characters = _FIXTURE_ROOT / "characters"
+ loras.mkdir(parents=True, exist_ok=True)
+ (characters / FIXTURE_CHARACTER).mkdir(parents=True, exist_ok=True)
+ _write_empty_safetensors(loras / f"{FIXTURE_CHARACTER}_v2.safetensors")
+ _write_empty_safetensors(loras / f"{FIXTURE_CHARACTER}.audio.safetensors")
+ (characters / FIXTURE_CHARACTER / "bundle.json").write_text(
+ '{"name": "Schedule Gate", "pronoun": "they", "subject_noun": "person"}',
+ encoding="utf-8")
+ return loras, characters
+
+
+def use_fixture_character(p) -> None:
+ loras, characters = _build_fixture_character()
+ p.LORAS_DIR = loras
+ p._CHARACTERS_CACHE_PATH = characters
+ p._ltx_lora_compatibility = lambda path: {
+ "ltx_compatible": None,
+ "ltx_compat_reason": "pinned by assert_schedules (not under test here)",
+ "ltx_fusion_tally": None,
+ }
+ found = [c["id"] for c in p.list_characters()]
+ if found != [FIXTURE_CHARACTER]:
+ raise SystemExit(
+ f"assert_schedules: fixture character discovery returned {found!r}, "
+ f"expected [{FIXTURE_CHARACTER!r}] — list_characters() no longer "
+ f"reads LORAS_DIR, so the character cases would not test anything")
+
+
# The modes a user can actually submit from the panel, with the minimum form
# each one needs. Every one of these reaches a distilled two-stage schedule.
MODE_FORMS = {
"t2v": {"mode": "t2v"},
"t2v_high": {"mode": "t2v", "quality": "high"},
"i2v": {"mode": "i2v"},
- "character": {"mode": "t2v", "character_id": "bizarrotrn"},
- "character_high": {"mode": "t2v", "character_id": "bizarrotrn",
+ "character": {"mode": "t2v", "character_id": FIXTURE_CHARACTER},
+ "character_high": {"mode": "t2v", "character_id": FIXTURE_CHARACTER,
"quality_choice": "high"},
"keyframe": {"mode": "keyframe"},
"extend": {"mode": "extend", "video_path": "/tmp/x.mp4"},
@@ -205,7 +270,7 @@ def run() -> None:
# there without pretending the 2.3 UI offers the token.
if version_id == "ltx25":
mode_forms["character_high720"] = {
- "mode": "t2v", "character_id": "bizarrotrn",
+ "mode": "t2v", "character_id": FIXTURE_CHARACTER,
"quality_choice": "high720",
}
for label, form in mode_forms.items():
diff --git a/scripts/check_post_update.js b/scripts/check_post_update.js
index 423e4ee..3f29eca 100644
--- a/scripts/check_post_update.js
+++ b/scripts/check_post_update.js
@@ -175,6 +175,21 @@ for (const [label, re] of mustRequire) {
if (gate && !repair.some((l) => !/--reinstall|--no-deps/.test(l.t))) failures.push("the import-gate repair only reinstalls --no-deps — it cannot install a missing dependency, so it fails the same way every time.")
}
+// --- 2e. THE INSTALL'S ENGINE STEP RESOLVES THE SAME WAY (4.19.0) ----------
+// scripts/pinokio/ltx_engine_env.sh (install.js and the panel's Repair engine)
+// installed the vendored packages WITHOUT the pins on that resolve. The newest
+// mlx-arsenal requires mlx>=0.32.1, so the solver moved mlx to 0.32.3 and the
+// mflux pack then walked it to 0.31.2: every fresh install since 2026-08-24
+// ran mlx 0.31.2 while every Update (2d above) put 0.31.1 back.
+{
+ const eng = fs.readFileSync(path.resolve(__dirname, "pinokio", "ltx_engine_env.sh"), "utf8")
+ const cmds = eng.replace(/\\\n/g, " ").split("\n").filter((l) => !/^\s*#/.test(l))
+ const dep = cmds.find((l) => /uv pip install/.test(l) && /\.\/packages\/ltx-core-mlx/.test(l) && !/--no-deps/.test(l))
+ if (!dep) failures.push("scripts/pinokio/ltx_engine_env.sh has no dependency-resolving install of the vendored packages.")
+ else if (!/mlx==0\.31\.1/.test(dep) || !/mlx-metal==0\.31\.1/.test(dep) || !/transformers>=5\.0\.0,<5\.13\.0/.test(dep)) failures.push("scripts/pinokio/ltx_engine_env.sh resolves the vendored packages without the mlx pin and the transformers cap on the same command - mlx-arsenal moves mlx (fresh installs land on 0.31.2).")
+ else console.log(" ok the install's engine step resolves the vendored packages with the pins on the same command")
+}
+
// --- 3. THE mlx PIN AND THE mflux PIN ARE ONE DECISION -----------------------
// Step 2 pins mlx. Step 7 installs mflux WITH deps (the resolving call, there
// so a fresh install gets mflux's transitive set). mflux declares its OWN mlx
diff --git a/scripts/pinokio/h3_checkout.sh b/scripts/pinokio/h3_checkout.sh
index e4b128c..3efdf11 100755
--- a/scripts/pinokio/h3_checkout.sh
+++ b/scripts/pinokio/h3_checkout.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-# Move the vendored minimax-h3-mlx checkout to the branch the app expects,
-# and re-sync its venv deps. THE ONE PLACE THE H3 BRANCH PIN LIVES.
+# Move the vendored minimax-h3-mlx checkout to the EXACT engine commit this
+# Phosphene release was validated against, and re-sync its venv deps.
+# THE ONE PLACE THE H3 ENGINE PIN LIVES.
#
# Issue #74 (diagnosed by @blackest): installs cloned before the v2 engine sat
# on `codex/h3-engine`, and Update's Q8 build step ran h3_build_q8.sh against
@@ -9,11 +10,26 @@
# installer already moved the branch on a re-install; Update did not. Both
# call this now.
#
+# 4.19.0 — A COMMIT, NOT A BRANCH TIP. Through 4.18.x this checked out
+# whatever `codex/h3-engine-v2` pointed at on the day it ran, so pushing the
+# engine branch changed every installed Phosphene's H3 at its next Update or
+# "Update Hailuo H3 runner" — with no Phosphene release, no gates and no way
+# back. The panel and the runner are one product (the panel passes flags the
+# runner must know), so the engine now moves only when a Phosphene release
+# moves this pin, the same contract the LTX lane (ltx_checkout.sh, a tag) and
+# the music engine (engine_pin.txt, a SHA) already have. H3_PIN_REF is a ref on
+# the engine repo that CONTAINS the pin — fetching it is how the commit
+# arrives; the commit is what gets checked out, and HEAD is verified after.
+# Moving the pin: push the engine commit to a ref there (a new branch or tag;
+# never force-move one), then change both lines below in the same commit.
+#
# Usage: bash scripts/pinokio/h3_checkout.sh <h3-checkout-dir>
-# Exit 0 = the tree is on the pin and its deps are synced. Non-zero = left as
-# it was (nothing destructive happens before the fetch succeeds).
+# Exit 0 = the tree is at the pin and its deps are synced. Non-zero = left as
+# it was (nothing destructive happens before the pinned commit is on disk).
set -u
-H3_BRANCH="codex/h3-engine-v2"
+H3_PIN_SHA="3f6c75c09ccfa336a8c211b787d6a2350d83ef7a"
+H3_PIN_REF="phosphene/v4.19.0"
+H3_LOCAL_BRANCH="phosphene-pinned"
H3_URL="https://github.com/mrbizarro/minimax-h3-mlx.git"
H3_DIR="${1:-}"
if [ -z "$H3_DIR" ] || [ ! -d "$H3_DIR/.git" ]; then
@@ -22,8 +38,14 @@ if [ -z "$H3_DIR" ] || [ ! -d "$H3_DIR/.git" ]; then
fi
cd "$H3_DIR" || exit 1
git remote get-url origin >/dev/null 2>&1 || git remote add origin "$H3_URL"
-if ! git fetch --force origin "$H3_BRANCH"; then
- echo "WARN: could not fetch $H3_BRANCH from $H3_URL - H3 checkout left as is."
+have_pin() { git cat-file -e "${H3_PIN_SHA}^{commit}" 2>/dev/null; }
+# The ref first (one round trip, and it keeps the pin reachable locally); the
+# bare commit as a fallback for a remote where the ref was renamed but the
+# commit is still reachable from something else.
+git fetch --force origin "$H3_PIN_REF" >/dev/null 2>&1 || true
+have_pin || git fetch --force origin "$H3_PIN_SHA" >/dev/null 2>&1 || true
+if ! have_pin; then
+ echo "WARN: could not fetch the H3 engine pin ${H3_PIN_SHA:0:7} ($H3_PIN_REF) from $(git remote get-url origin) - H3 checkout left as is."
exit 1
fi
if [ -d minimax_h3_mlx ]; then
@@ -31,13 +53,17 @@ if [ -d minimax_h3_mlx ]; then
else
echo 'WARN: not the H3 tree - skipping reset'
fi
-if ! git checkout --force -B "$H3_BRANCH" FETCH_HEAD; then
- echo "WARN: could not check out $H3_BRANCH - H3 checkout left as is."
+if ! git checkout --force -B "$H3_LOCAL_BRANCH" "$H3_PIN_SHA" >/dev/null 2>&1; then
+ echo "WARN: could not check out the H3 engine pin ${H3_PIN_SHA:0:7} - H3 checkout left as is."
+ exit 1
+fi
+if [ "$(git rev-parse HEAD)" != "$H3_PIN_SHA" ]; then
+ echo "WARN: H3 checkout is at $(git rev-parse --short HEAD), not the pin ${H3_PIN_SHA:0:7}."
exit 1
fi
-echo "H3 engine at $H3_BRANCH ($(git rev-parse --short HEAD))"
+echo "H3 engine at ${H3_PIN_SHA:0:7} (pinned, $H3_PIN_REF)"
if [ ! -f scripts/quantize_stream.py ]; then
- echo "WARN: $H3_BRANCH has no scripts/quantize_stream.py - the Q8 build cannot run from this tree."
+ echo "WARN: the H3 pin has no scripts/quantize_stream.py - the Q8 build cannot run from this tree."
exit 1
fi
# The branch move can change requirements; uv is a no-op when nothing did.
diff --git a/scripts/pinokio/ltx_engine_env.sh b/scripts/pinokio/ltx_engine_env.sh
index 080c30f..1c6ad08 100755
--- a/scripts/pinokio/ltx_engine_env.sh
+++ b/scripts/pinokio/ltx_engine_env.sh
@@ -103,7 +103,15 @@ defuse() { tee -a "$LOG" | sed -u -e 's/[Ee][Rr][Rr][Oo][Rr]:/problem -/g' -e 's
attempt() {
uv pip install --python env/bin/python 'mlx==0.31.1' 'mlx-lm==0.31.1' \
'mlx-metal==0.31.1' 'transformers>=5.0.0,<5.13.0' 2>&1 | defuse || return 1
+ # The packages' dependencies resolve WITH the pins, the same as
+ # scripts/post_update.sh step 3 (4.19.0). Alone, this resolve took the newest
+ # mlx-arsenal (ltx-core-mlx asks only >=0.2.4); 0.12.0 onward (2026-08-24)
+ # requires mlx>=0.32.1, so it moved mlx to 0.32.3, and the mflux pack then
+ # walked it DOWN to 0.31.2 (mflux 0.18.0 wants <0.32) - every fresh install
+ # since late August ran mlx 0.31.2 with an mlx-arsenal that declares it
+ # cannot. Pinned here the solver picks mlx-arsenal 0.11.1 and mlx stays 0.31.1.
uv pip install --python env/bin/python --build-constraints ../pip-build-constraints.txt \
+ 'mlx==0.31.1' 'mlx-lm==0.31.1' 'mlx-metal==0.31.1' 'transformers>=5.0.0,<5.13.0' \
./packages/ltx-core-mlx ./packages/ltx-pipelines-mlx ./packages/ltx-trainer 2>&1 | defuse || return 1
uv pip install --python env/bin/python --reinstall --no-deps \
--build-constraints ../pip-build-constraints.txt \
diff --git a/scripts/post_update.sh b/scripts/post_update.sh
index 9890acb..92e1432 100644
--- a/scripts/post_update.sh
+++ b/scripts/post_update.sh
@@ -332,6 +332,25 @@ if { [ -f "$H3_MODELS_ROOT/models/$H3_DIT_REL" ] || [ -f "$H3_MODELS_ROOT/$H3_DI
|| echo 'WARN: H3 Q8 build failed — H3 keeps the full bf16 engine for now; re-run the H3 engine Install to retry.'
fi
+# ---- 8c. Characters and voices saved scrambled (#62) -----------------------
+# Every character and voice LoRA trained on a venv with safetensors 0.8.0
+# (released 2026-06-09; every fresh install and Update since picked it up) was
+# written with its numbers in the wrong order: it attached, changed the video,
+# and carried no likeness. Found by @tanis2000 (PR #89). The trainer saves
+# correctly from 4.19.0; this repairs the files users already have, exactly
+# (no numbers are lost, only reordered), with the original kept beside it as
+# <file>.scrambled.bak. Only adapters this app trained are read (a trainer or
+# panel sidecar; a voice only beside its trained face), never a symlink or a
+# downloaded LoRA; a file is changed only when the content check says scrambled. BEST-EFFORT and idempotent: a repaired file is never read
+# again, and a clean install has nothing to check.
+MODELS_ROOT="${LTX_MODELS_DIR:-$ROOT/mlx_models}"
+if [ -d "$MODELS_ROOT/loras" ] || [ -d "$MODELS_ROOT/characters" ]; then
+ echo 'Checking trained characters and voices for the scrambled save (#62)…'
+ "$PY" -m lora_lab.repair_scrambled_lora --auto "$MODELS_ROOT" 2>&1 \
+ | sed -u -e 's/[Ee][Rr][Rr][Oo][Rr]:/problem -/g' -e 's/[Ee]rrno /errno-/g' \
+ || echo 'WARN: the trained-LoRA check did not finish - renders are unaffected; Update again to retry.'
+fi
+
# ---- 9. Trim variants we never load ----------------------------------------
# Pre-Y1.024 installs downloaded whole repos (Q4 56 GB instead of 20, Q8 82 GB
# instead of 37). `rm -f` is a no-op when the file is already gone.
diff --git a/scripts/release_gates.sh b/scripts/release_gates.sh
index b1339d7..2268b81 100755
--- a/scripts/release_gates.sh
+++ b/scripts/release_gates.sh
@@ -62,6 +62,31 @@ export HF_HUB_OFFLINE=1
export HF_HUB_DISABLE_TELEMETRY=1
trap 'rm -rf "$GATE_TMP"' EXIT
+# ...AND THE TEST SWEEPS NEVER SEE THE INSTALL'S OWN state/, mlx_outputs/ OR
+# panel_uploads/ (issue #90). conftest.py sandboxes those three for pytest,
+# but the root sweep runs through `python -m unittest`, which never loads
+# conftest — and most root suites import the panel without setting
+# LTX_STATE_DIR themselves. So every gate run read the OPERATOR's
+# panel_settings.json and eta_calibration.json (a gate result that depended
+# on whose Mac ran it) and wrote storyboards, outputs, usage-log lines and
+# analytics install steps INTO the install it ran in. Each suite now gets a
+# fresh, empty tree of its own, set unconditionally: a caller's LTX_STATE_DIR
+# is just as likely to be somebody's real state. check_output_codec is NOT
+# sandboxed — its whole job is to read the real mlx_outputs/.
+# sandbox_env <name>: point the three dirs at a fresh tree for one unittest
+# gate. pytest_env: clear them, so conftest.py builds its own sandbox (it
+# keeps a caller's value, and test_state_sandbox asserts it is conftest's).
+sandbox_env() {
+ local box="$GATE_TMP/sandbox/$(echo "$1" | tr -c 'A-Za-z0-9_.-' '_')"
+ mkdir -p "$box/state" "$box/mlx_outputs" "$box/panel_uploads"
+ export LTX_STATE_DIR="$box/state"
+ export LTX_OUTPUT_DIR="$box/mlx_outputs"
+ export LTX_UPLOADS_DIR="$box/panel_uploads"
+}
+pytest_env() {
+ unset LTX_STATE_DIR LTX_OUTPUT_DIR LTX_UPLOADS_DIR
+}
+
# Parallel arrays: gate name, result, log path.
NAMES=()
RESULTS=()
@@ -70,6 +95,7 @@ LOGS=()
PASS_N=0
FAIL_N=0
SKIP_N=0
+INNER_SKIPS=()
# run_gate <name> <command...>
# Records PASS on exit 0, FAIL otherwise. Output goes to a per-gate log,
@@ -79,8 +105,24 @@ run_gate() {
local log="$LOGDIR/$(echo "$name" | tr -c 'A-Za-z0-9_.-' '_').log"
printf ' %-46s ' "$name"
if "$@" >"$log" 2>&1; then
- printf 'PASS\n'
- NAMES+=("$name"); RESULTS+=("PASS"); LOGS+=("$log")
+ # A suite can pass while some of its tests SKIPPED (a pack this Mac
+ # does not have, an opt-in live test). That is not a pass for what
+ # those tests cover, so the count goes on the row and the reasons
+ # (unittest -v "skipped '...'", pytest -rs "SKIPPED [n] ...", the
+ # registry gate's "SKIP ...") go in the summary, instead of hiding
+ # inside a green line.
+ local nskip
+ nskip=$(grep -Eo 'skipped=[0-9]+|[0-9]+ skipped' "$log" | tail -1 | grep -Eo '[0-9]+')
+ if [ -n "$nskip" ] && [ "$nskip" != "0" ]; then
+ printf 'PASS (%s test(s) skipped)\n' "$nskip"
+ NAMES+=("$name"); RESULTS+=("PASS ($nskip test(s) skipped)"); LOGS+=("$log")
+ while IFS= read -r why; do
+ INNER_SKIPS+=("$name: $why")
+ done < <(grep -Eo "skipped ['\"].*['\"]\$|^SKIPPED \[[0-9]+\] .*|^SKIP .*" "$log" | sort -u)
+ else
+ printf 'PASS\n'
+ NAMES+=("$name"); RESULTS+=("PASS"); LOGS+=("$log")
+ fi
PASS_N=$((PASS_N + 1))
else
printf 'FAIL\n'
@@ -180,21 +222,36 @@ fi
# ---------------------------------------------------------------------------
echo
-echo "== root test sweep (unittest) =="
+echo "== root test sweep (unittest; pytest-style files through pytest) =="
# ---------------------------------------------------------------------------
+# A root file with a module-level `def test_*` is pytest-style (wholly, or
+# mixed with TestCase classes). `python -m unittest` collects ZERO tests from
+# those functions and prints "Ran 0 tests / OK" — the same false green the
+# scripts/ sweep below guards against. Until issue #90 only test_music_engine
+# was routed through pytest; 17 other root suites (366 tests) were reported
+# PASS while not one of their assertions ran, and test_storyboard_planner
+# silently dropped its module-level test. Every such file now goes through
+# pytest, and without pytest it is a loud SKIP, never a pass.
+HAVE_PYTEST=0
+"$VENV_PY" -c "import pytest" >/dev/null 2>&1 && HAVE_PYTEST=1
for t in test_*.py; do
[ -e "$t" ] || continue
mod="${t%.py}"
- # Music uses pytest fixtures; unittest would falsely report zero tests.
- if [ "$mod" = "test_music_engine" ]; then
- run_gate "$mod" "$VENV_PY" -m pytest -q "$t"
- continue
- fi
if [ "$FAST" = "1" ] && [ "$mod" = "test_storyboard_editor_ui" ]; then
mark_skip "$mod" "--fast"
continue
fi
- run_gate "$mod" "$VENV_PY" -m unittest "$mod"
+ if grep -Eq '^(async )?def test_' "$t"; then
+ if [ "$HAVE_PYTEST" = "1" ]; then
+ pytest_env
+ run_gate "$mod" "$VENV_PY" -m pytest -q -rs -p no:cacheprovider "$t"
+ else
+ mark_skip "$mod" "pytest-style suite and pytest is not installed"
+ fi
+ continue
+ fi
+ sandbox_env "$mod"
+ run_gate "$mod" "$VENV_PY" -m unittest -v "$mod"
done
# ---------------------------------------------------------------------------
@@ -211,7 +268,8 @@ echo "== scripts/ test sweep (pytest) =="
PYTEST_ONLY="scripts/test_convert_ltx_mlx.py scripts/test_ltx_pack_diff.py scripts/test_pack_release.py"
if "$VENV_PY" -c "import pytest" >/dev/null 2>&1; then
- run_gate "pytest scripts/" "$VENV_PY" -m pytest -q scripts/
+ pytest_env
+ run_gate "pytest scripts/" "$VENV_PY" -m pytest -q -rs -p no:cacheprovider scripts/
else
echo
echo " ############################################################"
@@ -240,6 +298,13 @@ while [ "$i" -lt "${#NAMES[@]}" ]; do
printf ' %-46s %s\n' "${NAMES[$i]}" "${RESULTS[$i]}"
i=$((i + 1))
done
+if [ "${#INNER_SKIPS[@]}" -gt 0 ]; then
+ echo "------------------------------------------------------------"
+ echo " Tests SKIPPED inside passing suites (not verified on this Mac):"
+ for s in "${INNER_SKIPS[@]}"; do
+ printf ' %s\n' "$s"
+ done
+fi
echo "------------------------------------------------------------"
printf ' PASS %d FAIL %d SKIP %d\n' "$PASS_N" "$FAIL_N" "$SKIP_N"
echo " logs: $LOGDIR"
diff --git a/scripts/webapp_import_shim.mjs b/scripts/webapp_import_shim.mjs
index a4a1b48..25fb16f 100644
--- a/scripts/webapp_import_shim.mjs
+++ b/scripts/webapp_import_shim.mjs
@@ -91,7 +91,7 @@ export function installShim(globalsSeed = {}) {
removeItem(k) { this._m.delete(k); },
};
globalThis.location = { href: "http://127.0.0.1/", reload() {} };
- globalThis.navigator = { userAgent: "phosphene-test-shim", clipboard: { writeText: async () => {} } };
+ Object.defineProperty(globalThis, "navigator", { value: { userAgent: "phosphene-test-shim", clipboard: { writeText: async () => {} } }, configurable: true, writable: true });
globalThis.fetch = async () => ({ ok: true, status: 200,
json: async () => ({}),
text: async () => "" });
diff --git a/test_character_roundtrip.py b/test_character_roundtrip.py
index 8782841..187d4be 100644
--- a/test_character_roundtrip.py
+++ b/test_character_roundtrip.py
@@ -803,12 +803,13 @@ class TestQueueCharacterVoiceContract(unittest.TestCase):
installed, the Mac lacks the RAM, or the mode is one H3 does not serve.
The character refusal used to re-read the RAW form field instead of the
resolved engine, so a request that was about to render correctly on LTX
- with the full character stack got a 400 instead. `extend` is one of the
- modes H3 never serves, so this can be asserted without depending on
+ with the full character stack got a 400 instead. `restore` (Colorize)
+ is one of the modes H3 never serves (`extend` was, until 4.19 taught H3
+ to continue a clip), so this can be asserted without depending on
whether H3 is installed on the machine running the test.
"""
reply, params = self._post({
- "mode": "extend", "engine": "h3", "character_id": "bizarrotrn",
+ "mode": "restore", "engine": "h3", "character_id": "bizarrotrn",
"prompt": "bizarrotrn keeps speaking",
})
self.assertEqual(reply["status"], 200, reply)
diff --git a/test_codex_4170_editor.py b/test_codex_4170_editor.py
index 64a853e..59a0232 100644
--- a/test_codex_4170_editor.py
+++ b/test_codex_4170_editor.py
@@ -96,7 +96,7 @@ class Editor1MarkersTravel(unittest.TestCase):
def setUpClass(cls) -> None:
cls.r = run(r"""
const beacons = [];
-global.navigator = { sendBeacon: (url, blob) => { beacons.push({ url, blob }); return true; } };
+Object.defineProperty(globalThis, "navigator", { value: { sendBeacon: (url, blob) => { beacons.push({ url, blob }); return true; } }, configurable: true, writable: true });
function filmA() {
return { title: 'A', edit: { revision: 3, clips: [clip({ id: 'a', end: 2 })],
markers: [{ id: 'm0', at: 0.5, kind: 'beat', label: 'drop' }] } };
diff --git a/test_codex_4170_lipsync.py b/test_codex_4170_lipsync.py
index 1dd07a1..85e0463 100644
--- a/test_codex_4170_lipsync.py
+++ b/test_codex_4170_lipsync.py
@@ -190,7 +190,11 @@ def test_lipsync_3_retake_and_extend_decode_at_the_source_rate():
assert '"fps": fps, "frames": win["pixel_frames"]' in blk
# Extend: same class — the decode reads the source rate.
ext = HELPER_SRC[HELPER_SRC.index('if action == "extend":'):HELPER_SRC.index('if action == "retake_segment":')]
- assert "frame_rate=_source_fps(video_path, p.get(\"frame_rate\"))" in ext
+ # 4.19.0 (#48): the extend decode has two paths (the splice-ready
+ # _decode_extend_stems and the old one), both fed one source-rate value.
+ assert "_ext_fps = _source_fps(video_path, p.get(\"frame_rate\"))" in ext
+ assert "frame_rate=_ext_fps" in ext and ", _ext_fps)" in ext, \
+ "both extend decodes (stems + mp4) must use the source rate"
assert 'frame_rate=float(p.get("frame_rate", 24.0))' not in ext
diff --git a/test_codex_4170_safety.py b/test_codex_4170_safety.py
index 4d9f85f..bae1aac 100644
--- a/test_codex_4170_safety.py
+++ b/test_codex_4170_safety.py
@@ -320,7 +320,10 @@ loadParams({ params: %s }).then(() => console.log(JSON.stringify({ calls,
}""" % json.dumps(params))
-def test_safety_4_a_queued_h3_job_restores_its_engine_and_h3_recipe():
+def test_safety_4_a_queued_h3_job_restores_its_engine_and_h3_recipe(monkeypatch):
+ # As an H3-capable Mac (issue #90): below the RAM floor make_job falls
+ # back to LTX by design, and there is no H3 recipe left to restore.
+ monkeypatch.setenv("LTX_H3_FORCE_CAPABLE", "1")
h3 = p.make_job({"mode": "t2v", "engine": "h3", "prompt": "a hen skates",
"h3_quality": "high", "h3_length": "15s", "h3_tristep": "1",
"h3_chain_prompts": json.dumps(["w1", "w2", "w3"]), "seed": "-1"})["params"]
@@ -369,7 +372,8 @@ editQueuedJob('j-h3').then(() => console.log(JSON.stringify({ got, editingSeen,
assert out["editingSeen"] is None and out["after"] == "j-h3"
-def test_safety_4_update_keeps_what_the_form_cannot_express(queue_state):
+def test_safety_4_update_keeps_what_the_form_cannot_express(queue_state, monkeypatch):
+ monkeypatch.setenv("LTX_H3_FORCE_CAPABLE", "1") # see the test above
orig = p.make_job({"mode": "t2v", "engine": "h3", "prompt": "old", "h3_quality": "high",
"h3_length": "10s", "session_tag": "sb:sb_1#2"})
orig["params"]["source"] = "storyboard"
diff --git a/test_editor_save_integrity.py b/test_editor_save_integrity.py
index 07d6d44..1502346 100644
--- a/test_editor_save_integrity.py
+++ b/test_editor_save_integrity.py
@@ -780,7 +780,7 @@ class UnloadBeaconsTheBackup(unittest.TestCase):
cls.r = run(TWO_CLIPS + r"""
twoClips();
const beacons = [];
-global.navigator = { sendBeacon: (url, blob) => { beacons.push({ url, blob }); return true; } };
+Object.defineProperty(globalThis, "navigator", { value: { sendBeacon: (url, blob) => { beacons.push({ url, blob }); return true; } }, configurable: true, writable: true });
SBE.open = true; SBE.id = 'F'; SBE.activeDraft = 'draft-1'; SBE.session = 'sess1';
sbeBeaconBackup();
out.count = beacons.length;
diff --git a/test_extend_splice.py b/test_extend_splice.py
new file mode 100644
index 0000000..0689a41
--- /dev/null
+++ b/test_extend_splice.py
@@ -0,0 +1,468 @@
+#!/usr/bin/env python3
+"""Contract gate: an Extend delivers the clip you had, untouched (issue #48).
+
+Before this, every round of an extend chain delivered the model pipeline's own
+copy of the source — VAE + vocoder round trip (LTX) or decode + canvas resample
++ 32 kHz resample (H3), then a fresh lossy encode — over the WHOLE accumulated
+clip, so a chain compounded into a picture "made out of particles" and mushy
+audio. `extend_splice` keeps the source's H.264 packets bit-exact when it can,
+decodes it exactly once when it cannot, and encodes the soundtrack once from a
+lossless master.
+
+What is pinned here, with real ffmpeg on synthetic clips (no GPU, no model):
+* the frame layout each engine's output has (LTX 1+8k, before/after; H3);
+* the crossfade: the source PCM before the fade and the generated PCM after the
+ seam come through sample-exact;
+* a 2-round chain keeps the ORIGINAL frames bit-exact and its source-region
+ audio PCM bit-exact (master), and keeps the >8 kHz content;
+* every way the copy is impossible (frame count off the 1+8k grid, a changed
+ output preset, another canvas, a silent source) still yields a verified file;
+* the panel's wiring: the H3 lane continues the native render and asks the
+ runner for a lossless intermediate, and a failed splice still delivers.
+"""
+from __future__ import annotations
+
+import json
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+import unittest
+import unittest.mock
+from pathlib import Path
+
+import numpy as np
+
+ROOT = Path(__file__).resolve().parent
+_TMP = Path(tempfile.mkdtemp(prefix="phos-extend-splice-"))
+for _k, _d in (("LTX_STATE_DIR", "state"), ("LTX_OUTPUT_DIR", "out"),
+ ("LTX_UPLOADS_DIR", "uploads")):
+ (_TMP / _d).mkdir(parents=True, exist_ok=True)
+ os.environ[_k] = str(_TMP / _d)
+os.environ["PHOSPHENE_ANALYTICS_DISABLED"] = "1"
+os.environ["PHOSPHENE_DISABLE_VERSION_CHECK"] = "1"
+os.environ.setdefault("LTX_PORT", "8304")
+sys.path.insert(0, str(ROOT))
+
+import extend_splice as X # noqa: E402
+
+SR = X.SAMPLE_RATE
+
+
+def _tool(name: str) -> str | None:
+ for cand in (shutil.which(name), f"/opt/homebrew/bin/{name}",
+ str(Path.home() / f"pinokio/bin/miniforge/bin/{name}")):
+ if cand and Path(cand).is_file():
+ return cand
+ return None
+
+
+FF, FP = _tool("ffmpeg"), _tool("ffprobe")
+
+
+def ff(*args: str) -> None:
+ subprocess.run([FF, "-v", "error", "-y", *args], check=True, capture_output=True)
+
+
+def md5s(path: Path, first: int = 0, count: int | None = None) -> list[str]:
+ out = subprocess.run([FF, "-v", "error", "-i", str(path), "-map", "0:v:0", "-f", "framemd5", "-"],
+ capture_output=True, text=True, check=True).stdout
+ rows = [ln.rsplit(",", 1)[1].strip() for ln in out.splitlines()
+ if ln and not ln.startswith("#")]
+ return rows[first:None if count is None else first + count]
+
+
+def pcm(path: Path) -> np.ndarray:
+ raw = subprocess.run([FF, "-v", "error", "-i", str(path), "-map", "0:a:0", "-ac", "2",
+ "-ar", str(SR), "-f", "f32le", "-"], capture_output=True,
+ check=True).stdout
+ return np.frombuffer(raw, "<f4").reshape(-1, 2).T
+
+
+def hf_share(x: np.ndarray, lo: float = 8000.0) -> float:
+ m = x.mean(axis=0)
+ spec = np.abs(np.fft.rfft(m)) ** 2
+ f = np.fft.rfftfreq(m.size, 1 / SR)
+ return float(spec[f >= lo].sum() / (spec.sum() + 1e-20))
+
+
+# ---------------------------------------------------------------------------
+# Pure layout + PCM logic
+# ---------------------------------------------------------------------------
+
+class Layouts(unittest.TestCase):
+ def test_ltx_uses_the_vae_grid(self):
+ self.assertEqual(X.ltx_source_frames(121), 121)
+ self.assertEqual(X.ltx_source_frames(124), 121) # an H3 5 s clip: 3 dropped
+ self.assertEqual(X.ltx_source_frames(1), 1)
+
+ def test_ltx_after(self):
+ lay = X.ltx_layout(121, 161)
+ self.assertEqual((lay.source_frames, lay.new_start, lay.new_end), (121, 121, 161))
+ self.assertEqual((lay.total_frames, lay.seam_frame), (161, 121))
+
+ def test_ltx_after_on_an_off_grid_source(self):
+ lay = X.ltx_layout(124, 161) # model saw 121 of 124
+ self.assertEqual((lay.source_frames, lay.new_frames), (121, 40))
+
+ def test_ltx_before(self):
+ lay = X.ltx_layout(121, 161, "before")
+ self.assertFalse(lay.source_first)
+ self.assertEqual((lay.new_start, lay.new_end, lay.seam_frame), (0, 40, 40))
+
+ def test_h3(self):
+ lay = X.h3_layout(124 + 120, 120)
+ self.assertEqual((lay.source_frames, lay.new_start, lay.total_frames), (124, 124, 244))
+
+ def test_nothing_new_is_refused(self):
+ with self.assertRaises(X.SpliceError):
+ X.ltx_layout(121, 121)
+ with self.assertRaises(X.SpliceError):
+ X.h3_layout(50, 0)
+
+
+class Crossfade(unittest.TestCase):
+ def setUp(self):
+ rng = np.random.default_rng(1)
+ self.src = rng.standard_normal((2, 1000)).astype(np.float32)
+ self.gen = rng.standard_normal((2, 1600)).astype(np.float32)
+
+ def test_after_keeps_both_sides_sample_exact(self):
+ out = X.crossfade_splice(self.src, self.gen, seam=1000, fade=100)
+ self.assertEqual(out.shape, (2, 1600))
+ np.testing.assert_array_equal(out[:, :900], self.src[:, :900])
+ np.testing.assert_array_equal(out[:, 1000:], self.gen[:, 1000:])
+ # linear: the weights of the two inputs sum to one across the fade
+ k = 950
+ w = (k - 900 + 0.5) / 100
+ np.testing.assert_allclose(out[:, k], self.src[:, k] * (1 - w) + self.gen[:, k] * w,
+ rtol=1e-6)
+
+ def test_short_source_hands_over_where_it_ends(self):
+ out = X.crossfade_splice(self.src[:, :600], self.gen, seam=1000, fade=100)
+ self.assertEqual(out.shape[1], 1600)
+ np.testing.assert_array_equal(out[:, :500], self.src[:, :500])
+ np.testing.assert_array_equal(out[:, 600:], self.gen[:, 600:])
+
+ def test_before(self):
+ out = X.crossfade_splice(self.src, self.gen, seam=600, fade=100, source_first=False)
+ self.assertEqual(out.shape[1], 1600)
+ np.testing.assert_array_equal(out[:, :600], self.gen[:, :600])
+ np.testing.assert_array_equal(out[:, 700:], self.src[:, 100:])
+
+ def test_fit_length(self):
+ self.assertEqual(X.fit_length(self.src, 1200).shape, (2, 1200))
+ self.assertEqual(X.fit_length(self.src, 10).shape, (2, 10))
+
+
+# ---------------------------------------------------------------------------
+# Real files
+# ---------------------------------------------------------------------------
+
+def _encode_like_the_helper(src_args: list[str], out: Path, frames: int,
+ pix_fmt: str = "yuv420p", crf: str = "18",
+ audio: bool = True, size: str = "256x160",
+ rate: int = 24) -> Path:
+ """A clip shaped like an LTX render: libx264 at the preset, no colour tags,
+ AAC at ffmpeg's default; a 440 Hz + 11 kHz tone so >8 kHz content exists."""
+ secs = f"{frames / rate:.6f}"
+ args = ["-f", "lavfi", "-t", secs, "-i", f"{src_args[0]}=size={size}:rate={rate}"]
+ if audio:
+ args += ["-f", "lavfi", "-t", secs, "-i",
+ f"aevalsrc=0.3*sin(2*PI*440*t)+0.1*sin(2*PI*11000*t)|"
+ f"0.3*sin(2*PI*440*t)+0.1*sin(2*PI*11000*t):s={SR}"]
+ args += ["-frames:v", str(frames), "-c:v", "libx264", "-pix_fmt", pix_fmt, "-crf", crf]
+ if audio:
+ args += ["-c:a", "aac"]
+ ff(*args, "-movflags", "+faststart", str(out))
+ return out
+
+
+def _generated(source: Path, new: int, out: Path, wav: Path, size: str = "256x160",
+ keep: int | None = None) -> None:
+ """What the helper hands the panel: the source's frames (as the model
+ decodes them — here a slight blur, so nothing can pass by accident) plus
+ `new` frames of other content, lossless; and a 48 kHz wav of the same
+ timeline whose new part is a different tone."""
+ ff("-i", str(source), "-f", "lavfi", "-i", f"mandelbrot=size={size}:rate=24",
+ "-filter_complex",
+ f"[0:v]trim=end_frame={keep or 100000},scale={size.replace('x', ':')},setsar=1,"
+ f"gblur=sigma=0.6,format=yuv444p[a];"
+ f"[1:v]trim=end_frame={new},setsar=1,format=yuv444p[b];"
+ f"[a][b]concat=n=2:v=1:a=0[v]", "-map", "[v]",
+ "-c:v", "libx264", "-pix_fmt", "yuv444p", "-crf", "0", str(out))
+ n = int(X.probe(FP, out)["frames"])
+ ff("-f", "lavfi", "-i",
+ f"aevalsrc=if(lt(t\\,{(n - new) / 24:.6f})\\,0.25*sin(2*PI*440*t)\\,0.25*sin(2*PI*660*t)):s={SR}",
+ "-t", f"{n / 24 + 0.04:.6f}", "-ac", "2", str(wav))
+
+
[email protected](FF and FP, "ffmpeg/ffprobe not available")
+class Splice(unittest.TestCase):
+ def setUp(self):
+ self.d = Path(tempfile.mkdtemp(dir=_TMP))
+
+ def splice(self, source, generated, wav, out, layout, **kw):
+ return X.splice(ffmpeg=FF, ffprobe=FP, source=source, generated=generated,
+ generated_audio=wav, out=out, layout=layout,
+ work=self.d / f"work_{out.stem}", pix_fmt=kw.pop("pix_fmt", "yuv420p"),
+ crf=kw.pop("crf", "18"), **kw)
+
+ def round(self, source: Path, new: int, tag: str, master: Path | None = None, **kw):
+ gen, wav = self.d / f"{tag}_gen.mp4", self.d / f"{tag}_gen.wav"
+ n_src = X.probe(FP, source)["frames"]
+ # Like the model: only the first 1 + 8k source frames come back.
+ _generated(source, new, gen, wav, keep=X.ltx_source_frames(n_src))
+ lay = X.ltx_layout(n_src, X.probe(FP, gen)["frames"], kw.pop("direction", "after"))
+ out = self.d / f"{tag}.mp4"
+ rep = self.splice(source, gen, wav, out, lay, source_master=master,
+ master_out=self.d / f"{tag}.flac", **kw)
+ return out, rep, lay
+
+ def test_a_chain_keeps_the_original_bit_exact(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "orig.mp4", 49)
+ r1, rep1, _ = self.round(orig, 16, "r1")
+ self.assertEqual(rep1["video"], "copy")
+ self.assertEqual(rep1["audio"], "decoded")
+ self.assertEqual(X.probe(FP, r1)["frames"], 65)
+ self.assertEqual(md5s(r1, 0, 49), md5s(orig))
+ r2, rep2, _ = self.round(r1, 16, "r2", master=self.d / "r1.flac")
+ self.assertEqual(rep2["video"], "copy")
+ self.assertEqual(rep2["audio"], "master")
+ self.assertEqual(X.probe(FP, r2)["frames"], 81)
+ self.assertEqual(md5s(r2, 0, 49), md5s(orig)) # round 0 frames
+ self.assertEqual(md5s(r2, 0, 65), md5s(r1)) # all of round 1
+ # The master's source region is carried sample-exact (up to the fade).
+ m1, m2 = pcm(self.d / "r1.flac"), pcm(self.d / "r2.flac")
+ keep = int((65 / 24 - X.FADE_SECONDS) * SR)
+ np.testing.assert_array_equal(m2[:, :keep], m1[:, :keep])
+ # ...and so is everything >8 kHz in it (the vocoder would have re-invented it).
+ o = pcm(orig)[:, : int(1.9 * SR)]
+ self.assertGreater(hf_share(o), 0.01)
+ self.assertAlmostEqual(hf_share(pcm(r2)[:, : o.shape[1]]), hf_share(o), delta=0.01)
+ # Delivery: H.264 + AAC, faststart, audio exactly as long as the picture.
+ info = subprocess.run([FP, "-v", "error", "-show_entries", "stream=codec_name,duration",
+ "-of", "json", str(r2)], capture_output=True, text=True).stdout
+ streams = json.loads(info)["streams"]
+ self.assertEqual([s["codec_name"] for s in streams], ["h264", "aac"])
+ self.assertAlmostEqual(float(streams[1]["duration"]), 81 / 24, delta=0.03)
+
+ def test_the_new_frames_are_the_models(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o.mp4", 49)
+ r1, _, _ = self.round(orig, 16, "n1")
+ gen = self.d / "n1_gen.mp4"
+ res = subprocess.run(
+ [FF, "-i", str(r1), "-i", str(gen), "-lavfi",
+ "[0:v]trim=start_frame=49,setpts=PTS-STARTPTS,format=yuv420p[a];"
+ "[1:v]trim=start_frame=49,setpts=PTS-STARTPTS,format=yuv420p[b];[a][b]psnr",
+ "-f", "null", "-"], capture_output=True, text=True).stderr
+ psnr = float(res.rsplit("average:", 1)[1].split()[0])
+ self.assertGreater(psnr, 35.0)
+
+ def test_off_grid_source_is_decoded_once_and_trimmed(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o52.mp4", 52) # 1+8k = 49
+ out, rep, lay = self.round(orig, 16, "g1")
+ self.assertEqual(rep["video"], "reencode")
+ self.assertEqual(lay.source_frames, 49)
+ self.assertEqual(X.probe(FP, out)["frames"], 65)
+
+ def test_a_changed_preset_cannot_be_copied(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o.mp4", 49, crf="18")
+ out, rep, _ = self.round(orig, 16, "p1", crf="23")
+ self.assertEqual(rep["video"], "reencode")
+ self.assertEqual(X.probe(FP, out)["frames"], 65)
+ # ...and the round after it copies again (the chain heals in one hop).
+ _, rep2, _ = self.round(out, 16, "p2", crf="23", master=self.d / "p1.flac")
+ self.assertEqual(rep2["video"], "copy")
+
+ def test_lossless_preset_chain_copies(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o444.mp4", 49,
+ pix_fmt="yuv444p", crf="0")
+ out, rep, _ = self.round(orig, 16, "l1", pix_fmt="yuv444p", crf="0")
+ self.assertEqual(rep["video"], "copy")
+ self.assertEqual(md5s(out, 0, 49), md5s(orig))
+
+ def test_another_canvas_delivers_the_models_frames(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "big.mp4", 49, size="320x192")
+ gen, wav = self.d / "c_gen.mp4", self.d / "c_gen.wav"
+ small = self.d / "small.mp4"
+ ff("-i", str(orig), "-vf", "scale=256:160", "-c:v", "libx264", "-crf", "0", str(small))
+ _generated(small, 16, gen, wav)
+ lay = X.ltx_layout(49, X.probe(FP, gen)["frames"])
+ rep = self.splice(orig, gen, wav, self.d / "c.mp4", lay)
+ self.assertEqual(rep["video"], "generated")
+ self.assertEqual(rep["audio"], "decoded") # the soundtrack still splices
+ self.assertEqual(X.probe(FP, self.d / "c.mp4")["frames"], 65)
+
+ def test_silent_source(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "mute.mp4", 49, audio=False)
+ out, rep, _ = self.round(orig, 16, "s1")
+ self.assertEqual(rep["audio"], "silent-source")
+ a = pcm(out)
+ self.assertLess(float(np.abs(a[:, : int(1.9 * SR)]).max()), 1e-4)
+ self.assertGreater(float(np.abs(a[:, int(2.2 * SR):]).max()), 0.1)
+
+ def test_extend_before_puts_the_source_last(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o.mp4", 49)
+ gen, wav = self.d / "b_gen.mp4", self.d / "b_gen.wav"
+ # the model's "before" output: 16 new frames, then its copy of the source
+ ff("-f", "lavfi", "-i", "mandelbrot=size=256x160:rate=24", "-i", str(orig),
+ "-filter_complex", "[0:v]trim=end_frame=16,format=yuv444p[a];[1:v]format=yuv444p[b];"
+ "[a][b]concat=n=2:v=1:a=0[v]", "-map", "[v]", "-c:v", "libx264", "-pix_fmt",
+ "yuv444p", "-crf", "0", str(gen))
+ ff("-f", "lavfi", "-i", f"sine=f=660:r={SR}", "-t", "2.75", "-ac", "2", str(wav))
+ lay = X.ltx_layout(49, 65, "before")
+ out = self.d / "b.mp4"
+ rep = self.splice(orig, gen, wav, out, lay)
+ self.assertEqual(rep["video"], "copy")
+ self.assertEqual(md5s(out, 16, 49), md5s(orig))
+
+ def test_h3_delivery_codec_intermediate_is_copied_through(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "h.mp4", 49, size="320x192")
+ gen, wav = self.d / "h_gen.mp4", self.d / "h_gen.wav"
+ _generated(orig, 24, gen, wav, size="256x160")
+ ff("-i", str(gen), "-c:v", "libx264", "-crf", "18", "-pix_fmt", "yuv420p",
+ str(self.d / "h_gen18.mp4"))
+ lay = X.h3_layout(X.probe(FP, gen)["frames"], 24)
+ out = self.d / "h1.mp4"
+ X.splice(ffmpeg=FF, ffprobe=FP, source=orig, generated=self.d / "h_gen18.mp4",
+ generated_audio=wav, out=out, layout=lay, work=self.d / "hw",
+ pix_fmt="yuv420p", crf="18", generated_lossless=False)
+ self.assertEqual(md5s(out), md5s(self.d / "h_gen18.mp4")) # copied, not re-encoded
+
+ def test_a_stale_master_is_not_trusted(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o.mp4", 49)
+ stale = self.d / "stale.flac"
+ ff("-f", "lavfi", "-i", f"sine=f=1000:r={SR}", "-t", "5", "-ac", "2", str(stale))
+ _, rep, _ = self.round(orig, 16, "st", master=stale)
+ self.assertEqual(rep["audio"], "decoded")
+
+
+# ---------------------------------------------------------------------------
+# Panel wiring
+# ---------------------------------------------------------------------------
+
+import mlx_ltx_panel as P # noqa: E402
+
+
[email protected](FF and FP, "ffmpeg/ffprobe not available")
+class PanelDelivery(unittest.TestCase):
+ def setUp(self):
+ self.d = Path(tempfile.mkdtemp(dir=_TMP))
+ self.logs: list[str] = []
+ self.patches = [unittest.mock.patch.object(P, "push", self.logs.append),
+ unittest.mock.patch.object(P, "FFMPEG", Path(FF)),
+ unittest.mock.patch.object(P, "FFPROBE", Path(FP)),
+ unittest.mock.patch.object(
+ P, "run_ffmpeg_tracked",
+ lambda cmd, label: subprocess.run(
+ [str(c) for c in cmd], check=True, capture_output=True))]
+ for p in self.patches:
+ p.start()
+
+ def tearDown(self):
+ for p in self.patches:
+ p.stop()
+
+ def test_master_is_found_through_the_picked_exports_sidecar(self):
+ native, export = self.d / "clip.mp4", self.d / "clip_720p.mp4"
+ master = self.d / "m.flac"
+ for f in (native, export, master):
+ f.write_bytes(b"x" * 2048)
+ (self.d / "clip_720p.mp4.json").write_text(json.dumps(
+ {"native_output": str(native), "extend_audio_master": str(master)}))
+ self.assertIsNone(P._extend_audio_master_for(native))
+ self.assertEqual(P._extend_audio_master_for(export), master)
+
+ def test_a_failed_splice_still_delivers_the_models_output(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o.mp4", 49)
+ gen, wav = self.d / "gen.mp4", self.d / "gen.wav"
+ _generated(orig, 16, gen, wav)
+ out = self.d / "out.mp4"
+ with unittest.mock.patch.object(X, "splice", side_effect=X.SpliceError("boom")):
+ rep = P.deliver_extend(orig, gen, wav, out, self.d / "w", engine="ltx",
+ codec={"pix_fmt": "yuv420p", "crf": "18"})
+ self.assertEqual(rep["video"], "fallback")
+ self.assertEqual(X.probe(FP, out)["frames"], 65)
+ self.assertTrue(any("boom" in ln for ln in self.logs))
+
+ def test_deliver_extend_writes_the_master_where_the_sidecar_points(self):
+ orig = _encode_like_the_helper(["testsrc2"], self.d / "o.mp4", 49)
+ gen, wav = self.d / "gen.mp4", self.d / "gen.wav"
+ _generated(orig, 16, gen, wav)
+ out = P.OUTPUT / "o_ext2_x.mp4"
+ work = self.d / "work"
+ rep = P.deliver_extend(orig, gen, wav, out, work, engine="ltx",
+ codec={"pix_fmt": "yuv420p", "crf": "18"})
+ self.assertEqual(rep["video"], "copy")
+ self.assertTrue(Path(rep["audio_master"]).is_file())
+ self.assertIn(f"{os.sep}.extend{os.sep}masters{os.sep}", rep["audio_master"])
+ self.assertFalse(work.exists()) # intermediates cleaned up
+
+
+class H3Wiring(unittest.TestCase):
+ """The H3 lane continues the NATIVE render and gets a lossless intermediate."""
+
+ def setUp(self):
+ sys.path.insert(0, str(ROOT))
+ import test_h3_capabilities as T # noqa: PLC0415
+ self.T = T
+
+ def _dispatch(self, flags, params):
+ T = self.T
+
+ class E(T._Env):
+ pass
+ E.flags = flags
+ e = E("run")
+ e.setUp()
+ try:
+ return e.dispatch(params)
+ finally:
+ e.tearDown()
+
+ def test_native_render_and_lossless_intermediate(self):
+ native = self.T._media("ext_native.mp4")
+ native.write_bytes(b"\0" * 4096)
+ export = self.T._media("ext_native_720p.mp4")
+ Path(str(export) + ".json").write_text(json.dumps({"native_output": str(native)}))
+ cmd, _ = self._dispatch(self.T.ALL_FLAGS + ("--crf",),
+ {"mode": "extend", "h3_tier": "high_5s",
+ "video_path": str(export), "h3_extend_seconds": 5})
+ self.assertEqual(cmd[cmd.index("--extend-from") + 1], str(native))
+ self.assertEqual(cmd[cmd.index("--crf") + 1], "0")
+ self.assertEqual(cmd.count("--crf"), 1)
+
+ def test_an_old_runner_without_crf_is_not_asked(self):
+ cmd, _ = self._dispatch(self.T.ALL_FLAGS,
+ {"mode": "extend", "video_path": str(self.T._media("e2.mp4"))})
+ self.assertNotIn("--crf", cmd)
+
+
[email protected](FF and FP, "ffmpeg/ffprobe not found")
+class AudioStartOffset(unittest.TestCase):
+ """Codex 4.19.0: a source whose sound starts later than its first frame
+ kept its PCM from sample 0, so the source part played early after a
+ splice. The PCM is now placed on the video's timeline."""
+
+ def test_a_late_audio_start_is_padded_onto_the_video_clock(self):
+ d = Path(tempfile.mkdtemp(prefix="offs-", dir=_TMP))
+ tone = d / "tone.wav"
+ ff("-f", "lavfi", "-i", f"sine=frequency=440:sample_rate={SR}:duration=1", "-ac", "2", str(tone))
+ clip = d / "late.mp4"
+ ff("-f", "lavfi", "-i", "color=c=gray:s=64x64:r=24:d=2", "-itsoffset", "0.5", "-i", str(tone),
+ "-map", "0:v", "-map", "1:a", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac",
+ str(clip))
+ info = X.probe(FP, clip)
+ self.assertAlmostEqual(info["audio_offset"], 0.5, delta=0.05)
+ run = lambda cmd, label: subprocess.run(cmd, check=True, capture_output=True) # noqa: E731
+ x = X._read_pcm(run, FF, clip, d / "a.f32", "t", offset=info["audio_offset"])
+ lead = np.abs(x[:, : int(0.45 * SR)]).max()
+ tone_at = np.abs(x[:, int(0.55 * SR): int(0.9 * SR)]).max()
+ self.assertLess(lead, 1e-3) # silence where the sound had not started
+ self.assertGreater(tone_at, 0.05) # the tone where it really plays (sine at 1/8)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_fleet_calibration.py b/test_fleet_calibration.py
index ee14cf0..6b68111 100644
--- a/test_fleet_calibration.py
+++ b/test_fleet_calibration.py
@@ -12,13 +12,18 @@ import mlx_ltx_panel as p
class SpeedFactor(unittest.TestCase):
def test_unknown_chip_prices_as_m4_max(self):
+ # No per-install calibration: this asserts the bare chip factor, so it
+ # must not read the running install's learned ETA correction.
with mock.patch.object(p, "_hw_chip_family", lambda: "unknown"), \
+ mock.patch.object(p, "_load_eta_calibration", lambda: {}), \
mock.patch.dict(os.environ, {"PHOSPHENE_SPEED_FACTOR": ""}):
self.assertEqual(p._hw_speed_factor("ltx"), 1.0)
self.assertEqual(p._hw_speed_factor("h3"), 1.0)
def test_m4_pro_is_slower_and_m5_max_faster(self):
- with mock.patch.dict(os.environ, {"PHOSPHENE_SPEED_FACTOR": ""}):
+ # Bare chip factors: pin out this install's learned ETA correction.
+ with mock.patch.object(p, "_load_eta_calibration", lambda: {}), \
+ mock.patch.dict(os.environ, {"PHOSPHENE_SPEED_FACTOR": ""}):
with mock.patch.object(p, "_hw_chip_family", lambda: "M4 Pro"):
self.assertGreater(p._hw_speed_factor("ltx"), 1.4)
self.assertGreater(p._hw_speed_factor("h3"), 1.8)
diff --git a/test_geometry_grid.py b/test_geometry_grid.py
index fd75b00..f1e590b 100644
--- a/test_geometry_grid.py
+++ b/test_geometry_grid.py
@@ -12,6 +12,7 @@ import os
import sys
import tempfile
import unittest
+from unittest import mock
from pathlib import Path
ROOT = Path(__file__).resolve().parent
@@ -58,8 +59,11 @@ class TestLtxGeometryGrid(unittest.TestCase):
def test_h3_geometry_still_comes_from_the_tier_cell(self):
# The H3 lane stamps the (quality × length) cell's own geometry over
# the form; the LTX grid must not touch it (H3 frames ride 17n+5).
- p = job_for({"engine": "h3", "width": "1000", "height": "500",
- "frames": "100"})["params"]
+ # As an H3-capable Mac (issue #90): below the RAM floor make_job falls
+ # back to LTX by design, which put the LTX grid's 960x448 here.
+ with mock.patch.dict(os.environ, {"LTX_H3_FORCE_CAPABLE": "1"}):
+ p = job_for({"engine": "h3", "width": "1000", "height": "500",
+ "frames": "100"})["params"]
tier = P.H3_TIERS[p["h3_tier"]]
self.assertEqual((p["width"], p["height"], p["frames"]),
(tier["width"], tier["height"], tier["frames"]))
diff --git a/test_h3_capabilities.py b/test_h3_capabilities.py
new file mode 100644
index 0000000..477f259
--- /dev/null
+++ b/test_h3_capabilities.py
@@ -0,0 +1,616 @@
+#!/usr/bin/env python3
+"""Contract gate: the 4.19 Hailuo H3 capabilities.
+
+* Carried context — a chained H3 window continues from the last 17 frames of
+ the previous one AND their sound (`--chain-context-frames 17`), on by
+ default, off with `h3_continuity=off`, never sent to a runner without it.
+* Keyframes — Start & end frame (the start optional on H3), Keyframes 3-8
+ (`--keyframe PATH@FRAME`), each still pre-fitted to the canvas.
+* Extend — any clip, `--extend-from` + `--extend-frames`, windows from the
+ seconds asked for.
+* Lip-sync — the user's track held (`--audio-drive`), the separated vocal when
+ asked, the original delivered (`--audio-mux`), the sync contract appended once.
+* Add sound — `--video-to-audio`, H3's alone (LTX excludes the mode).
+* Fast HD — the 640×384 Fast pass + Upscale & Face Fix, forced together and
+ priced whole.
+
+Every mode is probed on the INSTALLED runner, so an older pack falls back or
+refuses with the update sentence instead of an argparse error. No model, no
+GPU, no network: the runner is intercepted at Popen.
+"""
+from __future__ import annotations
+
+import json
+import os
+import sys
+import tempfile
+import unittest
+import unittest.mock
+from contextlib import ExitStack
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent
+_TMP = Path(tempfile.mkdtemp(prefix="phos-h3-cap-"))
+for _k, _d in (("LTX_STATE_DIR", "state"), ("LTX_OUTPUT_DIR", "out"),
+ ("LTX_UPLOADS_DIR", "uploads")):
+ (_TMP / _d).mkdir(parents=True, exist_ok=True)
+ os.environ[_k] = str(_TMP / _d)
+os.environ["PHOSPHENE_ANALYTICS_DISABLED"] = "1"
+os.environ["PHOSPHENE_DISABLE_VERSION_CHECK"] = "1"
+os.environ["LTX_H3_FORCE_CAPABLE"] = "1"
+os.environ.setdefault("LTX_PORT", "8303")
+sys.path.insert(0, str(ROOT))
+
+import mlx_ltx_panel as P # noqa: E402
+
+ALL_FLAGS = ("--lora", "--sigma-subset", "--lora-adaln", "--first-frame", "--seam-colour-frames",
+ "--chain-windows", "--chain-prompts", "--last-frame", "--keyframe",
+ "--chain-context-frames", "--extend-from", "--audio-drive",
+ "--video-to-audio")
+
+
+def _png(name: str, size=(1024, 576)) -> Path:
+ from PIL import Image
+ p = _TMP / name
+ Image.new("RGB", size, (90, 60, 40)).save(p)
+ return p
+
+
+def _media(name: str) -> Path:
+ p = _TMP / name
+ p.write_bytes(b"\0" * 64)
+ return p
+
+
+class _Env(unittest.TestCase):
+ flags = ALL_FLAGS
+
+ def setUp(self):
+ self.st = ExitStack()
+ self.logs: list[str] = []
+ flags = self.flags
+ for name, val in {
+ "h3_available": lambda: True,
+ "h3_capable": lambda: True,
+ "_h3_runner_has_flag": lambda flag: flag in flags,
+ "push": self.logs.append}.items():
+ self.st.enter_context(unittest.mock.patch.object(P, name, val))
+
+ def tearDown(self):
+ self.st.close()
+
+ def dispatch(self, params: dict, probes: dict | None = None) -> tuple[list[str], dict]:
+ seen = {}
+
+ class Intercept(Exception):
+ pass
+
+ def popen(cmd, **kw):
+ seen["cmd"] = cmd
+ raise Intercept()
+
+ job = {"id": "cap-1", "params": {
+ "engine": "h3", "mode": "t2v", "prompt": "a man walks", "seed": "7",
+ "h3_tier": "draft_5s", "h3_turbo": False, "h3_tristep": False, "steps": 9,
+ **params}}
+ paths = dict(missing=[], repairable=False, dit=_TMP / "dit", python=sys.executable,
+ runner=_TMP / "gen.py", compact_root=_TMP / "c", text_config=_TMP / "t")
+ ff = _TMP / "ffmpeg"
+ ff.write_text("")
+ with ExitStack() as st:
+ for name, val in {
+ "h3_paths": lambda: paths, "h3_lora_max_stack": lambda: 4,
+ "h3_dit_choice": lambda: ("bf16", None),
+ "output_codec_settings": lambda: {"crf": "18", "pix_fmt": "yuv420p"},
+ "FFMPEG": ff,
+ "_probe_video_frames": lambda path: 73,
+ "_probe_video_fps": lambda path: 24.0,
+ "probe_media_duration": lambda path: 10.0,
+ **(probes or {})}.items():
+ st.enter_context(unittest.mock.patch.object(P, name, val))
+ for name in ("h3_supports_memory_limits", "h3_supports_prompt_cache",
+ "h3_live_preview_ready", "h3_supports_stage_a", "h3_supports_tae_draft"):
+ st.enter_context(unittest.mock.patch.object(P, name, lambda: False))
+ st.enter_context(unittest.mock.patch.object(P.HELPER, "is_alive", lambda: False))
+ st.enter_context(unittest.mock.patch.object(P.subprocess, "Popen", popen))
+ with self.assertRaises(Intercept):
+ P.run_h3_job_inner(job)
+ return seen["cmd"], job["params"]
+
+ @staticmethod
+ def val(cmd, flag):
+ return cmd[cmd.index(flag) + 1]
+
+ @staticmethod
+ def vals(cmd, flag):
+ return [cmd[i + 1] for i, a in enumerate(cmd) if a == flag]
+
+
+class Probes(_Env):
+ def test_every_mode_has_its_flag(self):
+ for mode in ("keyframe", "extend", "a2v", "v2a"):
+ self.assertTrue(P.h3_mode_supported(mode), mode)
+ self.assertTrue(P.h3_mode_supported("t2v"))
+
+ def test_an_old_runner_serves_none_of_them(self):
+ with unittest.mock.patch.object(P, "_h3_runner_has_flag", lambda f: f == "--first-frame"):
+ for mode in ("keyframe", "extend", "a2v", "v2a"):
+ self.assertFalse(P.h3_mode_supported(mode), mode)
+ self.assertTrue(P.h3_mode_supported("i2v"))
+
+ def test_registry_and_status(self):
+ h3 = P.engine_by_id("h3")
+ for mode in ("keyframe", "extend", "a2v", "v2a"):
+ self.assertTrue(P.engine_serves_mode(h3, mode), mode)
+ # Add sound is H3's alone.
+ self.assertFalse(P.engine_serves_mode(P.engine_by_id("ltx"), "v2a"))
+ self.assertIn("v2a", P.QUEUEABLE_VIDEO_MODES)
+ st = P.h3_status()
+ for key in ("keyframes", "continuation", "extend", "audio_drive", "video_to_audio"):
+ self.assertIn(key, st)
+
+
+class MakeJobAllowlist(_Env):
+ def test_new_fields_survive_queue_add(self):
+ job = P.make_job({"engine": "h3", "mode": "t2v", "prompt": "x",
+ "h3_quality": "standard", "h3_length": "10s",
+ "h3_continuity": "off", "h3_extend_seconds": "7.5"})
+ self.assertFalse(job["params"]["h3_continuity"])
+ self.assertEqual(job["params"]["h3_extend_seconds"], 7.5)
+ job = P.make_job({"engine": "h3", "mode": "t2v", "prompt": "x"})
+ self.assertTrue(job["params"]["h3_continuity"])
+
+ def test_add_sound_always_means_h3(self):
+ job = P.make_job({"mode": "v2a", "prompt": "rain", "video_path": str(_media("c.mp4"))})
+ self.assertEqual(job["params"]["engine"], "h3")
+ self.assertEqual(job["params"]["mode"], "v2a")
+ self.assertIsNone(P.job_input_refusal(job["params"]))
+ self.assertIn("Add sound", P.job_input_refusal({"mode": "v2a", "video_path": ""}))
+
+ def test_lipsync_keeps_its_own_length(self):
+ job = P.make_job({"engine": "h3", "mode": "a2v", "prompt": "x", "frames": "200",
+ "audio": str(_media("v.wav")), "h3_quality": "high", "h3_length": "5s"})
+ self.assertEqual(job["params"]["engine"], "h3")
+ self.assertEqual(job["params"]["h3_a2v_frames"], 200)
+
+ def test_an_old_runner_renders_keyframes_on_ltx(self):
+ with unittest.mock.patch.object(P, "_h3_runner_has_flag", lambda f: f == "--first-frame"):
+ job = P.make_job({"engine": "h3", "mode": "keyframe", "prompt": "x"})
+ self.assertEqual(job["params"]["engine"], "ltx")
+ self.assertTrue(any("once its runner is updated" in m for m in self.logs))
+
+ def test_fast_hd_forces_its_recipe(self):
+ with unittest.mock.patch.object(P, "h3_tristep_status", lambda: {"available": True,
+ "supported": True,
+ "missing": []}), \
+ unittest.mock.patch.object(P, "face_fix_adapter_ready", lambda: True):
+ job = P.make_job({"engine": "h3", "mode": "t2v", "prompt": "x",
+ "h3_quality": "fast_hd", "h3_length": "5s",
+ "h3_tristep": "0", "h3_upscale": "fit_720p"})
+ p = job["params"]
+ self.assertEqual(p["h3_quality"], "fast_hd")
+ self.assertTrue(p["h3_tristep"])
+ self.assertEqual(p["h3_upscale"], "ltx_x2")
+ self.assertEqual((p["width"], p["height"]), (640, 384))
+
+
+class FastHdCells(unittest.TestCase):
+ def test_priced_whole_and_named_by_both_sizes(self):
+ c = P.H3_TIERS["fast_hd_5s"]
+ self.assertTrue(c["fast_hd"])
+ self.assertEqual((c["final_width"], c["final_height"]), (1280, 768))
+ self.assertAlmostEqual(c["eta_min"], c["tristep_min"] + c["facefix_min"], delta=0.01)
+ q = P.H3_QUALITIES["fast_hd"]
+ self.assertIn("→ 1280×768", q["spec"])
+
+ def test_gate_names_what_is_missing(self):
+ cell = P.H3_TIERS["fast_hd_5s"]
+ with unittest.mock.patch.object(P, "h3_available", lambda: True), \
+ unittest.mock.patch.object(P, "h3_tristep_status", lambda: {"available": False}):
+ ok, why = P.h3_cell_gate(cell)
+ self.assertFalse(ok)
+ self.assertIn("Fast", why)
+ with unittest.mock.patch.object(P, "h3_available", lambda: True), \
+ unittest.mock.patch.object(P, "h3_tristep_status", lambda: {"available": True}), \
+ unittest.mock.patch.object(P, "face_fix_adapter_ready", lambda: False):
+ ok, why = P.h3_cell_gate(cell)
+ self.assertFalse(ok)
+ self.assertIn("Upscaler", why)
+
+ def test_the_chained_fix_runs_the_faithful_depth(self):
+ queued = []
+ job = {"id": "fh-1"}
+ p = {"h3_quality": "fast_hd", "prompt": "x", "seed_used": 3, "label": "shot"}
+ clip = _media("fh.mp4")
+ with unittest.mock.patch.object(P, "make_job", lambda form: queued.append(form) or
+ {"id": "n", "params": {}}), \
+ unittest.mock.patch.object(P, "persist_queue", lambda: None), \
+ unittest.mock.patch.object(P, "_probe_video_frames", lambda path: 124), \
+ unittest.mock.patch.object(P, "push", lambda m: None):
+ P._chain_upscale_after_h3(job, p, clip)
+ self.assertEqual(queued[0]["upscale_steps"], str(P.FAST_HD_FACEFIX_STEPS))
+ self.assertEqual(queued[0]["upscale_start"], "source")
+
+
+class ChainContinuity(_Env):
+ def test_chained_windows_carry_context_by_default(self):
+ cmd, p = self.dispatch({"h3_tier": "standard_10s"})
+ self.assertEqual(self.val(cmd, "--chain-context-frames"), "17")
+ self.assertEqual(self.val(cmd, "--seam-colour-frames"), "24")
+ self.assertEqual(p["h3_context_frames"], 17)
+
+ def test_off_keeps_the_old_hand_over(self):
+ cmd, _ = self.dispatch({"h3_tier": "standard_10s", "h3_continuity": False})
+ self.assertNotIn("--chain-context-frames", cmd)
+ self.assertNotIn("--seam-colour-frames", cmd)
+
+ def test_single_window_and_old_runner_send_nothing(self):
+ cmd, _ = self.dispatch({"h3_tier": "standard_5s"})
+ self.assertNotIn("--chain-context-frames", cmd)
+ with unittest.mock.patch.object(P, "_h3_runner_has_flag",
+ lambda f: f in ("--chain-windows",)):
+ cmd, _ = self.dispatch({"h3_tier": "standard_10s"})
+ self.assertNotIn("--chain-context-frames", cmd)
+
+
+class Keyframes(_Env):
+ def test_start_and_end(self):
+ a, b = _png("a.png"), _png("b.png", (800, 800))
+ cmd, _ = self.dispatch({"mode": "keyframe", "h3_tier": "high_5s",
+ "start_image": str(a), "end_image": str(b)})
+ self.assertIn("--first-frame", cmd)
+ last = Path(self.val(cmd, "--last-frame"))
+ from PIL import Image
+ self.assertEqual(Image.open(last).size, (1024, 576)) # pre-fitted, never stretched
+ self.assertIn("end_frame", last.name)
+
+ def test_end_only_is_the_official_last_frame_task(self):
+ b = _png("b2.png")
+ cmd, _ = self.dispatch({"mode": "keyframe", "h3_tier": "high_5s", "end_image": str(b)})
+ self.assertNotIn("--first-frame", cmd)
+ self.assertIn("--last-frame", cmd)
+
+ def test_beats_land_on_their_frames(self):
+ imgs = [_png(f"k{i}.png") for i in range(4)]
+ kfs = [{"image_path": str(imgs[0]), "frame_index": 0},
+ {"image_path": str(imgs[1]), "frame_index": 60},
+ {"image_path": str(imgs[2]), "frame_index": 400}, # clamped inside
+ {"image_path": str(imgs[3]), "frame_index": 120}]
+ cmd, _ = self.dispatch({"mode": "keyframe", "h3_tier": "standard_10s",
+ "keyframes_json": json.dumps(kfs)})
+ beats = self.vals(cmd, "--keyframe")
+ self.assertEqual([b.rsplit("@", 1)[1] for b in beats], ["60", "241"])
+ self.assertIn("--last-frame", cmd)
+
+ def test_no_end_frame_is_refused_before_the_gpu(self):
+ with self.assertRaises(RuntimeError) as cm:
+ self.dispatch({"mode": "keyframe", "h3_tier": "high_5s",
+ "start_image": str(_png("s.png"))})
+ self.assertIn("end frame", str(cm.exception))
+
+ def test_old_runner_says_update(self):
+ with unittest.mock.patch.object(P, "_h3_runner_has_flag", lambda f: f == "--first-frame"):
+ with self.assertRaises(RuntimeError) as cm:
+ self.dispatch({"mode": "keyframe", "end_image": str(_png("e.png"))})
+ self.assertIn(P.H3_RUNNER_BEHIND, str(cm.exception))
+
+
+class Extend(_Env):
+ def test_seconds_become_windows_and_exact_frames(self):
+ src = _media("src.mp4")
+ cmd, p = self.dispatch({"mode": "extend", "h3_tier": "high_5s",
+ "video_path": str(src), "h3_extend_seconds": 7.5})
+ self.assertEqual(self.val(cmd, "--extend-from"), str(src))
+ self.assertEqual(self.val(cmd, "--extend-frames"), "180")
+ self.assertEqual(self.val(cmd, "--chain-windows"), "2")
+ self.assertEqual(self.val(cmd, "--chain-context-frames"), "17")
+ self.assertNotIn("--chain-total-frames", cmd)
+ self.assertEqual(self.val(cmd, "--frames"), "124")
+ self.assertEqual(p["frames"], 73 + 180)
+
+ def test_capped_at_fifteen_seconds(self):
+ cmd, _ = self.dispatch({"mode": "extend", "video_path": str(_media("s2.mp4")),
+ "h3_extend_seconds": 99})
+ self.assertEqual(self.val(cmd, "--extend-frames"), "360")
+
+ def test_an_over_long_source_is_refused_before_the_gpu(self):
+ # The runner holds the whole decoded source through the render.
+ with self.assertRaises(RuntimeError) as ctx:
+ self.dispatch({"mode": "extend", "video_path": str(_media("long.mp4"))},
+ probes={"probe_media_duration": lambda path: 61.0})
+ self.assertIn("60s", str(ctx.exception))
+
+
+class LipSync(_Env):
+ def test_track_held_and_contract_added_once(self):
+ voice = _media("voice.wav")
+ face = _png("face.png")
+ cmd, p = self.dispatch({"mode": "a2v", "h3_tier": "high_5s", "audio": str(voice),
+ "image": str(face), "h3_a2v_frames": 240,
+ "audio_start_time": 1.5,
+ "prompt": "integrated_multimodal_description: [Shot 1] a man talks.\n\n"
+ "overall_soundscape: his voice.\n\nnon_diegetic_music: N/A"})
+ self.assertEqual(self.val(cmd, "--audio-drive"), str(voice))
+ self.assertEqual(self.val(cmd, "--audio-drive-offset"), "1.500")
+ self.assertNotIn("--audio-mux", cmd)
+ self.assertEqual(self.val(cmd, "--chain-windows"), "2")
+ self.assertEqual(self.val(cmd, "--chain-total-frames"), "204") # 8.5 s left after 1.5 s
+ self.assertIn("--first-frame", cmd)
+ prompt = next(a for a in cmd if a.startswith("integrated_multimodal_description"))
+ self.assertEqual(prompt.count("lip-syncs every syllable"), 1)
+ self.assertLess(prompt.index("lip-syncs"), prompt.index("overall_soundscape"))
+
+ def test_voice_only_conditions_on_the_stem_and_delivers_the_mix(self):
+ song = _media("song.wav")
+ stem = _media("vocals.wav")
+ with unittest.mock.patch.object(P, "a2v_conditioning_audio",
+ lambda p, a: (str(stem), "the model listens to the separated vocal")):
+ cmd, _ = self.dispatch({"mode": "a2v", "audio": str(song), "h3_a2v_frames": 72,
+ "audio_stem_auto": "on"})
+ self.assertEqual(self.val(cmd, "--audio-drive"), str(stem))
+ self.assertEqual(self.val(cmd, "--audio-mux"), str(song))
+ self.assertEqual(self.val(cmd, "--frames"), "73") # one short window
+ self.assertNotIn("--chain-windows", cmd)
+
+ def test_a_short_line_is_not_padded_with_silence(self):
+ # 0.5 s of voice: one smallest window renders, delivery is trimmed to the line.
+ cmd, p = self.dispatch({"mode": "a2v", "audio": str(_media("short.wav")),
+ "h3_a2v_frames": 120},
+ probes={"probe_media_duration": lambda path: 0.5})
+ self.assertEqual(self.val(cmd, "--frames"), "22")
+ self.assertEqual(self.val(cmd, "--chain-total-frames"), "12")
+ self.assertEqual(p["frames"], 12)
+
+ def test_start_past_the_end_is_refused(self):
+ with self.assertRaises(RuntimeError):
+ self.dispatch({"mode": "a2v", "audio": str(_media("v2.wav")), "audio_start_time": 12})
+
+
+class AddSound(_Env):
+ def test_picture_held_windows_from_the_clip(self):
+ clip = _media("silent.mp4")
+ cmd, p = self.dispatch({"mode": "v2a", "h3_tier": "standard_5s",
+ "video_path": str(clip), "prompt": "rain on a tin roof"},
+ probes={"probe_media_duration": lambda path: 7.0})
+ self.assertEqual(self.val(cmd, "--video-to-audio"), str(clip))
+ self.assertNotIn("--chain-windows", cmd)
+ self.assertNotIn("--chain-total-frames", cmd)
+ self.assertEqual(self.val(cmd, "--chain-context-frames"), "17")
+ self.assertEqual(p["frames"], 168)
+
+ def test_too_long_is_refused(self):
+ with self.assertRaises(RuntimeError) as cm:
+ self.dispatch({"mode": "v2a", "video_path": str(_media("long.mp4"))},
+ probes={"probe_media_duration": lambda path: 600.0})
+ self.assertIn("Cut it shorter", str(cm.exception))
+
+
+class AddSoundDelivery(_Env):
+ """A whole Add-sound job through run_h3_job_inner with a fake runner that
+ exits 0: no export re-encode, no Face Fix chained, the source's own size
+ in the sidecar."""
+
+ def test_no_export_or_face_fix_on_the_users_picture(self):
+ clip = _media("scored.mp4")
+ calls = {"plan": [], "chain": [], "sidecar": None}
+
+ class FakeProc:
+ def __init__(self, cmd, **kw):
+ out = Path(cmd[cmd.index("-o") + 1])
+ out.write_bytes(b"\0" * 128)
+ r, w = os.pipe()
+ os.close(w)
+ self.stdout = os.fdopen(r, "r")
+ self.pid = os.getpid()
+ self.returncode = 0
+
+ def wait(self, timeout=None):
+ return 0
+
+ def poll(self):
+ return 0
+
+ job = {"id": "v2a-1", "params": {
+ "engine": "h3", "mode": "v2a", "prompt": "rain", "seed": "7",
+ "h3_tier": "draft_5s", "h3_turbo": False, "h3_tristep": False, "steps": 9,
+ "video_path": str(clip), "h3_upscale": "ltx_x2"}}
+ paths = dict(missing=[], repairable=False, dit=_TMP / "dit", python=sys.executable,
+ runner=_TMP / "gen.py", compact_root=_TMP / "c", text_config=_TMP / "t")
+ ff = _TMP / "ffmpeg"
+ ff.write_text("")
+ with ExitStack() as st:
+ for name, val in {
+ "h3_paths": lambda: paths, "h3_lora_max_stack": lambda: 4,
+ "h3_dit_choice": lambda: ("bf16", None),
+ "output_codec_settings": lambda: {"crf": "18", "pix_fmt": "yuv420p"},
+ "FFMPEG": ff, "probe_media_duration": lambda path: 4.0,
+ "_probe_video_dims": lambda path: (1024, 576),
+ "_h3_clip_is_blank": lambda path: False,
+ "_register_job_pgid": lambda *a, **k: None,
+ "_proc_guard_write": lambda *a, **k: None,
+ "_proc_guard_clear": lambda *a, **k: None,
+ "compute_upscale_plan": lambda w, h, m: calls["plan"].append((w, h, m)),
+ "_chain_upscale_after_h3": lambda *a: calls["chain"].append(a),
+ "write_sidecar": lambda path, sc: calls.__setitem__("sidecar", sc)}.items():
+ st.enter_context(unittest.mock.patch.object(P, name, val))
+ for name in ("h3_supports_memory_limits", "h3_supports_prompt_cache",
+ "h3_live_preview_ready", "h3_supports_stage_a", "h3_supports_tae_draft"):
+ st.enter_context(unittest.mock.patch.object(P, name, lambda: False))
+ st.enter_context(unittest.mock.patch.object(P.HELPER, "is_alive", lambda: False))
+ st.enter_context(unittest.mock.patch.object(P.subprocess, "Popen", FakeProc))
+ st.enter_context(unittest.mock.patch.object(P.os, "getpgid", lambda pid: pid))
+ P.run_h3_job_inner(job)
+ self.assertEqual([m for _, _, m in calls["plan"]], ["off"])
+ self.assertEqual(calls["chain"], [])
+ sp = calls["sidecar"]["params"]
+ self.assertEqual((sp["width"], sp["height"]), (1024, 576))
+ self.assertEqual(sp["h3_upscale"], "off")
+ self.assertEqual(sp["mode"], "v2a")
+ self.assertEqual(sp["frames"], 96)
+
+
+class A2vPrompt(unittest.TestCase):
+ def test_plain_prompt(self):
+ self.assertTrue(P.h3_a2v_prompt("a man talks").endswith(P.H3_A2V_CONTRACT))
+ self.assertEqual(P.h3_a2v_prompt("he lip-syncs it"), "he lip-syncs it")
+
+
+class Windows(unittest.TestCase):
+ def test_window_math(self):
+ self.assertEqual(P.h3_windows_for(124), 1)
+ self.assertEqual(P.h3_windows_for(125), 2)
+ self.assertEqual(P.h3_windows_for(247), 2)
+ self.assertEqual(P.h3_windows_for(248), 3)
+ self.assertEqual(P.h3_window_for_short(72), 73)
+ self.assertEqual(P.h3_window_for_short(10), 22)
+
+
+if __name__ == "__main__":
+ unittest.main()
+
+
+# ---------------------------------------------------------------------------
+# The browser half, executed in node against stubs (scripts/extract_panel_js).
+import shutil as _shutil # noqa: E402
+import subprocess as _sp # noqa: E402
+
+sys.path.insert(0, str(ROOT / "scripts"))
+from extract_panel_js import extract_function # noqa: E402
+
+_NODE = _shutil.which("node")
+_JS = {n: (ROOT / "webapp" / "js" / f"{n}.js").read_text(encoding="utf-8")
+ for n in ("queue", "engines", "characters")}
+
+
+def _node(names: tuple, calls: list[str], prelude: str, src: str) -> list:
+ if _NODE is None:
+ raise unittest.SkipTest("node not on PATH")
+ fn = "\n".join(extract_function(n, src) for n in names)
+ script = prelude + "\n" + fn + "\nconsole.log(JSON.stringify([\n " + ",\n ".join(calls) + "\n]));"
+ with tempfile.NamedTemporaryFile("w", suffix=".js", delete=False) as fh:
+ fh.write(script)
+ path = fh.name
+ try:
+ r = _sp.run([_NODE, path], capture_output=True, text=True, errors="replace", timeout=60)
+ finally:
+ Path(path).unlink(missing_ok=True)
+ if r.returncode != 0:
+ raise AssertionError(r.stderr[-2000:])
+ return json.loads(r.stdout.strip().splitlines()[-1])
+
+
+class UseThisAudioForH3(unittest.TestCase):
+ def test_h3_lipsync_target_only_when_the_runner_can(self):
+ out = _node(("audioUseTargets",), [
+ "audioUseTargets({}, {h3: {available: true, audio_drive: true}}).map(t => t.id)",
+ "audioUseTargets({}, {h3: {available: true, audio_drive: false}}).map(t => t.id)",
+ "audioUseTargets({}, {}).map(t => t.id)",
+ ], "", _JS["queue"])
+ self.assertEqual(out[0], ["lipsync", "lipsync_h3", "musicvideo", "soundtrack", "cover"])
+ self.assertNotIn("lipsync_h3", out[1])
+ self.assertNotIn("lipsync_h3", out[2])
+
+ def test_choosing_it_sets_the_form_engine(self):
+ pre = r"""
+const calls = [];
+globalThis.document = { getElementById: () => null, removeEventListener(){} };
+globalThis.window = { _ENGINE_PROBES: {} };
+function findOutputByPath(p) { return { path: p, clip_sec: 4, url: 'u' }; }
+function closeAudioUseMenu() {}
+function phosToast() {}
+function setA2vEngine(e) { calls.push(['engine', e]); }
+function audioStudioUseAudio(p) { calls.push(['lipsync', p]); }
+"""
+ out = _node(("audioUseApply",), [
+ "(() => { audioUseApply('/o/v.wav', 'lipsync_h3'); audioUseApply('/o/v.wav', 'lipsync'); return calls; })()",
+ ], pre, _JS["queue"])
+ self.assertEqual(out[0], [["engine", "h3"], ["lipsync", "/o/v.wav"],
+ ["engine", "ltx"], ["lipsync", "/o/v.wav"]])
+
+
+class H3ModeGatesInTheBrowser(unittest.TestCase):
+ PRE = r"""
+globalThis.H3_MODE_CAP = { keyframe: 'keyframes', extend: 'extend', a2v: 'audio_drive', v2a: 'video_to_audio' };
+globalThis.window = { _ENGINE_PROBES: { h3: { available: true, keyframes: true, extend: false,
+ audio_drive: true, video_to_audio: true } } };
+"""
+
+ def test_can_serve_follows_the_probes(self):
+ out = _node(("h3CanServe",), [
+ "['t2v','keyframe','extend','a2v','v2a'].map(h3CanServe)",
+ "(() => { window._ENGINE_PROBES.h3.available = false; return h3CanServe('t2v'); })()",
+ ], self.PRE, _JS["engines"])
+ self.assertEqual(out[0], [True, True, False, True, True])
+ self.assertFalse(out[1])
+
+
+class FooterEstimates(unittest.TestCase):
+ PRE = r"""
+const els = { extend_seconds: { value: '7.5' } };
+globalThis.document = { getElementById: id => els[id] || null };
+const CELLS = {
+ 'draft_5s': { key: 'draft_5s', quality: 'draft', quality_label: 'Draft', tristep_min: 3, facefix_min: 2.5 },
+ 'fast_hd_5s': { key: 'fast_hd_5s', quality: 'fast_hd', quality_label: 'Fast HD', fast_hd: true,
+ width: 640, height: 384, final_width: 1280, final_height: 768,
+ tristep_min: 3, facefix_min: 5.5 },
+};
+let CUR = 'draft_5s';
+var currentMode = 't2v';
+function h3CurrentCell() { return CELLS[CUR]; }
+function h3CellFor(q, l) { return CELLS[q + '_' + l]; }
+function h3TriStepOn(c) { return true; }
+function _h3TriStepMin(c) { return c.tristep_min; }
+function h3FaceFixOn() { return false; }
+function h3FmtEtaMin(m) { return '~' + Math.max(1, Math.round(m)) + ' min'; }
+"""
+
+ def test_extend_add_sound_and_fast_hd_lines(self):
+ out = _node(("h3CellEtaMin", "h3EstimateLine"), [
+ "(() => { currentMode = 'extend'; return h3EstimateLine(); })()",
+ "(() => { currentMode = 'v2a'; return h3EstimateLine(); })()",
+ "(() => { currentMode = 't2v'; CUR = 'fast_hd_5s'; return h3EstimateLine(); })()",
+ "h3CellEtaMin(CELLS['fast_hd_5s'])",
+ "(() => { currentMode = 'v2a'; CUR = 'fast_hd_5s'; return h3EstimateLine(); })()",
+ ], self.PRE, _JS["engines"])
+ self.assertEqual(out[4], "Add sound · picture kept · ≈ 3 min per 5 s of clip")
+ self.assertEqual(out[0], "Extend +7.5 s · Draft · 2 windows ≈ 6 min")
+ self.assertEqual(out[1], "Add sound · picture kept · ≈ 3 min per 5 s of clip")
+ self.assertEqual(out[2], "Fast HD · 640×384 → 1280×768 ≈ 9 min")
+ self.assertAlmostEqual(out[3], 8.5)
+
+
+class LipSyncLoadParamsRoundTrip(unittest.TestCase):
+ """An H3 lip-sync sidecar reopens the Lip-sync form on H3, at its canvas and length."""
+ PRE = r"""
+const calls = [];
+const els = {};
+const mk = id => (els[id] = els[id] || { id, value: '', checked: false, dataset: {}, classList: { add(){}, remove(){} },
+ scrollIntoView(){} });
+globalThis.document = { getElementById: mk };
+globalThis.localStorage = { setItem(){}, getItem(){ return null; } };
+globalThis.setTimeout = () => 0;
+globalThis.AUDIO_STUDIO = {};
+var A2V_H3_QUALITY = 'high';
+const A2V_H3_QUALITY_KEY = 'k';
+function audioModeSet() {}
+function workflowSwitch() {}
+function audioStudioRenderSlots() {}
+function audioStudioDurationChanged(v) { calls.push(['dur', v]); }
+function audioConditioningScaleReset() {}
+function audioConditioningScaleChanged() {}
+function audioStudioRenderLoraNote() {}
+function setA2vEngine(e) { calls.push(['engine', e]); }
+"""
+
+ def test_round_trip(self):
+ out = _node(("a2vLoadParams",), [
+ "(() => { a2vLoadParams({mode:'a2v', engine:'h3', h3_quality:'standard', h3_a2v_frames:240,"
+ " frames:124, audio:'/a.wav', prompt:'p'}); return [calls.slice(), A2V_H3_QUALITY]; })()",
+ "(() => { calls.length = 0; a2vLoadParams({mode:'a2v', engine:'ltx', frames:121, audio:'/a.wav'});"
+ " return calls; })()",
+ ], self.PRE, _JS["characters"])
+ calls, quality = out[0]
+ self.assertEqual(quality, "standard")
+ self.assertIn(["engine", "h3"], calls)
+ self.assertEqual(calls[-1], ["dur", "10"])
+ self.assertIn(["engine", "ltx"], out[1])
diff --git a/test_h3_disk_preflight.py b/test_h3_disk_preflight.py
index fbbd5af..b9b3612 100644
--- a/test_h3_disk_preflight.py
+++ b/test_h3_disk_preflight.py
@@ -54,6 +54,12 @@ def _fakebin(tmp: Path, *, avail_kb: int, mem_bytes: str = PLENTY_MEM) -> Path:
def _run(cwd: Path, fakebin: Path) -> subprocess.CompletedProcess:
env = dict(os.environ)
env["PATH"] = f"{fakebin}:{env.get('PATH', '')}"
+ # The script resolves the H3 tree from LTX_H3_ROOT / LTX_H3_MODELS when
+ # set (h3_roots.sh). These cases lay their fake tree out under `cwd`, so
+ # an operator's own override must not point the script somewhere else
+ # (issue #90: the weights-present case failed with LTX_H3_MODELS set).
+ for var in ("LTX_H3_ROOT", "LTX_H3_MODELS", "LTX_H3_COMPACT_DIR"):
+ env.pop(var, None)
return subprocess.run(["bash", str(SCRIPT)], cwd=str(cwd), env=env,
capture_output=True, text=True, timeout=15)
diff --git a/test_h3_dit_setting.py b/test_h3_dit_setting.py
index 430a956..4a48c00 100644
--- a/test_h3_dit_setting.py
+++ b/test_h3_dit_setting.py
@@ -39,6 +39,22 @@ for _m in sorted((ROOT / "webapp" / "js").glob("*.js")):
SRC += "\n" + _m.read_text(encoding="utf-8")
+class _pinned_mac:
+ """This Mac's RAM and whether its H3 Q8 pack is built, pinned for a block."""
+
+ def __init__(self, ram_gb: float, q8_dir: Path | None):
+ self.ram_gb, self.q8_dir = ram_gb, q8_dir
+
+ def __enter__(self):
+ self.saved = (P.SYSTEM_RAM_GB, P._h3_q8_dit_dir)
+ P.SYSTEM_RAM_GB = self.ram_gb
+ P._h3_q8_dit_dir = lambda: self.q8_dir
+ return self
+
+ def __exit__(self, *exc):
+ P.SYSTEM_RAM_GB, P._h3_q8_dit_dir = self.saved
+
+
class TheSettingRoundTrips(unittest.TestCase):
def test_the_ui_can_read_the_current_value(self):
@@ -57,9 +73,14 @@ class TheSettingRoundTrips(unittest.TestCase):
self.assertIn(v, err)
def test_the_choice_actually_reaches_the_dit_picker(self):
+ # Pinned to a Mac where a bf16 preference is honoured AND auto would
+ # have chosen otherwise (issue #90): on a 48 GB Mac with the Q8 pack
+ # built, bf16 resolves to q8 by design (BelowTheFullEngineFloor), so
+ # reading the live RAM and the live pack made this pass or fail by
+ # whose Mac ran it.
P.update_settings({"h3_dit": "bf16"})
- kind, _ = P.h3_dit_choice()
- self.assertEqual(kind, "bf16")
+ with _pinned_mac(ram_gb=128.0, q8_dir=Path("/tmp/pretend-q8")):
+ self.assertEqual(P.h3_dit_choice()[0], "bf16")
class AutoPrefersTheLightModel(unittest.TestCase):
@@ -68,8 +89,19 @@ class AutoPrefersTheLightModel(unittest.TestCase):
Before that, `auto` gave any Mac with 60 GB+ the bf16 master, so the machine
with the most memory was the one that spent the most: 38.89 GiB peak versus
21.38 GiB for the same shot at the same seed.
+
+ Run as a Mac above the bf16 floor (issue #90): below it, a forced bf16 with
+ the pack present resolves to q8 by design — BelowTheFullEngineFloor owns
+ that case — so the live RAM must not decide this class's answers.
"""
+ def setUp(self):
+ self._ram = P.SYSTEM_RAM_GB
+ P.SYSTEM_RAM_GB = 128.0
+
+ def tearDown(self):
+ P.SYSTEM_RAM_GB = self._ram
+
def test_auto_picks_q8_whenever_the_pack_is_present(self):
P.update_settings({"h3_dit": "auto"})
real = P._h3_q8_dit_dir
diff --git a/test_h3_engine_pin.py b/test_h3_engine_pin.py
new file mode 100644
index 0000000..17c08ea
--- /dev/null
+++ b/test_h3_engine_pin.py
@@ -0,0 +1,121 @@
+"""The H3 engine is pinned to a COMMIT, not a branch tip (4.19.0).
+
+Through 4.18.x `scripts/pinokio/h3_checkout.sh` checked out whatever
+`codex/h3-engine-v2` pointed at, so pushing the engine repo changed every
+installed Phosphene's H3 at its next Update with no release behind it. These
+pin the new contract with a real git: a throwaway "engine remote" whose
+branch tip has moved PAST the pin, and the real script (pin rewritten to point
+at it) must land on the pinned commit, verify it, survive a dirty tree, and
+leave a checkout alone when the pin cannot be fetched.
+"""
+from __future__ import annotations
+
+import re
+import shutil
+import subprocess
+import tempfile
+import unittest
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent
+SCRIPT = ROOT / "scripts/pinokio/h3_checkout.sh"
+
+
+def _git(cwd: Path, *args: str) -> str:
+ return subprocess.run(["git", *args], cwd=cwd, check=True, capture_output=True,
+ text=True, errors="replace",
+ env={"GIT_AUTHOR_NAME": "t", "GIT_AUTHOR_EMAIL": "t@t",
+ "GIT_COMMITTER_NAME": "t", "GIT_COMMITTER_EMAIL": "t@t",
+ "HOME": str(cwd), "PATH": "/usr/bin:/bin"}).stdout.strip()
+
+
+class PinShape(unittest.TestCase):
+ def test_the_pin_is_a_full_sha_and_a_ref(self):
+ text = SCRIPT.read_text()
+ sha = re.search(r'^H3_PIN_SHA="([^"]*)"', text, re.M)
+ ref = re.search(r'^H3_PIN_REF="([^"]*)"', text, re.M)
+ self.assertTrue(sha and re.fullmatch(r"[0-9a-f]{40}", sha.group(1)), "pin must be a 40-hex commit")
+ self.assertTrue(ref and ref.group(1) and ref.group(1) != "codex/h3-engine-v2",
+ "the pin ref must not be the branch 4.18.x installs track")
+ # The old branch-tip checkout must be gone, not merely unused.
+ self.assertNotIn("FETCH_HEAD", text)
+
+ def test_install_and_update_both_call_the_one_pin(self):
+ self.assertIn("scripts/pinokio/h3_checkout.sh", (ROOT / "install_h3.js").read_text())
+ self.assertIn("scripts/pinokio/h3_checkout.sh", (ROOT / "scripts/post_update.sh").read_text())
+ for f in ("install_h3.js", "scripts/post_update.sh"):
+ self.assertNotIn("H3_PIN_SHA", (ROOT / f).read_text(), f"{f} must not carry a second pin")
+
+
[email protected](shutil.which("git"), "git not on PATH")
+class PinBehaviour(unittest.TestCase):
+ def setUp(self):
+ self.tmp = tempfile.TemporaryDirectory()
+ base = Path(self.tmp.name).resolve()
+ # An engine "remote": c1 (old tip) -> c2 (the pin) -> c3 (tip moved on).
+ src = base / "engine-src"
+ src.mkdir()
+ _git(src, "init", "-q", "-b", "codex/h3-engine-v2")
+ (src / "minimax_h3_mlx").mkdir()
+ (src / "scripts").mkdir()
+ (src / "scripts/quantize_stream.py").write_text("")
+ for n in ("c1", "c2", "c3"):
+ (src / "minimax_h3_mlx" / "VERSION").write_text(n)
+ _git(src, "add", "-A")
+ _git(src, "commit", "-q", "-m", n)
+ if n == "c2":
+ self.pin = _git(src, "rev-parse", "HEAD")
+ _git(src, "branch", "phosphene/test-pin")
+ self.remote = base / "engine.git"
+ _git(base, "clone", "-q", "--bare", str(src), str(self.remote))
+ # The user's checkout: cloned when the tip was c1 (4.18.x behaviour).
+ self.checkout = base / "minimax-h3-mlx"
+ _git(base, "clone", "-q", str(self.remote), str(self.checkout))
+ _git(self.checkout, "reset", "-q", "--hard", "HEAD~2")
+ # The real script, pin pointed at this remote's c2.
+ text = SCRIPT.read_text()
+ text = re.sub(r'^H3_PIN_SHA=".*"$', f'H3_PIN_SHA="{self.pin}"', text, flags=re.M)
+ text = re.sub(r'^H3_PIN_REF=".*"$', 'H3_PIN_REF="phosphene/test-pin"', text, flags=re.M)
+ self.script = base / "h3_checkout.sh"
+ self.script.write_text(text)
+
+ def tearDown(self):
+ self.tmp.cleanup()
+
+ def _run(self) -> subprocess.CompletedProcess:
+ return subprocess.run(["bash", str(self.script), str(self.checkout)],
+ capture_output=True, text=True, errors="replace",
+ env={"PATH": "/usr/bin:/bin", "HOME": str(self.checkout)})
+
+ def test_lands_on_the_pin_not_the_moved_tip(self):
+ r = self._run()
+ self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
+ self.assertEqual(_git(self.checkout, "rev-parse", "HEAD"), self.pin)
+ self.assertEqual((self.checkout / "minimax_h3_mlx/VERSION").read_text(), "c2")
+ self.assertIn("pinned", r.stdout)
+
+ def test_a_dirty_tree_does_not_block_the_move(self):
+ (self.checkout / "minimax_h3_mlx/VERSION").write_text("local edit")
+ r = self._run()
+ self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
+ self.assertEqual(_git(self.checkout, "rev-parse", "HEAD"), self.pin)
+
+ def test_the_pin_reaches_a_checkout_whose_ref_is_gone_by_sha(self):
+ # Ref renamed upstream, commit still reachable from another branch.
+ _git(self.remote, "branch", "-m", "phosphene/test-pin", "renamed")
+ r = self._run()
+ self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
+ self.assertEqual(_git(self.checkout, "rev-parse", "HEAD"), self.pin)
+
+ def test_an_unfetchable_pin_leaves_the_checkout_alone(self):
+ before = _git(self.checkout, "rev-parse", "HEAD")
+ text = self.script.read_text().replace(self.pin, "f" * 40)
+ self.script.write_text(text)
+ r = self._run()
+ self.assertNotEqual(r.returncode, 0)
+ self.assertIn("left as is", r.stdout)
+ self.assertEqual(_git(self.checkout, "rev-parse", "HEAD"), before)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_h3_engine_resolve_runner.py b/test_h3_engine_resolve_runner.py
new file mode 100644
index 0000000..4e2b813
--- /dev/null
+++ b/test_h3_engine_resolve_runner.py
@@ -0,0 +1,35 @@
+"""The enqueue seam agrees with make_job about an older H3 runner (Codex 4.19.0).
+
+make_job renders Keyframes / Extend / Lip-sync on LTX when the INSTALLED H3
+runner predates the mode. `_engine_would_be_h3` (used by the character check at
+/queue/add) did not know that, so a character job the panel would have rendered
+on LTX was refused with "H3 cannot load the character".
+"""
+from __future__ import annotations
+
+import unittest
+from unittest import mock
+
+import mlx_ltx_panel as P
+
+
+class OlderRunner(unittest.TestCase):
+ def _would(self, mode, supported):
+ with mock.patch.object(P, "h3_capable", lambda *a, **k: True), \
+ mock.patch.object(P, "h3_available", lambda *a, **k: True), \
+ mock.patch.object(P, "h3_mode_supported",
+ lambda m: supported if m in P.H3_MODE_CAPABILITY else True):
+ return P._engine_would_be_h3("h3", mode)
+
+ def test_modes_the_runner_lacks_resolve_to_ltx(self):
+ for mode in ("keyframe", "extend", "a2v"):
+ self.assertFalse(self._would(mode, False), mode)
+ self.assertTrue(self._would(mode, True), mode)
+
+ def test_add_sound_and_plain_modes_stay_h3(self):
+ self.assertTrue(self._would("v2a", False))
+ self.assertTrue(self._would("t2v", False))
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_h3_high_steps.py b/test_h3_high_steps.py
index e6fc207..18a6ba0 100644
--- a/test_h3_high_steps.py
+++ b/test_h3_high_steps.py
@@ -14,6 +14,7 @@ import sys
import tempfile
import unittest
from pathlib import Path
+from unittest import mock
ROOT = Path(__file__).resolve().parent
STATE = Path(tempfile.mkdtemp(prefix="phos-h3-high-steps-"))
@@ -29,10 +30,29 @@ import storyboard as SB # noqa: E402
def h3_job(form: dict) -> dict:
+ """Build an H3 job as an install WITHOUT the TriStep (Fast) adapter.
+
+ Issue #90: on an install that has the adapter, Auto on Draft/Standard/High
+ is Fast — 4 sigma points — by design (test_h3_tristep_draft owns that
+ lane), so reading the live install made "Auto High stamps 16" fail with
+ steps=4 on exactly the Macs that had installed it."""
base = {"mode": "t2v", "engine": "h3", "prompt": "a man lifts a dumbbell",
"h3_turbo": "0"}
base.update(form)
- return P.make_job({k: [v] for k, v in base.items()})
+ no_fast = {"available": False, "supported": True,
+ "missing": ["adapter (pinned absent by test_h3_high_steps)"]}
+ with mock.patch.object(P, "h3_tristep_status", lambda: no_fast):
+ return P.make_job({k: [v] for k, v in base.items()})
+
+
+def _tiers_at_m4_max() -> dict:
+ """H3_TIERS as the M4 Max baseline prices them (speed factor 1.0).
+
+ The module table is priced at import with THIS Mac's chip, RAM lane and
+ learned calibration, while the storyboard's fallback constant is an
+ M4 Max number. Comparing the two on an M4 Pro failed by 5x (issue #90)."""
+ with mock.patch.dict(os.environ, {"PHOSPHENE_SPEED_FACTOR": "1"}):
+ return P._build_h3_tiers()
class TestHighCellsRunFifteenForwards(unittest.TestCase):
@@ -89,7 +109,7 @@ class TestMeasuredEtaMatchesDepth(unittest.TestCase):
self.assertGreaterEqual(int(v[2]), 1)
def test_storyboard_fallback_tracks_the_model(self):
- per_sec = P.H3_TIERS["high_5s"]["eta_min"] * 60 / 5
+ per_sec = _tiers_at_m4_max()["high_5s"]["eta_min"] * 60 / 5
self.assertLess(abs(SB._H3_SECS_PER_VIDEO_SEC["high"] - per_sec),
0.1 * per_sec)
diff --git a/test_h3_lora_file_import.py b/test_h3_lora_file_import.py
index bbed90a..41dd0ad 100644
--- a/test_h3_lora_file_import.py
+++ b/test_h3_lora_file_import.py
@@ -90,13 +90,16 @@ def _prefixed_lora(prefix: str = "diffusion_model.",
def _kohya_header() -> bytes:
+ # Each tensor declares 4 bytes (one F32), so the payload must carry them:
+ # a header whose offsets are [0, 0] but whose dtype/shape need data is
+ # malformed, and mx.load rejects it on newer MLX builds.
header = {
- "lora_unet_blocks_24_attn_qkv_proj.lora_down.weight": {"dtype": "F32", "shape": [1, 1], "data_offsets": [0, 0]},
- "lora_unet_blocks_24_attn_qkv_proj.lora_up.weight": {"dtype": "F32", "shape": [1, 1], "data_offsets": [0, 0]},
- "lora_unet_blocks_24_attn_qkv_proj.alpha": {"dtype": "F32", "shape": [1, 1], "data_offsets": [0, 0]},
+ "lora_unet_blocks_24_attn_qkv_proj.lora_down.weight": {"dtype": "F32", "shape": [1, 1], "data_offsets": [0, 4]},
+ "lora_unet_blocks_24_attn_qkv_proj.lora_up.weight": {"dtype": "F32", "shape": [1, 1], "data_offsets": [4, 8]},
+ "lora_unet_blocks_24_attn_qkv_proj.alpha": {"dtype": "F32", "shape": [1, 1], "data_offsets": [8, 12]},
}
encoded = json.dumps(header).encode("utf-8")
- return len(encoded).to_bytes(8, "little") + encoded
+ return len(encoded).to_bytes(8, "little") + encoded + struct.pack("<fff", 1.0, 1.0, 1.0)
def _diffusers_header() -> bytes:
@@ -115,8 +118,16 @@ class TestH3LoraFileImport(unittest.TestCase):
self.dir = Path(self.tmp.name)
self.old_dir = P._safe_h3_loras_dir
P._safe_h3_loras_dir = lambda: self.dir
+ # As an install with no H3 DiT on disk (issue #90). With the weights
+ # installed, every import is also checked against the REAL DiT's
+ # module names, so these fixtures passed or failed by what was in
+ # mlx_models/hailuo-h3 (an unreadable DiT refused them all). The
+ # module check has its own cases, which pin the target set.
+ self.old_targets = P._h3_lora_target_modules
+ P._h3_lora_target_modules = lambda: None
def tearDown(self):
+ P._h3_lora_target_modules = self.old_targets
P._safe_h3_loras_dir = self.old_dir
self.tmp.cleanup()
diff --git a/test_h3_lora_import_http.py b/test_h3_lora_import_http.py
index 77138a6..a8cff7f 100644
--- a/test_h3_lora_import_http.py
+++ b/test_h3_lora_import_http.py
@@ -85,8 +85,16 @@ class TestH3LoraImportHTTP(unittest.TestCase):
self.dir = Path(self.tmp.name)
self.old_dir = P._safe_h3_loras_dir
P._safe_h3_loras_dir = lambda: self.dir
+ # As an install with no H3 DiT on disk (issue #90). With the weights
+ # installed, every import is also checked against the REAL DiT's
+ # module names, so these fixtures passed or failed by what was in
+ # mlx_models/hailuo-h3 (an unreadable DiT refused them all). The
+ # module check has its own cases, which pin the target set.
+ self.old_targets = P._h3_lora_target_modules
+ P._h3_lora_target_modules = lambda: None
def tearDown(self):
+ P._h3_lora_target_modules = self.old_targets
P._safe_h3_loras_dir = self.old_dir
self.tmp.cleanup()
diff --git a/test_h3_lora_strength_migration.py b/test_h3_lora_strength_migration.py
index 47a429a..9b17824 100644
--- a/test_h3_lora_strength_migration.py
+++ b/test_h3_lora_strength_migration.py
@@ -75,6 +75,15 @@ class _LoraDir(unittest.TestCase):
self.st.enter_context(unittest.mock.patch.object(P, "_h3_loras_dir", lambda: self.dir))
self.logs = []
self.st.enter_context(unittest.mock.patch.object(P, "push", self.logs.append))
+ # As an install WITHOUT the TriStep (Fast) adapter (issue #90). With it
+ # installed, make_job turns Fast on by default for Draft/Standard/High,
+ # and the dispatch below then refuses the test's own runner for having
+ # no --sigma-subset: these cases failed on exactly the Macs that had
+ # installed Fast. The strength contract under test is the Best lane's.
+ self.st.enter_context(unittest.mock.patch.object(
+ P, "h3_tristep_status",
+ lambda: {"available": False, "supported": True,
+ "missing": ["adapter (pinned absent by this suite)"]}))
P._H3_LORA_LAYOUT_CACHE.clear()
def tearDown(self):
diff --git a/test_h3_lowram_estimate.py b/test_h3_lowram_estimate.py
index 584038c..684fa8d 100644
--- a/test_h3_lowram_estimate.py
+++ b/test_h3_lowram_estimate.py
@@ -24,6 +24,7 @@ import os
import sys
import tempfile
import unittest
+from unittest import mock
from pathlib import Path
ROOT = Path(__file__).resolve().parent
@@ -36,7 +37,10 @@ import mlx_ltx_panel as P # noqa: E402
class _Mac:
- """Rebuild the H3 table as a given Mac would at import."""
+ """Rebuild the H3 table as a given Mac would at import — a fresh install,
+ with no learned ETA calibration (issue #90: an install that had learned a
+ 1.45 H3 correction priced the 26.6-minute receipt at 38.57, because
+ `_hw_speed_factor` folds this install's own eta_calibration.json in)."""
def __init__(self, ram_gb: float, chip: str):
self.ram_gb, self.chip = ram_gb, chip
@@ -44,11 +48,14 @@ class _Mac:
def __enter__(self):
self.saved = (P.SYSTEM_RAM_GB, P._HW_CHIP_FAMILY,
os.environ.pop("PHOSPHENE_SPEED_FACTOR", None))
+ self._calibration = mock.patch.object(P, "_load_eta_calibration", lambda: {})
+ self._calibration.start()
P.SYSTEM_RAM_GB = self.ram_gb
P._HW_CHIP_FAMILY = self.chip
return P._build_h3_tiers()
def __exit__(self, *exc):
+ self._calibration.stop()
P.SYSTEM_RAM_GB, P._HW_CHIP_FAMILY, env = self.saved
if env is not None:
os.environ["PHOSPHENE_SPEED_FACTOR"] = env
@@ -73,6 +80,13 @@ class ReducedRamLanePrice(unittest.TestCase):
with self.subTest(cell=key):
k = (P.H3_LOWRAM_FACTOR_CHAIN if c["chain_windows"] > 1
else P.H3_LOWRAM_FACTOR_SINGLE)
+ if c.get("fast_hd") and c.get("tristep_min") is not None:
+ # Fast HD = the H3 Fast pass (RAM lane factor applies)
+ # + an LTX Face Fix (chip factor only, no H3 lane).
+ self.assertAlmostEqual(
+ c["eta_min"], c["tristep_min"] + c["facefix_min"], delta=0.02)
+ self.assertAlmostEqual(c["tristep_min"], base[key][1] * k, delta=0.02)
+ continue
self.assertAlmostEqual(c["eta_min"], base[key][0] * k, delta=0.02)
if base[key][1] is not None:
self.assertAlmostEqual(c["tristep_min"], base[key][1] * k,
diff --git a/test_h3_menu_taglines_and_dense10s_docs.py b/test_h3_menu_taglines_and_dense10s_docs.py
index 6dbd29c..5866c74 100644
--- a/test_h3_menu_taglines_and_dense10s_docs.py
+++ b/test_h3_menu_taglines_and_dense10s_docs.py
@@ -29,8 +29,10 @@ class EngineMenuTaglinesDontOverclaimExclusivity(unittest.TestCase):
PANEL_PY)
def test_h3_tagline_names_its_own_loras(self):
+ # 4.19: H3 serves Keyframes, Extend, Lip-sync and Add sound too, so the
+ # old "Text and Image only." clause would now under-claim.
self.assertIn(
- '"tagline": "joint video + dialogue + sound, its own LoRAs. Text and Image only.",',
+ '"tagline": "joint video + dialogue + sound, its own LoRAs. Keyframes, Extend, Lip-sync and Add sound too.",',
PANEL_PY)
diff --git a/test_h3_review_r2.py b/test_h3_review_r2.py
index d431d41..ae28014 100644
--- a/test_h3_review_r2.py
+++ b/test_h3_review_r2.py
@@ -235,6 +235,10 @@ class TestHardwareFactor(unittest.TestCase):
os.environ.pop("PHOSPHENE_SPEED_FACTOR", None)
def test_measured_and_coefficients_scale(self):
+ # The baseline is the M4 Max factor, pinned (issue #90): built with
+ # THIS Mac's own chip/RAM factor, "2x the base" compared a factor of
+ # 2 against e.g. 2 x 2.14 on an M4 Pro and failed 18.2 != 38.94.
+ os.environ["PHOSPHENE_SPEED_FACTOR"] = "1"
base = P._build_h3_tiers()
os.environ["PHOSPHENE_SPEED_FACTOR"] = "2"
slow = P._build_h3_tiers()
diff --git a/test_h3_runner_wav_cleanup.py b/test_h3_runner_wav_cleanup.py
new file mode 100644
index 0000000..60f3f13
--- /dev/null
+++ b/test_h3_runner_wav_cleanup.py
@@ -0,0 +1,81 @@
+"""The H3 runner's mux WAVs do not pile up in the gallery (4.19.0).
+
+minimax_h3_mlx/media.py writes the soundtrack to <out>.wav (and
+<out>_source.wav when it time-stretches) only to mux it, and never removes
+it, so every H3 render left a stray WAV in OUTPUT that the gallery and the
+Editor list as a separate audio output (188 on one install). The panel now
+removes the ones THIS render wrote - same stem, written since the job started
+- after the runner exits, keeping <out>.wav for Extend's splice until it is
+done. A user's own older WAV with the same name and the #48 FLAC masters are
+never touched.
+"""
+from __future__ import annotations
+
+import os
+import tempfile
+import time
+import unittest
+from pathlib import Path
+
+import mlx_ltx_panel as P
+
+ROOT = Path(__file__).resolve().parent
+
+
+class DropRunnerWavs(unittest.TestCase):
+ def setUp(self):
+ self.tmp = tempfile.TemporaryDirectory()
+ self.d = Path(self.tmp.name)
+ self.out = self.d / "a_scene_h3.mp4"
+ self.out.write_bytes(b"mp4")
+
+ def tearDown(self):
+ self.tmp.cleanup()
+
+ def test_removes_both_wavs_this_render_wrote(self):
+ t0 = time.time()
+ for n in ("a_scene_h3.wav", "a_scene_h3_source.wav"):
+ (self.d / n).write_bytes(b"RIFF")
+ removed = P._h3_drop_runner_wavs(self.out, t0)
+ self.assertEqual(sorted(removed), ["a_scene_h3.wav", "a_scene_h3_source.wav"])
+ self.assertTrue(self.out.exists())
+ self.assertEqual(sorted(p.name for p in self.d.iterdir()), ["a_scene_h3.mp4"])
+
+ def test_extend_keeps_the_main_wav_until_its_splice(self):
+ t0 = time.time()
+ (self.d / "a_scene_h3.wav").write_bytes(b"RIFF")
+ P._h3_drop_runner_wavs(self.out, t0, keep_main=True)
+ self.assertTrue((self.d / "a_scene_h3.wav").exists())
+
+ def test_an_older_wav_with_the_same_name_is_never_removed(self):
+ w = self.d / "a_scene_h3.wav"
+ w.write_bytes(b"users own")
+ old = time.time() - 3600
+ os.utime(w, (old, old))
+ self.assertEqual(P._h3_drop_runner_wavs(self.out, time.time()), [])
+ self.assertTrue(w.exists())
+
+ def test_other_files_and_extend_masters_are_never_matched(self):
+ t0 = time.time()
+ masters = self.d / ".extend" / "masters"
+ masters.mkdir(parents=True)
+ (masters / "a_scene_h3.flac").write_bytes(b"fLaC")
+ (self.d / "a_scene_h3_2.wav").write_bytes(b"RIFF")
+ (self.d / "song.wav").write_bytes(b"RIFF")
+ self.assertEqual(P._h3_drop_runner_wavs(self.out, t0), [])
+ self.assertTrue((masters / "a_scene_h3.flac").exists())
+
+
+class WiredIntoTheH3Job(unittest.TestCase):
+ def test_the_job_cleans_up_after_every_exit_and_after_extend(self):
+ src = (ROOT / "mlx_ltx_panel.py").read_text()
+ body = src[src.index("def run_h3_job_inner("):]
+ body = body[: body.index("\ndef ", 10)]
+ fin = body[body.index(" finally:"):body.index("if not out_path.is_file():")]
+ self.assertIn('_h3_drop_runner_wavs(out_path, t0, keep_main=(mode == "extend"))', fin)
+ after = body[body.index("generated_lossless=h3_extend_lossless)"):body.index('if mode == "v2a":')]
+ self.assertIn("_h3_drop_runner_wavs(out_path, t0)", after)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_h3_tristep_draft.py b/test_h3_tristep_draft.py
index 8016114..f7e41e8 100644
--- a/test_h3_tristep_draft.py
+++ b/test_h3_tristep_draft.py
@@ -313,8 +313,20 @@ class TestMakeJob(_Env):
class TestEstimates(unittest.TestCase):
+ """The receipts below are M4 Max wall clocks, so the cells are priced at
+ the M4 Max factor (issue #90). The module's H3_TIERS is priced at import
+ with THIS Mac's chip, RAM lane and learned calibration; on an M4 Pro the
+ 3.0-minute receipt read 6.42 and the assertions failed by machine."""
+
+ def _at_m4_max(self):
+ patcher = unittest.mock.patch.dict(os.environ, {"PHOSPHENE_SPEED_FACTOR": "1"})
+ patcher.start()
+ self.addCleanup(patcher.stop)
+ return P._build_h3_tiers()
+
def test_draft_cells_are_priced(self):
- cell = P.H3_TIERS["draft_5s"]
+ tiers = self._at_m4_max()
+ cell = tiers["draft_5s"]
self.assertEqual(cell["tristep_min_i2v"], 3.0)
self.assertEqual(cell["tristep_eta_i2v"], "~3 min")
self.assertTrue(cell["tristep_measured_i2v"])
@@ -326,15 +338,16 @@ class TestEstimates(unittest.TestCase):
self.assertEqual(cell["facefix_min"], P.FACE_FIX_DRAFT_5S_MIN)
self.assertAlmostEqual(cell["tristep_min_i2v"] + cell["facefix_min"], 5.5)
self.assertLess(cell["tristep_min"], cell["eta_min"])
- short = P.H3_TIERS["draft_3s"]
+ short = tiers["draft_3s"]
self.assertFalse(short["tristep_measured"])
self.assertLess(short["tristep_min"], short["eta_min"])
self.assertEqual(short["tristep_min"], round(P.h3_estimate_minutes(640, 384, 73, 1, 3), 2))
- self.assertEqual(P.H3_TIERS["draft_10s"]["tristep_forwards"], 6)
+ self.assertEqual(tiers["draft_10s"]["tristep_forwards"], 6)
self.assertTrue(cell["tristep_default"])
def test_standard_and_high_are_priced_from_their_receipts(self):
- std, high = P.H3_TIERS["standard_5s"], P.H3_TIERS["high_5s"]
+ tiers = self._at_m4_max()
+ std, high = tiers["standard_5s"], tiers["high_5s"]
self.assertEqual((std["tristep_min"], std["tristep_eta"]), (4.9, "~5 min"))
self.assertEqual((std["tristep_min_i2v"], std["tristep_eta_i2v"]), (4.8, "~5 min"))
self.assertEqual((high["tristep_min"], high["tristep_eta"]), (8.4, "~8 min"))
@@ -345,9 +358,9 @@ class TestEstimates(unittest.TestCase):
self.assertEqual(std["facefix_min"], 4.0)
self.assertEqual(high["facefix_min"], 9.0)
self.assertLess(high["tristep_min_i2v"], high["eta_min"] / 3)
- self.assertIn("tristep_min", P.H3_TIERS["high_15s"])
- self.assertNotIn("tristep_min", P.H3_TIERS["native_5s"])
- self.assertNotIn("tristep_min", P.H3_TIERS["high_10s_dense"])
+ self.assertIn("tristep_min", tiers["high_15s"])
+ self.assertNotIn("tristep_min", tiers["native_5s"])
+ self.assertNotIn("tristep_min", tiers["high_10s_dense"])
def test_other_canvases_are_not(self):
for key, cell in P.H3_TIERS.items():
diff --git a/test_lora_compat.py b/test_lora_compat.py
index e07ec78..c0b1a50 100644
--- a/test_lora_compat.py
+++ b/test_lora_compat.py
@@ -443,6 +443,30 @@ class AdapterCliTests(unittest.TestCase):
+def _full_training_presets() -> dict:
+ """TRAIN_PRESETS as a >=64 GB Mac boots with it, on any Mac.
+
+ Issue #90: below 64 GB, `_select_train_profile` REPLACES the table at
+ import with the compact one (TheSub64GbHighIsNotTheGradedRecipe asserts
+ those pills), and nothing keeps a copy of the original. Reading the live
+ table made the >=64 GB pill assertions fail on every 48 GB Mac. The full
+ table is the literal assigned in the panel source, evaluated (not
+ grepped); on a Mac that runs it, it must also BE the live table, so the
+ literal cannot drift from what such a Mac is served."""
+ import ast
+ import mlx_ltx_panel as panel
+ tree = ast.parse(Path(panel.__file__).read_text(encoding="utf-8"))
+ for node in tree.body:
+ if isinstance(node, ast.Assign) and any(
+ getattr(t, "id", None) == "TRAIN_PRESETS" for t in node.targets):
+ table = ast.literal_eval(node.value)
+ if not panel.TRAIN_PROFILE.get("compact"):
+ assert table == panel.TRAIN_PRESETS, \
+ "a >=64 GB Mac is not served the TRAIN_PRESETS literal"
+ return table
+ raise AssertionError("TRAIN_PRESETS is no longer a literal assignment")
+
+
class AGreenTallyIsNotProof(unittest.TestCase):
"""A LoRA can train to completion, write a valid safetensors, load without
a warning and change NOTHING — the deltas are too small to move the model.
@@ -466,11 +490,11 @@ class AGreenTallyIsNotProof(unittest.TestCase):
def test_the_two_ungraded_presets_say_so_on_the_pill(self):
# The rank-32 recipe is the one measured on faces. Saying "fast" and
# letting the user infer "as good, sooner" is the pill doing the lying.
- import mlx_ltx_panel as panel
- self.assertIn("ungraded", panel.TRAIN_PRESETS["quick"]["subtitle"])
- self.assertIn("ungraded", panel.TRAIN_PRESETS["medium"]["subtitle"])
- self.assertNotIn("ungraded", panel.TRAIN_PRESETS["high"]["subtitle"])
- self.assertIn("validated", panel.TRAIN_PRESETS["high"]["subtitle"])
+ presets = _full_training_presets()
+ self.assertIn("ungraded", presets["quick"]["subtitle"])
+ self.assertIn("ungraded", presets["medium"]["subtitle"])
+ self.assertNotIn("ungraded", presets["high"]["subtitle"])
+ self.assertIn("validated", presets["high"]["subtitle"])
def test_the_trainer_event_is_read_and_a_weak_run_is_not_a_plain_done(self):
root = Path(__file__).resolve().parent
@@ -526,9 +550,8 @@ class TheDefaultIsTheRecommendation(unittest.TestCase):
self.assertIn("train_default_preset", src)
def test_quick_says_what_it_is_for_rather_than_only_that_it_is_fast(self):
- import mlx_ltx_panel as panel
self.assertIn("a look, not a face",
- panel.TRAIN_PRESETS["quick"]["subtitle"])
+ _full_training_presets()["quick"]["subtitle"])
class TheSub64GbHighIsNotTheGradedRecipe(unittest.TestCase):
diff --git a/test_ltx_windows.py b/test_ltx_windows.py
index dcf911e..b9f6353 100644
--- a/test_ltx_windows.py
+++ b/test_ltx_windows.py
@@ -109,10 +109,17 @@ import mlx_ltx_panel as panel # noqa: E4
class ThePanel(unittest.TestCase):
def test_make_job_carries_the_windows_fields(self):
- job = panel.make_job({"mode": "t2v", "prompt": "a man walks",
- "frames": "481", "temporal_mode": "windows",
- "window_prompts": '["", "he sits", ""]',
- "window_invariants": "one man, grey room"})
+ # The hardware generation profile is held off (issue #90): on a 48 GB
+ # Mac it auto-enables Long Clip Boost past its frame threshold, so a
+ # 481-frame job came back temporal_mode=fps12_interp24 by design and
+ # this assertion failed by which Mac ran it. What is under test is
+ # make_job carrying the windows fields; the profile has its own suite
+ # (test_generation_profile_override).
+ with _mock.patch.object(panel, "_apply_generation_profile_to_job"):
+ job = panel.make_job({"mode": "t2v", "prompt": "a man walks",
+ "frames": "481", "temporal_mode": "windows",
+ "window_prompts": '["", "he sits", ""]',
+ "window_invariants": "one man, grey room"})
p = job["params"]
self.assertEqual(p["long_mode"], "windows")
self.assertEqual(p["temporal_mode"], "native")
diff --git a/test_music_cover.py b/test_music_cover.py
index cfedc61..47aea35 100644
--- a/test_music_cover.py
+++ b/test_music_cover.py
@@ -106,6 +106,10 @@ class TheRunnerRefusesTheImpossible(unittest.TestCase):
self.assertIn("invalid choice", out.lower())
+ENGINE_MODEL = (Path(__file__).with_name("yue2-mlx") / "src" / "lyra"
+ / "transcription" / "model.py")
+
+
class TheModelsAreOptional(unittest.TestCase):
def test_status_reports_what_is_missing_rather_than_a_boolean(self):
@@ -120,12 +124,19 @@ class TheModelsAreOptional(unittest.TestCase):
"""The Compose card reads one payload."""
self.assertIn("cover", P.music_status())
+ # The engine's side of this pin lives in the yue2-mlx/ checkout, which
+ # "Install the music engine" clones (gitignored, optional). On an install
+ # without music there is no second half to compare: a loud skip, not an
+ # import-time crash (issue #90).
+ @unittest.skipUnless(
+ ENGINE_MODEL.is_file(),
+ "music engine checkout not installed (yue2-mlx/src/lyra/transcription/"
+ "model.py missing) - run 'Install the music engine' to check the pins")
def test_the_fetcher_pins_the_revisions_the_engine_pins(self):
"""SheetSage2's config carries the sha256 of the MERT checkpoint it was
trained against and refuses to load beside any other one."""
from scripts.pinokio.music_cover_fetch import SOURCES
- model = (Path(__file__).with_name("yue2-mlx") / "src" / "lyra" /
- "transcription" / "model.py").read_text()
+ model = ENGINE_MODEL.read_text()
self.assertIn(SOURCES["sheetsage2"]["revision"], model)
self.assertIn(SOURCES["mert2"]["revision"], model)
diff --git a/test_music_engine.py b/test_music_engine.py
index 932a2af..14c8e36 100644
--- a/test_music_engine.py
+++ b/test_music_engine.py
@@ -368,7 +368,7 @@ def node_eval(source):
def test_video_switcher_byte_identical_and_music_surface():
current = (ROOT / "webapp/js/engines.js").read_text()
- before = subprocess.check_output(["git", "show", "d616662:webapp/js/engines.js"], cwd=ROOT, text=True)
+ before = subprocess.check_output(["git", "show", "e1d500e36d2f1ee445a056811763d1b33b8f7d02:webapp/js/engines.js"], cwd=ROOT, text=True)
names = ("engineStatus", "engineServesMode", "_currentSurface", "engineOnSurface", "engineRenderable", "_engineRowVisible", "_engineTooltip", "renderEngineSwitch")
def render(source, engines, workflow, capable=True):
funcs = '\n'.join(extract_function(n, source) for n in names)
diff --git a/test_refusal_gates.py b/test_refusal_gates.py
index 6714797..cdbf28e 100644
--- a/test_refusal_gates.py
+++ b/test_refusal_gates.py
@@ -333,7 +333,18 @@ class TestH3RamRefusalStatesTheRealFloor(unittest.TestCase):
self.assertFalse(v["needs_q8_dit"])
def test_a_48gb_mac_without_the_pack_is_told_it_CAN_run_h3(self):
- v = self._band(48.0, False)
+ # Pin the install state: this asserts the never-installed sentence, so
+ # it must not read the real h3_paths() — on a fully installed Mac that
+ # takes the Build branch instead and the gate went red on good installs.
+ old_paths = P.h3_paths
+ P.h3_paths = lambda: {"missing": ["weights"], "reason": "missing",
+ "root": "/x", "models": "/x",
+ "repairable": False, "venv_broken": False,
+ "weights_ok": False}
+ try:
+ v = self._band(48.0, False)
+ finally:
+ P.h3_paths = old_paths
self.assertTrue(v["needs_q8_dit"])
self.assertNotIn("64", v["message"])
self.assertIn("runs on this Mac", v["message"])
diff --git a/test_repair_scrambled_lora.py b/test_repair_scrambled_lora.py
new file mode 100644
index 0000000..25eaedf
--- /dev/null
+++ b/test_repair_scrambled_lora.py
@@ -0,0 +1,241 @@
+#!/usr/bin/env python3
+"""The scrambled-save repair (#62) must fix exactly the files it should.
+
+`lora_lab.repair_scrambled_lora` reverses the safetensors-0.8.0 raw-buffer
+write that scrambled every Train-tab adapter (see
+test_train_checkpoint_layout.py). Unscrambling a CORRECT file would scramble
+it, so the repair is gated on a content check. Pinned here, numpy only:
+
+- a file written the way the trainer wrote it is called "scrambled" and comes
+ back bit-exact to the trained factors;
+- a correctly saved file is called "ok" and is never touched, by --in-place
+ or otherwise;
+- structureless noise is "undetermined", not guessed;
+- --in-place keeps a backup and notes the repair in the sidecar.
+
+4.19.0 additions (on top of @tanis2000's PR #89): the header metadata and
+dtypes survive; an in-place repair keeps hard links (the character bundle);
+the sidecar's adapter_strength verdict is re-measured; voice-branch adapters
+are decided rather than "undetermined"; --auto repairs only adapters this app
+trained and never reads anything else.
+"""
+from __future__ import annotations
+
+import json
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+import numpy as np
+
+ROOT = Path(__file__).resolve().parent
+sys.path.insert(0, str(ROOT))
+
+from lora_lab import repair_scrambled_lora as R # noqa: E402
+from safetensors.numpy import load_file, save_file # noqa: E402
+
+N_IN, N_OUT, RANK, MODULES = 512, 384, 8, 6
+
+
+def _trained_like(seed: int) -> dict[str, tuple[np.ndarray, np.ndarray]]:
+ """lora_a (in, r), lora_b (r, out) with the structure training leaves:
+ every rank component scaled by the same per-input-channel profile."""
+ rng = np.random.default_rng(seed)
+ out = {}
+ for m in range(MODULES):
+ channel_scale = rng.lognormal(0.0, 1.0, size=(N_IN, 1))
+ a = (rng.standard_normal((N_IN, RANK)) * channel_scale * 1e-2).astype(np.float32)
+ b = (rng.standard_normal((RANK, N_OUT)) * 1e-3).astype(np.float32)
+ out[f"diffusion_model.transformer_blocks.{m}.attn1.to_q"] = (a, b)
+ return out
+
+
+def _as_trainer_wrote(factors: dict) -> dict[str, np.ndarray]:
+ """The safetensors-0.8.0 write: transposed shape, untransposed bytes."""
+ w = {}
+ for k, (a, b) in factors.items():
+ w[k + ".lora_A.weight"] = np.ascontiguousarray(a).reshape(RANK, N_IN)
+ w[k + ".lora_B.weight"] = np.ascontiguousarray(b).reshape(N_OUT, RANK)
+ return w
+
+
+def _as_correct(factors: dict) -> dict[str, np.ndarray]:
+ w = {}
+ for k, (a, b) in factors.items():
+ w[k + ".lora_A.weight"] = np.ascontiguousarray(a.T)
+ w[k + ".lora_B.weight"] = np.ascontiguousarray(b.T)
+ return w
+
+
+class Detection(unittest.TestCase):
+ @staticmethod
+ def _s(w: dict) -> tuple[float, float, float]:
+ as_is, unscr, _n, floor = R.scramble_scores(w)
+ return as_is, unscr, floor
+
+ def test_a_trainer_written_file_is_scrambled_and_repairs_exactly(self) -> None:
+ f = _trained_like(1)
+ bad = _as_trainer_wrote(f)
+ self.assertEqual(R.classify(*self._s(bad)), "scrambled")
+ fixed = R.unscramble(bad)
+ for k, v in _as_correct(f).items():
+ np.testing.assert_array_equal(fixed[k], v)
+
+ def test_a_correct_file_is_ok(self) -> None:
+ self.assertEqual(R.classify(*self._s(_as_correct(_trained_like(2)))), "ok")
+
+ def test_structureless_noise_is_not_guessed(self) -> None:
+ rng = np.random.default_rng(3)
+ w = {f"m{i}.lora_A.weight": rng.standard_normal((RANK, N_IN)).astype(np.float32) for i in range(MODULES)}
+ self.assertEqual(R.classify(*self._s(w)), "undetermined")
+
+
+class InPlace(unittest.TestCase):
+ def _write(self, d: Path, weights: dict) -> Path:
+ p = d / "char_v2.safetensors"
+ save_file(weights, str(p))
+ p.with_suffix(".safetensors.json").write_text(json.dumps({"trigger": "abctrn"}))
+ return p
+
+ def test_repairs_with_backup_and_a_sidecar_note(self) -> None:
+ f = _trained_like(4)
+ with tempfile.TemporaryDirectory() as d:
+ p = self._write(Path(d), _as_trainer_wrote(f))
+ self.assertEqual(R.main([str(p), "--in-place"]), 0)
+ self.assertTrue((Path(d) / "char_v2.safetensors.scrambled.bak").exists())
+ got = load_file(str(p))
+ for k, v in _as_correct(f).items():
+ np.testing.assert_array_equal(got[k], v)
+ side = json.loads(p.with_suffix(".safetensors.json").read_text())
+ self.assertIn("repaired_scrambled_save", side)
+ self.assertEqual(side["trigger"], "abctrn")
+ # Second pass: already correct, must not touch it again.
+ self.assertEqual(R.main([str(p), "--in-place"]), 0)
+ np.testing.assert_array_equal(load_file(str(p))[next(iter(got))], got[next(iter(got))])
+
+ def test_a_correct_file_is_never_modified(self) -> None:
+ with tempfile.TemporaryDirectory() as d:
+ p = self._write(Path(d), _as_correct(_trained_like(5)))
+ before = p.read_bytes()
+ self.assertEqual(R.main([str(p), "--in-place"]), 0)
+ self.assertEqual(p.read_bytes(), before)
+ self.assertFalse((Path(d) / "char_v2.safetensors.scrambled.bak").exists())
+
+
+def _voice_like(seed: int, n_in: int = 2048, rank: int = 16, modules: int = 96,
+ weak: float = 0.05) -> dict[str, tuple[np.ndarray, np.ndarray]]:
+ """Audio-branch factors with the FAINT channel profile real voice adapters
+ carry: 0.05 reads ~0.004 as saved; the two real voice adapters measured
+ here read 0.0042 and 0.0070, against ~0.02-0.04 for a face)."""
+ rng = np.random.default_rng(seed)
+ out = {}
+ for m in range(modules):
+ channel_scale = rng.lognormal(0.0, weak, size=(n_in, 1))
+ a = (rng.standard_normal((n_in, rank)) * channel_scale * 1e-2).astype(np.float32)
+ b = (rng.standard_normal((rank, n_in)) * 1e-3).astype(np.float32)
+ out[f"diffusion_model.transformer_blocks.{m}.audio_attn1.to_q"] = (a, b)
+ return out
+
+
+def _wrote(factors: dict) -> dict[str, np.ndarray]:
+ w = {}
+ for k, (a, b) in factors.items():
+ w[k + ".lora_A.weight"] = np.ascontiguousarray(a).reshape(a.shape[1], a.shape[0])
+ w[k + ".lora_B.weight"] = np.ascontiguousarray(b).reshape(b.shape[1], b.shape[0])
+ return w
+
+
+class Additions4190(unittest.TestCase):
+ def test_voice_adapters_are_decided_both_ways(self) -> None:
+ f = _voice_like(7)
+ as_is, unscr, _n, floor = R.scramble_scores(_as_correct(f))
+ self.assertLess(as_is, R.MIN_SCORE) # what made them "undetermined"
+ self.assertEqual(R.classify(as_is, unscr, floor), "ok")
+ as_is, unscr, _n, floor = R.scramble_scores(_wrote(f))
+ self.assertEqual(R.classify(as_is, unscr, floor), "scrambled")
+
+ def test_metadata_dtype_and_hard_links_survive_an_in_place_repair(self) -> None:
+ f = _trained_like(8)
+ with tempfile.TemporaryDirectory() as d:
+ d = Path(d)
+ p = d / "loras" / "abctrn_v2.safetensors"
+ p.parent.mkdir()
+ bad = {k: v.astype(np.float16) for k, v in _as_trainer_wrote(f).items()}
+ save_file(bad, str(p), metadata={"ss_trigger": "abctrn"})
+ twin = d / "abctrn.video.safetensors"
+ twin.hardlink_to(p)
+ self.assertEqual(R.main([str(p), "--in-place"]), 0)
+ dtypes, meta = R.read_header(p)
+ self.assertEqual(meta, {"ss_trigger": "abctrn"})
+ self.assertEqual(set(dtypes.values()), {"F16"})
+ self.assertEqual(twin.read_bytes(), p.read_bytes()) # same inode, both names fixed
+ got = load_file(str(p))
+ for k, v in _as_correct(f).items():
+ np.testing.assert_array_equal(got[k], v.astype(np.float16))
+
+ def test_the_weak_verdict_is_re_measured_after_repair(self) -> None:
+ f = _trained_like(9)
+ with tempfile.TemporaryDirectory() as d:
+ p = Path(d) / "abctrn_v2.safetensors"
+ save_file(_as_trainer_wrote(f), str(p))
+ stale = {"verdict": "weak", "delta_rms_median": 1e-9}
+ p.with_suffix(".json").write_text(json.dumps(
+ {"kind": "train_character", "adapter_strength": stale}))
+ self.assertEqual(R.main([str(p), "--in-place"]), 0)
+ side = json.loads(p.with_suffix(".json").read_text())
+ self.assertEqual(side["adapter_strength_as_saved"], stale)
+ self.assertNotEqual(side["adapter_strength"], stale)
+ self.assertIn("repaired_scrambled_save", side)
+
+ def test_auto_repairs_what_this_app_trained_and_nothing_else(self) -> None:
+ with tempfile.TemporaryDirectory() as d:
+ models = Path(d)
+ loras = models / "loras"
+ loras.mkdir()
+ trained = loras / "abctrn_v2.safetensors"
+ save_file(_as_trainer_wrote(_trained_like(10)), str(trained))
+ trained.with_suffix(".safetensors.json").write_text(json.dumps({"lora_lab_version": "iter6"}))
+ voice = loras / "abctrn.audio.safetensors"
+ save_file(_wrote(_voice_like(11)), str(voice))
+ # A downloaded LoRA that LOOKS scrambled: --auto must not even read it.
+ foreign = loras / "civitai_style.safetensors"
+ save_file(_as_trainer_wrote(_trained_like(12)), str(foreign))
+ foreign_before = foreign.read_bytes()
+ bundle = models / "characters" / "abctrn"
+ bundle.mkdir(parents=True)
+ (bundle / "abctrn.video.safetensors").hardlink_to(trained)
+ self.assertEqual(R.main(["--auto", str(models)]), 0)
+ self.assertTrue((loras / "abctrn_v2.safetensors.scrambled.bak").exists())
+ self.assertTrue((loras / "abctrn.audio.safetensors.scrambled.bak").exists())
+ self.assertFalse((bundle / "abctrn.video.safetensors.scrambled.bak").exists()) # one inode, one repair
+ self.assertEqual(foreign.read_bytes(), foreign_before)
+ self.assertFalse((loras / "civitai_style.safetensors.scrambled.bak").exists())
+ # A second Update finds nothing to do.
+ self.assertEqual(R.main(["--auto", str(models)]), 0)
+ self.assertEqual(len(list(models.rglob("*.scrambled.bak"))), 2)
+
+
+ def test_auto_never_trusts_a_name_or_follows_a_link(self) -> None:
+ """Codex 4.19.0: a downloaded voice named like ours, and a symlink to a
+ file outside the library, are never read or rewritten by --auto."""
+ with tempfile.TemporaryDirectory() as d:
+ models = Path(d) / "models"
+ loras = models / "loras"
+ loras.mkdir(parents=True)
+ stray = loras / "someone.audio.safetensors" # no trained face beside it
+ save_file(_wrote(_voice_like(13)), str(stray))
+ outside = Path(d) / "elsewhere.safetensors"
+ save_file(_as_trainer_wrote(_trained_like(14)), str(outside))
+ link = loras / "linked_v2.safetensors"
+ link.symlink_to(outside)
+ (loras / "linked_v2.safetensors.json").write_text(json.dumps({"lora_lab_version": "iter6"}))
+ before = (stray.read_bytes(), outside.read_bytes())
+ self.assertEqual(R.auto_candidates(models), [])
+ self.assertEqual(R.main(["--auto", str(models)]), 0)
+ self.assertEqual((stray.read_bytes(), outside.read_bytes()), before)
+ self.assertEqual(list(Path(d).rglob("*.scrambled.bak")), [])
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_review_416_ltx.py b/test_review_416_ltx.py
index 3115963..0f36ec9 100644
--- a/test_review_416_ltx.py
+++ b/test_review_416_ltx.py
@@ -639,7 +639,12 @@ class HardwareClampsKeepShapeAndGrid(unittest.TestCase):
def test_the_compact_profile_clamp_stays_on_the_grid(self):
job = P.make_job({"mode": "t2v", "prompt": "x", "quality": "balanced",
"width": "1536", "height": "832", "frames": "49"})
- with mock.patch.object(P, "GENERATION_PROFILE", P._select_generation_profile(48.0, "standard")):
+ # The tier is pinned with the profile (issue #90): the profile's
+ # max_dim clamp is skipped on the `base` tier, where CAPABILITIES'
+ # own clamp in run_job_inner is the authority, so on a <48 GB Mac
+ # this asserted a clamp that tier never applies here.
+ with mock.patch.object(P, "GENERATION_PROFILE", P._select_generation_profile(48.0, "standard")), \
+ mock.patch.object(P, "SYSTEM_TIER", "standard"):
P._apply_generation_profile_to_job(job)
got = (job["params"]["width"], job["params"]["height"])
self._check(got, 1024, (1536, 832))
diff --git a/test_schedule_preset.py b/test_schedule_preset.py
index 16caaf9..f022560 100644
--- a/test_schedule_preset.py
+++ b/test_schedule_preset.py
@@ -13,6 +13,7 @@ import os
import sys
import tempfile
import unittest
+from unittest import mock
from pathlib import Path
ROOT = Path(__file__).resolve().parent
@@ -182,7 +183,11 @@ class TestH3Orientation(unittest.TestCase):
def h3_job(self, form: dict) -> dict:
base = {"mode": "t2v", "engine": "h3", "prompt": "a lighthouse"}
base.update(form)
- return P.make_job({k: [str(v)] for k, v in base.items()})
+ # As an H3-capable Mac (issue #90): below the RAM floor make_job falls
+ # back to LTX by design, and a landscape-vs-portrait comparison of an
+ # LTX job says nothing about H3's orientation.
+ with mock.patch.dict(os.environ, {"LTX_H3_FORCE_CAPABLE": "1"}):
+ return P.make_job({k: [str(v)] for k, v in base.items()})
def test_portrait_flips_the_cells_canvas(self):
land = self.h3_job({})["params"]
diff --git a/test_tier_chip_honesty.py b/test_tier_chip_honesty.py
index 86bb279..2eba7dc 100644
--- a/test_tier_chip_honesty.py
+++ b/test_tier_chip_honesty.py
@@ -29,6 +29,7 @@ import os
import sys
import tempfile
import unittest
+from unittest import mock
from pathlib import Path
ROOT = Path(__file__).resolve().parent
@@ -44,9 +45,24 @@ import mlx_ltx_panel as P # noqa: E402
EJS = (ROOT / "webapp" / "js" / "engines.js").read_text(encoding="utf-8")
+def _payload_on_a_standard_tier_mac() -> dict:
+ """ltx_tiers_payload() as a 48-79 GB Mac boots with it (issue #90).
+
+ LTX_QUALITIES bakes this Mac's `t2v_max_dim` into every canvas at import:
+ a <48 GB (`base`) Mac renders Balanced at 768x448 by design and its chip
+ says so. The delivered-size contract below is about the full canvases,
+ so the tables are rebuilt for the standard tier rather than read as
+ whichever Mac runs the suite booted them."""
+ with mock.patch.object(P, "SYSTEM_TIER", "standard"), \
+ mock.patch.object(P, "SYSTEM_CAPS", P.CAPABILITIES["standard"]):
+ with mock.patch.object(P, "LTX_QUALITIES", P._ltx_qualities()):
+ with mock.patch.object(P, "LTX_TIERS", P._build_ltx_tiers()):
+ return P.ltx_tiers_payload()
+
+
class TestDeliveredSize(unittest.TestCase):
def setUp(self):
- self.payload = P.ltx_tiers_payload()
+ self.payload = _payload_on_a_standard_tier_mac()
self.tiers = {t["key"]: t for t in self.payload["tiers"]}
self.qualities = {q["key"]: q for q in self.payload["qualities"]}
diff --git a/test_toolbar_more_menu.py b/test_toolbar_more_menu.py
index 72122a1..4b4ffa5 100644
--- a/test_toolbar_more_menu.py
+++ b/test_toolbar_more_menu.py
@@ -69,6 +69,10 @@ class _H:
class _Env(unittest.TestCase):
def setUp(self):
+ # run_sharp_export_job_inner writes its export to the real OUTPUT (kept
+ # on purpose: a failure to write there is a real failure). Remember what
+ # was there so tearDown removes only what this test created.
+ self._out_before = {q.name for q in Path(P.OUTPUT).glob("gym_draft_sharp_*")}
self.dir = Path(tempfile.mkdtemp(prefix="mm-", dir=P.OUTPUT)) # UI-1: outputs/uploads only
self.clip = self.dir / "gym_draft.mp4"
self.clip.write_bytes(b"\0" * 64)
@@ -82,7 +86,10 @@ class _Env(unittest.TestCase):
self._queue_before = list(P.STATE["queue"])
def tearDown(self):
- shutil.rmtree(self.dir, ignore_errors=True) # a temp dir under the sandboxed OUTPUT
+ shutil.rmtree(self.dir, ignore_errors=True) # a temp dir under OUTPUT
+ for q in Path(P.OUTPUT).glob("gym_draft_sharp_*"): # exports this test made
+ if q.name not in self._out_before:
+ q.unlink(missing_ok=True)
P.PIPERSR_UPSCALE_ENABLED, P.persist_queue = self._saved
with P.QUEUE_COND:
P.STATE["queue"] = self._queue_before
diff --git a/test_train_caption_trigger.py b/test_train_caption_trigger.py
new file mode 100644
index 0000000..04cca5e
--- /dev/null
+++ b/test_train_caption_trigger.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python3
+"""A user-provided caption dataset that doesn't mention the job's trigger
+word trains cleanly and produces a LoRA that never responds to the word the
+user was told to prompt with (#62, `valeriosan_v2`, 2026-09-30).
+
+Root cause: `caption_strategy=user_provided` trusts on-disk caption files
+verbatim, and nothing ever compared their content against `spec["trigger"]`.
+A dataset reused across training attempts (same cropped photos, stale
+caption .txt files from an earlier trigger) silently retrained a working
+identity under the OLD trigger while every surface a user could check
+(sidecar JSON, Train tab, Characters picker) reported the NEW one. Verified
+against a real case: 42/42 existing captions used a different trigger
+(`cvjtrn`) than the one the job was submitted with (`valeriosan`); the
+resulting LoRA attached cleanly (576/576 modules) and never responded to
+`valeriosan` in a direct render test.
+
+This pins the two pure helpers the fix introduces —
+`_caption_declared_trigger` and `_caption_trigger_mismatches` — plus the
+exact real-world shape (every caption using one consistent OTHER trigger).
+"""
+from __future__ import annotations
+
+import os
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent
+os.environ["LTX_STATE_DIR"] = tempfile.mkdtemp(prefix="phos-train-trigger-")
+os.environ["PHOSPHENE_ANALYTICS_DISABLED"] = "1"
+os.environ["PHOSPHENE_DISABLE_VERSION_CHECK"] = "1"
+os.environ.setdefault("LTX_PORT", "8314")
+sys.path.insert(0, str(ROOT))
+
+import mlx_ltx_panel as P # noqa: E402
+
+
+class CaptionDeclaredTrigger(unittest.TestCase):
+ def test_canonical_visual_prefix(self) -> None:
+ self.assertEqual(
+ P._caption_declared_trigger(
+ "[VISUAL]: cvjtrn, The subject stands in a doorway.\n[TEXT]: None\n"
+ ),
+ "cvjtrn",
+ )
+
+ def test_naked_trigger_class_word_caption(self) -> None:
+ self.assertEqual(P._caption_declared_trigger("cvjtrn man"), "cvjtrn man")
+
+ def test_comma_separated_falls_back_to_first_segment(self) -> None:
+ self.assertEqual(
+ P._caption_declared_trigger("cvjtrn, a photo of a man"), "cvjtrn"
+ )
+
+ def test_empty_text_returns_none(self) -> None:
+ self.assertIsNone(P._caption_declared_trigger(""))
+ self.assertIsNone(P._caption_declared_trigger(" \n"))
+
+
+class CaptionTriggerMismatches(unittest.TestCase):
+ def _write(self, d: Path, name: str, text: str) -> Path:
+ p = d / name
+ p.write_text(text, encoding="utf-8")
+ return p
+
+ def test_all_files_match_no_mismatches(self) -> None:
+ with tempfile.TemporaryDirectory() as td:
+ d = Path(td)
+ files = [
+ self._write(d, "1.txt", "[VISUAL]: valeriosan, a man\n[TEXT]: None\n"),
+ self._write(d, "2.txt", "[VISUAL]: valeriosan, another shot\n[TEXT]: None\n"),
+ ]
+ mismatched, dominant = P._caption_trigger_mismatches(files, "valeriosan")
+ self.assertEqual(mismatched, [])
+ self.assertIsNone(dominant)
+
+ def test_the_real_world_case_every_caption_uses_a_different_trigger(self) -> None:
+ """Reproduces the exact `valeriosan_v2` shape: every one of N caption
+ files carries the SAME other trigger, none carry the requested one."""
+ with tempfile.TemporaryDirectory() as td:
+ d = Path(td)
+ files = [
+ self._write(
+ d, f"char_{i:03d}.txt",
+ f"[VISUAL]: cvjtrn, The subject stands in scene {i}.\n[TEXT]: None\n",
+ )
+ for i in range(42)
+ ]
+ mismatched, dominant = P._caption_trigger_mismatches(files, "valeriosan")
+ self.assertEqual(len(mismatched), 42, "every file should be flagged")
+ self.assertEqual(dominant, ("cvjtrn", 42))
+
+ def test_partial_mismatch_reports_the_dominant_other_trigger(self) -> None:
+ with tempfile.TemporaryDirectory() as td:
+ d = Path(td)
+ files = [
+ self._write(d, "1.txt", "[VISUAL]: valeriosan, a man\n[TEXT]: None\n"),
+ self._write(d, "2.txt", "[VISUAL]: cvjtrn, a man\n[TEXT]: None\n"),
+ self._write(d, "3.txt", "[VISUAL]: cvjtrn, another shot\n[TEXT]: None\n"),
+ ]
+ mismatched, dominant = P._caption_trigger_mismatches(files, "valeriosan")
+ self.assertEqual(len(mismatched), 2)
+ self.assertEqual(dominant, ("cvjtrn", 2))
+
+ def test_trigger_match_is_case_insensitive(self) -> None:
+ with tempfile.TemporaryDirectory() as td:
+ d = Path(td)
+ files = [self._write(d, "1.txt", "[VISUAL]: VALERIOSAN, a man\n[TEXT]: None\n")]
+ mismatched, dominant = P._caption_trigger_mismatches(files, "valeriosan")
+ self.assertEqual(mismatched, [])
+
+ def test_unreadable_file_is_skipped_not_counted_as_mismatch(self) -> None:
+ with tempfile.TemporaryDirectory() as td:
+ d = Path(td)
+ missing = d / "does_not_exist.txt"
+ mismatched, dominant = P._caption_trigger_mismatches([missing], "valeriosan")
+ self.assertEqual(mismatched, [])
+
+ def test_unparseable_mismatches_still_counted_but_not_dominant(self) -> None:
+ with tempfile.TemporaryDirectory() as td:
+ d = Path(td)
+ files = [self._write(d, "1.txt", "")]
+ mismatched, dominant = P._caption_trigger_mismatches(files, "valeriosan")
+ self.assertEqual(mismatched, ["?"])
+ self.assertIsNone(dominant)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_train_checkpoint_layout.py b/test_train_checkpoint_layout.py
new file mode 100644
index 0000000..9ba3041
--- /dev/null
+++ b/test_train_checkpoint_layout.py
@@ -0,0 +1,124 @@
+#!/usr/bin/env python3
+"""A saved LoRA must be the LoRA that was trained (#62 root cause).
+
+`ltx_trainer_mlx.trainer._save_checkpoint` writes each factor as
+`np.array(mx.transpose(param).astype(mx.float32))`. The params are float32, so
+that is a non-contiguous transposed VIEW, and safetensors.numpy.save_file
+(0.8.0) serializes the raw buffer with strides ignored. Every Train-tab
+adapter — character and voice — was therefore written as the untransposed
+bytes under the transposed shape: same element values, so it attached and
+moved the output, but a delta uncorrelated with the trained one and about half
+its strength. On the 2-image control
+the file as saved fits its images by ~0%; unscrambled, by 41-83%.
+
+`lora_lab.train._patch_contiguous_checkpoint_save` fixes it. Pinned here
+through the REAL `_setup_lora` + `_save_checkpoint` on a tiny real LTXModel:
+the patched file reloads to exactly the in-memory factors, and the unpatched
+one does not (skipped, not failed, on a safetensors that honours strides).
+CPU only; no weights, no GPU lock.
+"""
+from __future__ import annotations
+
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent
+sys.path.insert(0, str(ROOT))
+
+import lora_lab.train_character as tc # noqa: E402
+
+try:
+ import mlx.core as mx
+ import numpy as np
+ from mlx_lm.tuner.lora import LoRALinear
+ from safetensors.numpy import load_file
+
+ import lora_lab.train as lab_train
+ import ltx_trainer_mlx.trainer as trainer_mod
+ from ltx_core_mlx.model.transformer.model import LTXModel, LTXModelConfig
+ from ltx_trainer_mlx.config import LtxTrainerConfig
+ from ltx_trainer_mlx.trainer import LtxvTrainer
+
+ mx.set_default_device(mx.cpu)
+ HAVE_MLX = True
+except ImportError: # pragma: no cover — the gates run in the trainer venv
+ HAVE_MLX = False
+
+TINY = dict(num_layers=1, video_dim=64, audio_dim=32, video_num_heads=2,
+ audio_num_heads=2, video_head_dim=32, audio_head_dim=16,
+ av_cross_num_heads=2, av_cross_head_dim=16)
+
+
[email protected](HAVE_MLX, "needs the trainer venv (mlx + ltx_trainer_mlx)")
+class CheckpointLayout(unittest.TestCase):
+ def setUp(self) -> None:
+ self._orig = getattr(trainer_mod, "_phos_orig_save_safetensors", trainer_mod.save_safetensors)
+ self._tmp = tempfile.TemporaryDirectory()
+
+ def tearDown(self) -> None:
+ trainer_mod.save_safetensors = self._orig
+ lab_train._patch_contiguous_checkpoint_save()
+ self._tmp.cleanup()
+
+ def _save(self) -> tuple[dict, dict]:
+ """Real _setup_lora + _save_checkpoint; returns (in-memory, on-disk)."""
+ mx.random.seed(0)
+ t = LtxvTrainer.__new__(LtxvTrainer)
+ t._transformer = LTXModel(LTXModelConfig(**TINY))
+ cfg = tc.resolve_preset("high", {"rank": 4, "alpha": 4, "steps": 10})
+ d = tc.build_trainer_config(cfg=cfg, data_root=Path("/d"), output_dir=Path(self._tmp.name))
+ # The config validator only checks that the model path exists; no
+ # weights are read. Point it at the temp dir so the gate does not
+ # depend on this machine having the LTX-2.3 pack (#90 class).
+ d["model"]["model_path"] = self._tmp.name
+ t._config = LtxTrainerConfig.model_validate(d)
+ t._setup_lora()
+ mem = {}
+ for path, m in t._transformer.named_modules():
+ if isinstance(m, LoRALinear):
+ m.lora_b = mx.random.normal(m.lora_b.shape) # "trained": B away from zero
+ mem[path] = (np.array(m.lora_a), np.array(m.lora_b))
+ t._global_step, t._checkpoint_paths = 10, []
+ return mem, load_file(str(t._save_checkpoint()))
+
+ @staticmethod
+ def _cosines(mem: dict, disk: dict) -> list[float]:
+ out = []
+ for path, (a, b) in mem.items():
+ A = disk[f"diffusion_model.{path}.lora_A.weight"]
+ B = disk[f"diffusion_model.{path}.lora_B.weight"]
+ want, got = b.T @ a.T, B @ A
+ out.append(float((want * got).sum() / np.linalg.norm(want) / np.linalg.norm(got)))
+ return out
+
+ def test_the_patched_save_is_exactly_the_trained_adapter(self) -> None:
+ lab_train._patch_contiguous_checkpoint_save()
+ mem, disk = self._save()
+ self.assertTrue(mem)
+ for path, (a, b) in mem.items():
+ np.testing.assert_array_equal(disk[f"diffusion_model.{path}.lora_A.weight"], a.T)
+ np.testing.assert_array_equal(disk[f"diffusion_model.{path}.lora_B.weight"], b.T)
+
+ def test_the_unpatched_save_scrambles_the_delta(self) -> None:
+ trainer_mod.save_safetensors = self._orig
+ mem, disk = self._save()
+ cos = self._cosines(mem, disk)
+ if min(cos) > 0.999999:
+ self.skipTest("this safetensors serializes strides; the patch is a no-op here")
+ # Same element values, unrelated delta.
+ self.assertLess(max(abs(c) for c in cos), 0.5, cos)
+
+ def test_the_patch_is_idempotent(self) -> None:
+ lab_train._patch_contiguous_checkpoint_save()
+ first = trainer_mod.save_safetensors
+ lab_train._patch_contiguous_checkpoint_save()
+ self.assertIs(trainer_mod._phos_orig_save_safetensors, self._orig)
+ self.assertIsNot(trainer_mod.save_safetensors, first) # rebinds, never nests
+ mem, disk = self._save()
+ self.assertGreater(min(self._cosines(mem, disk)), 0.999999)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_train_recipe_switches.py b/test_train_recipe_switches.py
new file mode 100644
index 0000000..3c7a5fa
--- /dev/null
+++ b/test_train_recipe_switches.py
@@ -0,0 +1,282 @@
+#!/usr/bin/env python3
+"""The iter7 training-recipe switches from the #62 trainer comparison.
+
+The PR #89 investigation log (tanis2000/Phosphene, branch issue-62,
+docs/ISSUE_62_VALERIOSAN_2026-09-30.md, "Comparison against known-working
+trainers") lists four places the panel's trainer does something neither the
+Lightricks ltx-trainer nor ai-toolkit does. Each is now a spec switch. The default
+is the legacy recipe (the screen in that document found the reference values
+halve fit at equal steps with no gain in trigger binding); the other values
+stay available for A/B runs. What is pinned here:
+
+- the switches resolve, default and refuse typos the same way the panel spec
+ reaches them (flat spec -> advanced -> preset);
+- the optimizer really is bias-corrected and the schedule really decays;
+- the image-only audio patch, run through the REAL vendored loss function on
+ a tiny real LTXModel, cuts the audio stream off the video loss (skip_a2v),
+ puts the stand-in audio at the video's sigma (matched_sigma), or leaves the
+ vendored behaviour alone (clean_zero) — and never touches a run that trains
+ real audio;
+- the target filter can be switched off and back on in one process.
+
+No weights are loaded and nothing here needs the GPU lock: the model is two
+blocks of a few dozen channels.
+"""
+from __future__ import annotations
+
+import json
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent
+sys.path.insert(0, str(ROOT))
+
+import lora_lab.train_character as tc # noqa: E402
+
+try:
+ import mlx.core as mx
+ import mlx.nn as nn
+ from mlx.utils import tree_flatten
+
+ import lora_lab.train as lab_train
+ from ltx_core_mlx.model.transformer.model import LTXModel, LTXModelConfig
+ from ltx_trainer_mlx.config import LtxTrainerConfig
+ from ltx_trainer_mlx.timestep_samplers import ShiftedLogitNormalTimestepSampler
+ from ltx_trainer_mlx.trainer import LtxvTrainer
+ from ltx_trainer_mlx.training_strategies.text_to_video import (
+ TextToVideoConfig,
+ TextToVideoStrategy,
+ )
+ # CPU on purpose: a gate that touches Metal would have to take both GPU
+ # locks (CLAUDE.md §7), and a two-block model gains nothing from it.
+ mx.set_default_device(mx.cpu)
+ HAVE_MLX = True
+except ImportError: # pragma: no cover — the gates run in the trainer venv
+ HAVE_MLX = False
+
+# The defaults are the legacy recipe: the #62 screen found the reference-
+# trainer values halve fit at equal steps with no gain in trigger binding.
+DEFAULTS = {
+ "adam_bias_correction": False,
+ "scheduler_type": "constant",
+ "image_audio": "clean_zero",
+ "lora_target_families": "video",
+}
+LEGACY = {
+ "adam_bias_correction": False,
+ "scheduler_type": "constant",
+ "image_audio": "clean_zero",
+ "lora_target_families": "video",
+}
+
+
+class RecipeResolution(unittest.TestCase):
+ def test_defaults_are_the_legacy_recipe(self) -> None:
+ self.assertEqual(tc.resolve_recipe({}), DEFAULTS)
+ self.assertEqual(tc.resolve_recipe(tc.resolve_preset("high", None)), DEFAULTS)
+
+ def test_the_last_allowed_value_is_the_pre_iter7_behaviour(self) -> None:
+ legacy = {k: allowed[-1] for k, (_d, allowed) in tc.RECIPE_SWITCHES.items()}
+ self.assertEqual(legacy, LEGACY)
+ self.assertEqual(tc.resolve_recipe(legacy), LEGACY)
+
+ def test_a_typo_is_refused_not_defaulted(self) -> None:
+ with self.assertRaises(ValueError):
+ tc.resolve_recipe({"image_audio": "skip"})
+ with self.assertRaises(ValueError):
+ tc.resolve_recipe({"scheduler_type": "cosine"})
+
+ def test_string_booleans_from_a_hand_edited_spec(self) -> None:
+ self.assertFalse(tc.resolve_recipe({"adam_bias_correction": "false"})["adam_bias_correction"])
+ self.assertTrue(tc.resolve_recipe({"adam_bias_correction": "true"})["adam_bias_correction"])
+
+ def test_a_flat_panel_spec_reaches_the_recipe(self) -> None:
+ spec = {
+ "job_id": "t", "trigger": "abctrn", "preset": "high",
+ "images_dir": "/x/images", "output_path": "/x/o.safetensors",
+ "rank": 32, "steps": 740, **LEGACY,
+ "lora_target_families": "all_attention",
+ }
+ with tempfile.TemporaryDirectory() as d:
+ p = Path(d) / "spec.json"
+ p.write_text(json.dumps(spec))
+ loaded = tc.load_spec(p)
+ cfg = tc.resolve_preset(loaded["preset"], loaded["advanced"])
+ self.assertEqual(tc.resolve_recipe(cfg),
+ {**LEGACY, "lora_target_families": "all_attention"})
+
+ def test_the_trainer_config_carries_the_schedule(self) -> None:
+ for sched in ("linear", "constant"):
+ cfg = tc.resolve_preset("high", {"scheduler_type": sched})
+ d = tc.build_trainer_config(cfg=cfg, data_root=Path("/d"), output_dir=Path("/o"))
+ self.assertEqual(d["optimization"]["scheduler_type"], sched)
+
+
[email protected](HAVE_MLX, "needs the trainer venv (mlx + ltx_trainer_mlx)")
+class OptimizerAndSchedule(unittest.TestCase):
+ def _trainer(self, steps: int = 100, **advanced: object) -> "LtxvTrainer":
+ cfg = tc.resolve_preset("high", {"steps": steps, **advanced})
+ d = tc.build_trainer_config(cfg=cfg, data_root=Path("/d"), output_dir=Path("/o"))
+ # Only existence is validated; no weights are read. Not this
+ # machine's LTX-2.3 pack, so the gate runs anywhere (#90 class).
+ d["model"]["model_path"] = str(ROOT)
+ t = LtxvTrainer.__new__(LtxvTrainer)
+ t._config = LtxTrainerConfig.model_validate(d)
+ return t
+
+ def test_bias_correction_is_switched_on_and_off(self) -> None:
+ for enabled in (True, False):
+ lab_train._patch_adam_bias_correction(enabled)
+ t = self._trainer()
+ t._init_optimizer()
+ self.assertIs(t._optimizer.bias_correction, enabled)
+ lab_train._patch_adam_bias_correction(True)
+
+ def test_the_first_corrected_step_is_lr_sized_not_3x(self) -> None:
+ # Corrected Adam's first step is lr * g/|g|; uncorrected it is
+ # lr * 0.1/sqrt(0.001) = 3.16x that. This is the whole of fix A.
+ for enabled, want in ((True, 1.0), (False, 0.1 / 0.001 ** 0.5)):
+ lab_train._patch_adam_bias_correction(enabled)
+ t = self._trainer()
+ t._init_optimizer()
+ m = nn.Linear(4, 4, bias=False)
+ w0 = mx.array(m.weight)
+ g = {"weight": mx.full((4, 4), 0.5)}
+ t._optimizer.update(m, g)
+ step = (w0 - m.weight) / 1e-4
+ self.assertAlmostEqual(float(mx.mean(step).item()), want, places=2)
+ lab_train._patch_adam_bias_correction(True)
+
+ def test_linear_decays_to_a_tenth_and_constant_does_not(self) -> None:
+ t = self._trainer(steps=1000, scheduler_type="linear")
+ sched = t._create_schedule()
+ self.assertAlmostEqual(sched(0), 1e-4)
+ self.assertAlmostEqual(sched(500), 0.55e-4)
+ self.assertAlmostEqual(sched(1000), 1e-5)
+ self.assertIsNone(self._trainer(scheduler_type="constant")._create_schedule())
+
+
+# Two blocks, a few dozen channels: the real block code, none of the cost.
+TINY = dict(num_layers=2, video_dim=64, audio_dim=32, video_num_heads=2,
+ audio_num_heads=2, video_head_dim=32, audio_head_dim=16,
+ av_cross_num_heads=2, av_cross_head_dim=16,
+ av_ca_timestep_scale_multiplier=1000)
+
+
[email protected](HAVE_MLX, "needs the trainer venv (mlx + ltx_trainer_mlx)")
+class ImageOnlyAudioStream(unittest.TestCase):
+ """Through the vendored `_build_loss_fn`, not a copy of it."""
+
+ def tearDown(self) -> None:
+ lab_train._patch_image_only_audio("clean_zero")
+
+ @staticmethod
+ def _batch() -> dict:
+ mx.random.seed(1)
+ return {
+ "latents": {
+ "latents": mx.random.normal((1, 128, 1, 2, 2)),
+ "num_frames": mx.array([1]), "height": mx.array([2]),
+ "width": mx.array([2]), "fps": mx.array([24.0]),
+ },
+ "conditions": {
+ "video_prompt_embeds": mx.random.normal((1, 8, 64)),
+ "audio_prompt_embeds": mx.random.normal((1, 8, 32)),
+ "prompt_attention_mask": mx.ones((1, 8)),
+ },
+ }
+
+ def _trainer(self, mode: str, transformer: object, with_audio: bool = False) -> "LtxvTrainer":
+ lab_train._patch_image_only_audio(mode)
+ t = LtxvTrainer.__new__(LtxvTrainer)
+ t._training_strategy = TextToVideoStrategy(
+ TextToVideoConfig(first_frame_conditioning_p=0.0, with_audio=with_audio))
+ t._feature_extractor = None
+ t._timestep_sampler = ShiftedLogitNormalTimestepSampler()
+ t._transformer = transformer
+ return t
+
+ def _grads(self, mode: str) -> tuple[float, dict]:
+ mx.random.seed(0)
+ model = LTXModel(LTXModelConfig(**TINY))
+ t = self._trainer(mode, model)
+ loss_fn = t._build_loss_fn()
+ batch = self._batch()
+ mx.random.seed(7) # same sigma + noise draw in every arm
+ loss, grads = nn.value_and_grad(t._transformer, loss_fn)(batch)
+ self.assertIs(t._transformer, model, "the stand-in must be swapped back out")
+ return float(loss.item()), dict(tree_flatten(grads))
+
+ @staticmethod
+ def _norm(grads: dict, family: str) -> float:
+ parts = [mx.sum(v.astype(mx.float32) ** 2) for k, v in grads.items()
+ if f".{family}." in k]
+ return float(mx.sqrt(sum(parts)).item())
+
+ def test_skip_a2v_cuts_the_audio_stream_off_the_video_loss(self) -> None:
+ _, g = self._grads("skip_a2v")
+ for fam in ("audio_to_video_attn", "audio_attn1", "audio_attn2", "video_to_audio_attn"):
+ self.assertEqual(self._norm(g, fam), 0.0, fam)
+ self.assertGreater(self._norm(g, "attn2"), 0.0, "video text cross-attn still trains")
+
+ def test_the_old_clean_audio_reaches_the_video_and_matched_sigma_differs(self) -> None:
+ loss_clean, g_clean = self._grads("clean_zero")
+ loss_matched, g_matched = self._grads("matched_sigma")
+ self.assertGreater(self._norm(g_clean, "audio_to_video_attn"), 0.0)
+ self.assertGreater(self._norm(g_matched, "audio_to_video_attn"), 0.0)
+ self.assertNotEqual(loss_clean, loss_matched, "audio sigma must reach the model")
+
+ def test_what_each_mode_hands_the_model(self) -> None:
+ seen: list[dict] = []
+
+ def recorder(**kw):
+ seen.append(kw)
+ return mx.zeros(kw["video_latent"].shape), mx.zeros(kw["audio_latent"].shape)
+
+ for mode in ("clean_zero", "matched_sigma", "skip_a2v"):
+ seen.clear()
+ batch = self._batch()
+ mx.random.seed(7)
+ self._trainer(mode, recorder)._build_loss_fn()(batch)
+ kw = seen[0]
+ ats, sigma = kw["audio_timesteps"], kw["timestep"]
+ if mode == "matched_sigma":
+ self.assertTrue(bool(mx.all(ats == sigma.reshape(-1, 1)).item()))
+ self.assertGreater(float(sigma[0].item()), 0.0)
+ else:
+ self.assertEqual(float(mx.max(mx.abs(ats)).item()), 0.0)
+ self.assertEqual(kw.get("perturbations") is not None, mode == "skip_a2v")
+
+ def test_a_run_that_trains_real_audio_is_never_touched(self) -> None:
+ for mode in ("skip_a2v", "matched_sigma"):
+ t = self._trainer(mode, object(), with_audio=True)
+ self.assertEqual(t._build_loss_fn().__name__, "loss_fn")
+
+ def test_unknown_mode_is_refused(self) -> None:
+ with self.assertRaises(ValueError):
+ lab_train._patch_image_only_audio("skip")
+
+
[email protected](HAVE_MLX, "needs the trainer venv (mlx + ltx_trainer_mlx)")
+class TargetFamilies(unittest.TestCase):
+ def tearDown(self) -> None:
+ lab_train._patch_lora_target_exclude_audio(True)
+
+ def test_the_filter_switches_off_and_back_on(self) -> None:
+ import ltx_trainer_mlx.trainer as trainer_mod
+
+ model = LTXModel(LTXModelConfig(**TINY))
+ targets = ["to_q", "to_k", "to_v", "to_out"]
+ counts = {}
+ for enabled in (True, False, True):
+ lab_train._patch_lora_target_exclude_audio(enabled)
+ counts[enabled] = len(trainer_mod._find_lora_targets(model, targets))
+ # Per block: 3 kept families x 4 vs all 6 x 4. Two blocks.
+ self.assertEqual(counts[True], 2 * 3 * 4)
+ self.assertEqual(counts[False], 2 * 6 * 4)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/test_va06_a2v_estimate.py b/test_va06_a2v_estimate.py
index e42fde6..6d2f58e 100644
--- a/test_va06_a2v_estimate.py
+++ b/test_va06_a2v_estimate.py
@@ -98,7 +98,12 @@ class TheRoute(unittest.TestCase):
self.assertGreater(body["minutes"], 0)
def test_explicit_frames_and_canvas_are_honoured(self):
- code, body = self.get(frames=241, width=1024, height=576)
+ # On a standard-tier Mac (issue #90): a <48 GB Mac prices the canvas
+ # its tier clamps to (768x448) by design, which is the exact clamp
+ # run_job_inner applies, not a request being ignored.
+ with mock.patch.object(P, "SYSTEM_TIER", "standard"), \
+ mock.patch.object(P, "SYSTEM_CAPS", P.CAPABILITIES["standard"]):
+ code, body = self.get(frames=241, width=1024, height=576)
self.assertEqual(code, 200)
self.assertEqual(body["width"], 1024)
self.assertEqual(body["height"], 576)
diff --git a/test_vc01_ltx_estimate_honesty.py b/test_vc01_ltx_estimate_honesty.py
index cd8a382..bbe2e22 100644
--- a/test_vc01_ltx_estimate_honesty.py
+++ b/test_vc01_ltx_estimate_honesty.py
@@ -59,9 +59,28 @@ class _Mac:
self._path_patch.start()
P.SYSTEM_RAM_GB = self.ram_gb
P._HW_CHIP_FAMILY = self.chip
+ # ...on the full, unclamped canvases (issue #90). The quality table
+ # bakes the BOOTING Mac's t2v_max_dim in at import, so on a <48 GB
+ # Mac running this suite every Mac below was priced on clamped,
+ # non-native canvases and balanced_5s stopped being a measured cell.
+ # Pinned to the standard tier rather than derived from `ram_gb`:
+ # these tests vary chip and RAM FACTOR at a fixed canvas, which is
+ # how the measured rows were taken.
+ tier = "standard"
+ self._tier_patches = [
+ mock.patch.object(P, "SYSTEM_TIER", tier),
+ mock.patch.object(P, "SYSTEM_CAPS", P.CAPABILITIES[tier]),
+ ]
+ for patch in self._tier_patches:
+ patch.start()
+ self._tier_patches.append(
+ mock.patch.object(P, "LTX_QUALITIES", P._ltx_qualities()))
+ self._tier_patches[-1].start()
return P._build_ltx_tiers()
def __exit__(self, *exc):
+ for patch in reversed(self._tier_patches):
+ patch.stop()
self._path_patch.stop()
P.SYSTEM_RAM_GB, P._HW_CHIP_FAMILY, env = self.saved
if env is not None:
@@ -181,12 +200,19 @@ class SelfCalibration(unittest.TestCase):
def test_record_from_job_computes_the_right_ratio(self):
"""A finished balanced/5s job that took exactly 2x the chip-only
prediction should record a ~2.0 ratio."""
- with mock.patch.object(P, "_hw_chip_family", lambda: "M4 Max"), \
- mock.patch.object(P, "SYSTEM_RAM_GB", 64.0):
- base_min = P.LTX_TIERS["balanced_5s"]["eta_min"] # cal factor 1.0 here
+ # Booted as an uncalibrated 64 GB M4 Max (issue #90). The baseline is
+ # read from the tier table priced at IMPORT and the factor it was
+ # priced with (_ETA_CAL_PRICED), so with the live module tables this
+ # recorded 2.6 on a Mac with a learned 1.3 correction and 1.18 on an
+ # M4 Pro: the mocks below never reached the price being compared.
+ with _Mac(64.0, "M4 Max", calib_path=self.calib_path) as tiers, \
+ mock.patch.object(P, "LTX_TIERS", tiers), \
+ mock.patch.dict(P._ETA_CAL_PRICED, {"ltx": 1.0}), \
+ mock.patch.object(P, "_hw_chip_family", lambda: "M4 Max"):
+ base_min = tiers["balanced_5s"]["eta_min"]
job = {"status": "done", "elapsed_sec": base_min * 60.0 * 2.0,
"params": {"engine": "ltx", "quality": "balanced",
- "frames": P.LTX_TIERS["balanced_5s"]["frames"]}}
+ "frames": tiers["balanced_5s"]["frames"]}}
P._record_eta_calibration_from_job(job)
self.assertAlmostEqual(P._eta_calibration_factor("ltx"), 2.0, delta=0.05)
diff --git a/test_yue2_train_voice.py b/test_yue2_train_voice.py
index ecbe466..d71644f 100644
--- a/test_yue2_train_voice.py
+++ b/test_yue2_train_voice.py
@@ -30,16 +30,29 @@ import mlx.nn as nn
import numpy as np
ROOT = Path(__file__).resolve().parent
+ENGINE_SRC = ROOT / "yue2-mlx" / "vendor" / "yue" / "src"
sys.path.insert(0, str(ROOT / "scripts" / "music"))
-sys.path.insert(0, str(ROOT / "yue2-mlx" / "vendor" / "yue" / "src"))
+sys.path.insert(0, str(ENGINE_SRC))
os.environ.setdefault("LTX_STATE_DIR", tempfile.mkdtemp(prefix="yue2-voice-state-"))
os.environ["PHOSPHENE_ANALYTICS_DISABLED"] = "1"
os.environ["PHOSPHENE_DISABLE_VERSION_CHECK"] = "1"
-import yue2_lora as L # noqa: E402
-import yue2_train_voice as V # noqa: E402
-from yue2.protocol import (CODEC_OFFSET, MUSIC_END, MUSIC_START, # noqa: E402
- SongRequest, token_prefixes)
+# Every rule below is checked against the music ENGINE's own code
+# (`yue2.protocol.token_prefixes`), which lives in the yue2-mlx/ checkout that
+# "Install the music engine" clones at its pin: gitignored, optional, and
+# absent on any install that never installed music. Without it there is
+# nothing to check the trainer against, so every case SKIPS with that reason
+# (see the bottom of this file) instead of the module dying at import with
+# "No module named 'yue2'" (issue #90).
+ENGINE_PRESENT = (ENGINE_SRC / "yue2" / "protocol.py").is_file()
+ENGINE_MISSING = (f"music engine checkout not installed ({ENGINE_SRC / 'yue2'} "
+ "missing) - run 'Install the music engine' to check the "
+ "trainer against it")
+if ENGINE_PRESENT:
+ import yue2_lora as L # noqa: E402
+ import yue2_train_voice as V # noqa: E402
+ from yue2.protocol import (CODEC_OFFSET, MUSIC_END, # noqa: E402
+ MUSIC_START, SongRequest, token_prefixes)
HIDDEN, KV, INTERMEDIATE, LAYERS, RANK = 16, 8, 32, 2, 4
@@ -547,5 +560,11 @@ class CommandLine(unittest.TestCase):
self.assertIn("No trainable windows", done.stdout + done.stderr)
+if not ENGINE_PRESENT:
+ for _name, _obj in list(globals().items()):
+ if isinstance(_obj, type) and issubclass(_obj, unittest.TestCase):
+ globals()[_name] = unittest.skip(ENGINE_MISSING)(_obj)
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/webapp/index.html b/webapp/index.html
index cf7895e..c7690ad 100644
--- a/webapp/index.html
+++ b/webapp/index.html
@@ -406,6 +406,7 @@
chooses any total anchor count from 3–8. -->
<button type="button" class="mode-chip pill-btn" data-mode="keyframe" data-kf-default="multi">Keyframes<span class="mc-sub sub">3–8 frames</span></button>
<button type="button" class="mode-chip pill-btn" data-mode="extend">Extend<span class="mc-sub sub">continue a clip</span></button>
+ <button type="button" class="mode-chip pill-btn" data-mode="v2a" data-h3-only title="Hailuo H3 — give a silent (or any) clip new sound made for its picture. The picture is kept exactly.">Add sound<span class="mc-sub sub">your clip → its sound</span></button>
<!-- VA-01: lip-sync's only entrance used to be Audio tab → Music video
→ a folded "One shot (audio → video)" row that shared its name
with the unrelated One Shot tab — nothing on the Video mode bar
@@ -663,7 +664,7 @@
</div>
<div class="mode-only" id="keyframeSection">
- <h2>Start frame (frame 0)</h2>
+ <h2>Start frame (frame 0)<span class="h2-hint" data-h3-only> · optional on Hailuo H3</span></h2>
<div class="picker" data-key="start_image">
<div class="picker-drop" id="picker_drop_start_image">
<div class="picker-empty">
@@ -730,16 +731,22 @@
extend-mode preset. Lives inside the composer card so the
prompt sits below the source picker, mirroring the I2V flow. -->
<div class="mode-only" id="extendSection">
- <h2>Source video</h2>
+ <h2><span class="extend-only">Source video</span><span class="v2a-only">Clip to add sound to</span></h2>
+ <!-- 4.19: Hailuo H3 versions of this panel. Extend continues the
+ clip from its last 17 frames AND their sound; Add sound keeps
+ the picture exactly and generates only its audio. Both read
+ the same source picker below. -->
+ <div class="hint h3-mode-hint extend-only" data-h3-only>Hailuo H3 continues this clip from its last 17 frames and their sound, so the motion and the voice carry on instead of restarting. Any clip works; an H3 clip continues on its own canvas. Describe what happens next in the prompt.</div>
+ <div class="hint h3-mode-hint v2a-only" data-h3-only>Hailuo H3 watches the clip and makes its sound — ambience, footsteps, impacts, voices — in sync with the picture. The picture is kept exactly as it is. Describe the sound you want in the prompt, or leave it short and H3 fills in what it sees.</div>
<!-- VA-13: the clamp used to be a log line nobody saw until the
6-16 min render finished softer than the clip it extended.
extendClampNote is filled by refreshExtendClampNote() (from
BOOT.tier.extend_max_dim) on boot and on every mode switch
into Extend, so it's said BEFORE Generate every time. -->
- <div class="hint" id="extendClampNote" style="margin-bottom:6px"></div>
+ <div class="hint" id="extendClampNote" style="margin-bottom:6px" data-ltx-only></div>
<select id="extendSrcSelect" onchange="document.getElementById('video_path').value=this.value"></select>
<input name="video_path" id="video_path" placeholder="/path/to/source.mp4" style="margin-top:6px">
- <div class="row" style="margin-top:8px">
+ <div class="row extend-only" style="margin-top:8px">
<div>
<label class="lbl">Extend by (seconds)</label>
<!-- min must align to step from value=2: with min=0.4 step=0.5 the
@@ -753,7 +760,7 @@
<input type="hidden" name="extend_frames" id="extend_frames" value="6">
<div class="hint" id="extendDurationHint" style="margin-top:4px" title="6 latent frames × 8 video frames at 24 fps">Adds 2.0 s</div>
</div>
- <div>
+ <div data-ltx-only>
<label class="lbl">Direction</label>
<select name="extend_direction" id="extend_direction">
<option value="after" selected>After</option>
@@ -769,7 +776,7 @@
sampler's stage_1/stage_2 step model. Same labels make it
visually clear both intents live in the Q8 family without
forcing the implementation onto the HQ sampler. -->
- <label class="lbl" style="margin-top:10px">Quality</label>
+ <label class="lbl" style="margin-top:10px" data-ltx-only>Quality</label>
<!-- VA-12: the "N steps · ~M min" text below is the pre-JS
fallback only — applyExtendPillPrices() (characters.js)
overwrites both spans from the server's real, clamped-canvas
@@ -777,7 +784,7 @@
switch. Static fallback values must still be the REAL
defaults (8 steps, not the old 12 this pill used to submit —
see setExtendMode). -->
- <div class="pill-group cols-2 quality-strip" id="extendModeGroup">
+ <div class="pill-group cols-2 quality-strip" id="extendModeGroup" data-ltx-only>
<button type="button" class="pill-btn pill-quality active" data-extend-mode="fast">
<span class="ql-name">Q8 Draft</span>
<span class="q-spec ql-spec sub">8 steps · 64 GB safe</span>
@@ -791,12 +798,12 @@
</div>
<input type="hidden" name="extend_steps" id="extend_steps" value="8">
<input type="hidden" name="extend_cfg" id="extend_cfg" value="1.0">
- <div class="hint">Each latent ≈ 8 frames (~0.33s). Q8 Pro runs the upstream Lightricks defaults but pushes 1280×704 into swap below the Roomy tier — it only appears there. Stick with Q8 Draft unless you've got more RAM.</div>
+ <div class="hint" data-ltx-only>Each latent ≈ 8 frames (~0.33s). Q8 Pro runs the upstream Lightricks defaults but pushes 1280×704 into swap below the Roomy tier — it only appears there. Stick with Q8 Draft unless you've got more RAM.</div>
<!-- VA-13: Extend clamps to this Mac's tier cap and hands back
whatever it renders at, softer than the source it extended
into. This queues the fix behind it instead of leaving the
user to notice and do it by hand. -->
- <label class="check" style="margin-top:8px">
+ <label class="check extend-only" style="margin-top:8px" data-ltx-only>
<input type="checkbox" name="extend_face_fix_after" id="extendFaceFixAfter" value="1">
Also run Upscale &amp; Face Fix after
</label>
@@ -3897,6 +3904,21 @@ The last line"></textarea>
<span class="cz-sum">a picture and a stretch of audio → one clip whose mouth follows the track</span>
</summary>
<div class="cz-body">
+ <!-- 4.19: which engine performs the track. LTX (the built-in a2v
+ pipeline) or Hailuo H3, which holds the supplied soundtrack and
+ renders the picture to it — face, body and room, with the
+ runner's own lip-sync contract. Hidden until the installed H3
+ runner can take a soundtrack (BOOT/status.h3.audio_drive). -->
+ <div class="a2v-engine" id="a2vEngineRow" hidden>
+ <span class="mf-label">Engine</span>
+ <div class="pill-group cols-2" id="a2vEngineGroup" role="radiogroup" aria-label="Lip-sync engine">
+ <button type="button" class="pill-btn active" role="radio" aria-checked="true" data-a2v-engine="ltx" onclick="setA2vEngine('ltx')">LTX<span class="sub">your audio drives the picture</span></button>
+ <button type="button" class="pill-btn" role="radio" aria-checked="false" data-a2v-engine="h3" onclick="setA2vEngine('h3')">Hailuo H3<span class="sub">performs it — face, body and room</span></button>
+ </div>
+ <div class="pill-group cols-3 a2v-h3-only" id="a2vH3QualityGroup" role="radiogroup" aria-label="Hailuo H3 canvas"></div>
+ <div class="hint a2v-h3-only" id="a2vH3Note">H3 keeps your track exactly as it is and renders the picture to it. Start on a closed-mouth, face-forward picture and say what the performance looks like — never "still" or "static".</div>
+ </div>
+
<div class="composer-card">
<div class="composer-refs">
<div class="show">
@@ -4000,12 +4022,12 @@ The last line"></textarea>
<div class="quick-settings">
<div>
<div class="mini-fields">
- <div class="mf-cell">
+ <div class="mf-cell a2v-ltx-only">
<span class="mf-label">Width</span>
<input type="number" id="audioStudioWidth" value="1024" min="256" max="1920" step="32"
oninput="audioStudioDurationChanged()">
</div>
- <div class="mf-cell">
+ <div class="mf-cell a2v-ltx-only">
<span class="mf-label">Height</span>
<input type="number" id="audioStudioHeight" value="576" min="256" max="1920" step="32"
oninput="audioStudioDurationChanged()">
@@ -4061,7 +4083,7 @@ The last line"></textarea>
decide with the same information the maintainer has. -->
<div class="hint" id="audioStudioDurationWarn" style="margin-top:4px; display:none"></div>
</div>
- <div class="mf-cell" style="margin-top:8px">
+ <div class="mf-cell a2v-ltx-only" style="margin-top:8px">
<span class="mf-label">Audio conditioning strength</span>
<!-- Starts on AUTO and stays there until the thumb is dragged:
the two A2V pipelines read this number differently and only
@@ -4383,6 +4405,17 @@ The last line"></textarea>
</svg>
<span class="po-act-label">Extend</span>
</button>
+ <!-- 4.19: Add sound — Hailuo H3 scores the clip on screen (its
+ picture is kept exactly). Shown only when the installed H3 runner
+ can (queue.js toggles it with the other player actions). -->
+ <button id="addSoundBtn" class="po-act" type="button" style="display:none"
+ onclick="useAsAddSoundSource()" title="Give this clip new sound made for its picture, with Hailuo H3 — the picture is kept exactly as it is">
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
+ <path d="M2.5 6.5 H5 L8.5 3.5 V12.5 L5 9.5 H2.5 Z" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
+ <path d="M11 6 Q12.5 8 11 10 M12.8 4.5 Q15.4 8 12.8 11.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
+ </svg>
+ <span class="po-act-label">Add sound</span>
+ </button>
<!-- VA-36 / "Continue the song": on a lip-sync (a2v) clip, Extend
regenerates LTX's own joint audio over the new frames — a
singing shot would "continue" with invented gibberish instead
diff --git a/webapp/js/boot.js b/webapp/js/boot.js
index fe9f24f..0c17fc5 100644
--- a/webapp/js/boot.js
+++ b/webapp/js/boot.js
@@ -73,7 +73,11 @@ function setKeyframeMode(n) {
const countSelect = document.getElementById('keyframe_count');
if (countSelect && n >= 3) countSelect.value = String(n);
const hint = document.getElementById('keyframeHint');
- if (hint) {
+ if (hint && document.body.dataset.engine === 'h3') {
+ hint.textContent = n >= 3
+ ? `Hailuo H3 passes through every still at its At(s) time and lands exactly on the end frame — with the sound and dialogue made around them.`
+ : 'Hailuo H3 starts on the start frame and lands exactly on the end frame. The start frame is optional: leave it empty and H3 invents the opening, then arrives at your end frame.';
+ } else if (hint) {
hint.textContent = n >= 3
? `${n} Keyframes needs Q8 — it always renders the Q8 two-stage pass, whatever the Quality pill says. Intermediate beats are locked at their At(s) times below.`
: 'FFLF needs Q8 — it always renders the Q8 two-stage pass, whatever the Quality pill says. The model interpolates between the first and last frames.';
@@ -736,7 +740,10 @@ function setMode(mode) {
// NOTE: 'restore' (Colorize) is also NOT in this list — its IC-LoRA was
// trained against the Q4 distilled checkpoint, so it RUNS on the Q4 tier.
// Don't add either back here or you'll break the feature on sub-48GB.
- if (window.PHOSPHENE_CAP_TIER === 'q4' && (mode === 'keyframe' || mode === 'extend')) {
+ // Hailuo H3 renders both on its own engine (its Q8 lane fits 36 GB+), so
+ // the LTX tier rule does not apply while H3 is the engine.
+ if (window.PHOSPHENE_CAP_TIER === 'q4' && (mode === 'keyframe' || mode === 'extend')
+ && document.body.dataset.engine !== 'h3') {
console.warn(`setMode(${mode}): not available on Q4 tier — snapping to t2v`);
mode = 't2v';
}
@@ -886,6 +893,9 @@ function setMode(mode) {
// Studio to a video mode.
if (typeof renderLorasList === 'function') renderLorasList();
document.getElementById('mode').value = mode;
+ // The form's mode on <body>, for the engine-specific folds in panel.css
+ // (e.g. H3's Length strip means nothing while extending a clip).
+ document.body.dataset.vmode = mode;
document.querySelectorAll('#modeGroup .pill-btn').forEach(b => {
if (mode === 'keyframe') {
b.classList.toggle('active', isKeyframeModeChipActive(b, window._kfMode));
diff --git a/webapp/js/characters.js b/webapp/js/characters.js
index e859d9f..11746f7 100644
--- a/webapp/js/characters.js
+++ b/webapp/js/characters.js
@@ -502,7 +502,87 @@ function openLipSyncEntry() {
});
}
+// ---- 4.19: Lip-sync on Hailuo H3 -------------------------------------------
+// The engine row appears once the installed H3 runner can hold a soundtrack.
+// LTX stays the default; the choice is remembered per browser. On H3 the
+// canvas comes from H3's own quality cells (Draft / Standard / High) instead
+// of free Width × Height, and the LTX-only conditioning knob folds away.
+const A2V_ENGINE_KEY = 'phos_a2v_engine';
+const A2V_H3_QUALITY_KEY = 'phos_a2v_h3_quality';
+globalThis.A2V_ENGINE = (() => {
+ try { return localStorage.getItem(A2V_ENGINE_KEY) === 'h3' ? 'h3' : 'ltx'; } catch (e) { return 'ltx'; }
+})();
+globalThis.A2V_H3_QUALITY = (() => {
+ try { return localStorage.getItem(A2V_H3_QUALITY_KEY) || 'high'; } catch (e) { return 'high'; }
+})();
+
+function a2vH3Offered() {
+ return typeof h3CanServe === 'function' && h3CanServe('a2v');
+}
+
+function a2vEngineActive() {
+ return (A2V_ENGINE === 'h3' && a2vH3Offered()) ? 'h3' : 'ltx';
+}
+
+function setA2vEngine(id) {
+ A2V_ENGINE = (id === 'h3') ? 'h3' : 'ltx';
+ try { localStorage.setItem(A2V_ENGINE_KEY, A2V_ENGINE); } catch (e) {}
+ renderA2vEngineRow();
+ if (typeof audioStudioDurationChanged === 'function') audioStudioDurationChanged();
+}
+
+function setA2vH3Quality(key) {
+ A2V_H3_QUALITY = key;
+ try { localStorage.setItem(A2V_H3_QUALITY_KEY, key); } catch (e) {}
+ renderA2vEngineRow();
+ if (typeof audioStudioDurationChanged === 'function') audioStudioDurationChanged();
+}
+
+// The H3 canvases a lip-sync can use: every offered quality (not the lab
+// Preview canvas).
+function _a2vH3Qualities() {
+ const qs = ((window._ENGINE_PROBES || {}).h3 || {}).qualities || [];
+ // Not Fast HD: its Face Fix redraws the mouth the soundtrack just drove.
+ return qs.filter(q => q && q.offered !== false && q.key !== 'preview' && !q.fast_hd);
+}
+
+function renderA2vEngineRow() {
+ const row = document.getElementById('a2vEngineRow');
+ const det = document.getElementById('mvOneShotDetails');
+ const offered = a2vH3Offered();
+ if (row) row.hidden = !offered;
+ const active = a2vEngineActive();
+ if (det) det.dataset.a2vEngine = active;
+ document.querySelectorAll('#a2vEngineGroup [data-a2v-engine]').forEach(b => {
+ const on = b.dataset.a2vEngine === active;
+ b.classList.toggle('active', on);
+ b.setAttribute('aria-checked', on ? 'true' : 'false');
+ });
+ const qg = document.getElementById('a2vH3QualityGroup');
+ if (qg && offered) {
+ const qs = _a2vH3Qualities();
+ if (qs.length && !qs.some(q => q.key === A2V_H3_QUALITY)) A2V_H3_QUALITY = qs[Math.min(2, qs.length - 1)].key;
+ qg.innerHTML = qs.map(q => `<button type="button" class="pill-btn${q.key === A2V_H3_QUALITY ? ' active' : ''}"
+ role="radio" aria-checked="${q.key === A2V_H3_QUALITY}" onclick="setA2vH3Quality('${escapeHtml(q.key)}')">
+ ${escapeHtml(q.label)}<span class="sub">${escapeHtml(q.canvas || '')}</span></button>`).join('');
+ }
+}
+
+// Minutes for an H3 lip-sync of `sec` seconds at the chosen canvas: the 5 s
+// cell's own price (Fast when installed) times the windows the length needs.
+function a2vH3EstimateMin(sec) {
+ if (typeof h3CellFor !== 'function' || typeof h3CellEtaMin !== 'function') return null;
+ const cell = h3CellFor(A2V_H3_QUALITY, '5s');
+ if (!cell) return null;
+ const per = h3CellEtaMin(cell);
+ if (!(per > 0)) return null;
+ const frames = Math.round(sec * 24);
+ const windows = frames <= 124 ? 1 : 1 + Math.ceil((frames - 124) / 123);
+ return per * windows;
+}
+
function audioStudioInit() {
+ renderA2vEngineRow();
if (musicComposeActive()) setMainOutputsFilter('audio');
// The Drive-video pane is the Music video pane now (music.js owns it; the
// single-clip form this function wires is the "One shot" disclosure at the
@@ -929,7 +1009,14 @@ function audioStudioDurationChanged(val) {
const frames = _a2vFramesForSeconds(sec);
const w = parseInt((document.getElementById('audioStudioWidth') || {}).value || '1024', 10);
const h = parseInt((document.getElementById('audioStudioHeight') || {}).value || '576', 10);
- if (typeof a2vUpdateEstimate === 'function') a2vUpdateEstimate(frames, w, h);
+ if (typeof a2vEngineActive === 'function' && a2vEngineActive() === 'h3') {
+ const el = document.getElementById('audioStudioEstimate');
+ const m = a2vH3EstimateMin(sec);
+ const cell = (typeof h3CellFor === 'function') ? h3CellFor(A2V_H3_QUALITY, '5s') : null;
+ if (el) el.textContent = cell
+ ? `Hailuo H3 · ${cell.width}×${cell.height}` + (m ? ` · about ${typeof h3FmtEtaMin === 'function' ? h3FmtEtaMin(m) : Math.round(m) + ' min'} on this Mac` : '')
+ : 'Hailuo H3';
+ } else if (typeof a2vUpdateEstimate === 'function') a2vUpdateEstimate(frames, w, h);
const warn = document.getElementById('audioStudioDurationWarn');
if (!warn) return;
const area = (w > 0 && h > 0) ? w * h : 1024 * 576;
@@ -1243,6 +1330,23 @@ function a2vLoadParams(p) {
const autoOn = ['1', 'true', 'on', 'yes'].includes(String(p.audio_stem_auto ?? '').trim().toLowerCase());
stemEl.checked = autoOn || !!String(p.audio_stem || '').trim();
}
+ // 4.19: an H3 lip-sync reopens on H3, at its canvas and its own length
+ // (24 fps frames, not LTX's 8k+1 grid).
+ if (String(p.engine || '') === 'h3') {
+ if (p.h3_quality) {
+ A2V_H3_QUALITY = String(p.h3_quality);
+ try { localStorage.setItem(A2V_H3_QUALITY_KEY, A2V_H3_QUALITY); } catch (e) {}
+ }
+ if (typeof setA2vEngine === 'function') setA2vEngine('h3');
+ const f24 = parseInt(p.h3_a2v_frames || p.frames, 10);
+ const slider = document.getElementById('audioStudioDuration');
+ if (Number.isFinite(f24) && f24 > 0 && slider) {
+ slider.value = String(Math.max(1, Math.round(f24 / 24)));
+ audioStudioDurationChanged(slider.value);
+ }
+ } else if (p.mode === 'a2v' && typeof setA2vEngine === 'function') {
+ setA2vEngine('ltx');
+ }
audioStudioRenderLoraNote();
}
@@ -1522,6 +1626,14 @@ async function audioStudioGenerate(opts) {
fd.set('mode', 'a2v');
fd.set('prompt', prompt);
fd.set('audio', AUDIO_STUDIO.audioPath);
+ const _onH3 = typeof a2vEngineActive === 'function' && a2vEngineActive() === 'h3';
+ if (_onH3) {
+ // Hailuo H3 lip-sync: the canvas is the H3 cell's; the length is the
+ // seconds asked for (24 fps, H3's own clock — not LTX's 8k+1 grid).
+ fd.set('engine', 'h3');
+ fd.set('h3_quality', A2V_H3_QUALITY);
+ fd.set('h3_length', '5s');
+ }
if (a2vImagePath) {
fd.set('image', a2vImagePath);
// VA-02: the crop-preview overlay's drag position for this picker.
@@ -1530,9 +1642,9 @@ async function audioStudioGenerate(opts) {
}
fd.set('width', String(w));
fd.set('height', String(h));
- fd.set('frames', String(frames));
+ fd.set('frames', String(_onH3 ? Math.max(24, Math.round((draft ? Math.min(3, dur) : dur) * 24)) : frames));
fd.set('seed', String(seed));
- if (audioConditioningScale !== null && !Number.isNaN(audioConditioningScale)) {
+ if (!_onH3 && audioConditioningScale !== null && !Number.isNaN(audioConditioningScale)) {
fd.set('audio_conditioning_scale', String(audioConditioningScale));
}
fd.set('audio_start_time', String(audioStart));
@@ -4504,6 +4616,10 @@ function updatePromptPlaceholder() {
prompt.placeholder = 'Describe how the reference image should move, plus sound cues. The image anchors frame 0; the prompt directs the full clip.';
} else if (currentMode === 'ingredients') {
prompt.placeholder = "Describe WHAT'S in the reference sheet — each character, prop, and the location. e.g. a friendly cartoon hedgehog with rounded chestnut fur; a green coiled garden hose; the bright interior of a 'Greenfield' garden store. (The Action field above describes the shot itself.)";
+ } else if (currentMode === 'v2a') {
+ prompt.placeholder = 'Describe the sound this clip should have — e.g. a busy kitchen, a pan sizzling, a knife on a board, two people murmuring off-screen. The picture stays exactly as it is.';
+ } else if (currentMode === 'extend' && document.body.dataset.engine === 'h3') {
+ prompt.placeholder = 'What happens next — the action, the camera, and the sound. Hailuo H3 carries on from the last 17 frames and their sound.';
} else if (currentMode === 'control') {
prompt.placeholder = "Describe the NEW subject/scene to paint onto the control clip's motion and structure — plus sound cues. e.g. a red origami crane unfolding on a black table · soft paper rustle. The control video drives the composition; this prompt swaps what's in it.";
} else {
@@ -4592,6 +4708,7 @@ document.querySelectorAll('#extendModeGroup .pill-btn').forEach(b => b.onclick =
// the global scope; everything NOT listed here is private to this module.
Object.assign(globalThis, {
musicComposeActive, musicInit, updateMusicAvailability, audioModeSet, musicPick, musicFormChanged,
+ setA2vEngine, setA2vH3Quality, renderA2vEngineRow, a2vEngineActive,
musicFormParams, musicGenerate, useTrackInA2V, audioStudioUseAudio, openMusicInstallCard, closeMusicInstallCard,
musicInstallRender, musicInstallStart, musicInstallStop,
// Music Studio (cover): the install card's button is generated markup.
diff --git a/webapp/js/engines.js b/webapp/js/engines.js
index ccde719..68602ef 100644
--- a/webapp/js/engines.js
+++ b/webapp/js/engines.js
@@ -386,6 +386,8 @@ function _h3IsI2V() {
// Would THIS cell render Fast, as things stand?
function h3TriStepOn(cell) {
cell = cell || h3CurrentCell();
+ // Fast HD is the Fast pass by definition (the server forces it too).
+ if (cell && cell.fast_hd) return !!(cell.tristep_min != null && h3TriStepState().available);
return !!(cell && cell.tristep_min != null
&& h3TriStepState().available && h3SpeedPref() === 'fast');
}
@@ -412,6 +414,8 @@ function _h3EtaPlain(s) {
// fixed seconds for a pinned Steps count); nothing here models anything.
function h3CellEtaMin(cell, opts) {
if (!cell) return 0;
+ // Fast HD is priced whole: the Fast H3 pass plus its Upscale & Face Fix.
+ if (cell.fast_hd) return (_h3TriStepMin(cell) || cell.tristep_min || 0) + (cell.facefix_min || 0);
opts = opts || {};
const fast = (opts.fast != null) ? opts.fast : h3TriStepOn(cell);
if (fast && cell.tristep_min != null) return _h3TriStepMin(cell);
@@ -445,6 +449,7 @@ function h3FmtEtaMin(m) {
// wherever it priced that state (that is where a MEASURED wall clock lives).
function h3CellEta(cell, opts) {
if (!cell) return '';
+ if (cell.fast_hd) return h3FmtEtaMin(h3CellEtaMin(cell));
opts = opts || {};
const fast = (opts.fast != null) ? opts.fast : h3TriStepOn(cell);
if (fast && cell.tristep_min != null) return _h3TriStepEta(cell);
@@ -703,13 +708,16 @@ document.querySelectorAll('#h3SpeedGroup [data-h3-speed]').forEach(b => {
// The Upscale & Face Fix pair, priced from the cell's own numbers: the
// checkbox beside Generate and the estimate line in the footer.
function h3FaceFixOn() {
+ const cell = (typeof h3CurrentCell === 'function') ? h3CurrentCell() : null;
+ if (cell && cell.fast_hd) return true; // Fast HD always finishes with it
return ((document.getElementById('h3_upscale') || {}).value) === 'ltx_x2';
}
function _h3SyncFaceFixEta() {
const cell = h3CurrentCell();
const allowed = (H3.upscale_modes || []).indexOf('ltx_x2') !== -1;
const row = document.getElementById('h3FaceFixFooterRow');
- if (row) row.hidden = !allowed;
+ // Fast HD always finishes with it, so the toggle has nothing to decide.
+ if (row) row.hidden = !allowed || !!(cell && cell.fast_hd);
const eta = document.getElementById('h3FaceFixFooterEta');
if (eta) {
eta.textContent = (cell && cell.facefix_min != null)
@@ -727,8 +735,31 @@ function _h3SyncFaceFixEta() {
function h3EstimateLine() {
const cell = h3CurrentCell();
if (!cell) return '';
+ // 4.19: Extend and Add sound are priced by the 5 s window they run in, not
+ // by the Length strip (which they do not use).
+ const _mode = (typeof currentMode !== 'undefined') ? currentMode : '';
+ if (_mode === 'extend' || _mode === 'v2a') {
+ const win = h3CellFor(cell.quality, '5s') || cell;
+ const per = h3CellEtaMin(win);
+ const fmt = (m) => h3FmtEtaMin(m).replace(/^~/, '').replace(/ · batch$/, '');
+ if (_mode === 'extend') {
+ const sec = Math.max(0.5, Math.min(15, parseFloat((document.getElementById('extend_seconds') || {}).value) || 5));
+ const windows = 1 + Math.max(0, Math.ceil((sec * 24 + 1 - 124) / 123));
+ return 'Extend +' + sec.toFixed(1) + ' s · ' + win.quality_label + ' · ' + windows
+ + ' window' + (windows > 1 ? 's' : '') + ' ≈ ' + fmt(per * windows);
+ }
+ // Add sound never upscales (the picture is the user's), so a Fast HD pick
+ // costs only its H3 pass here.
+ const v2aPer = win.fast_hd ? (_h3TriStepMin(win) || win.tristep_min || per) : per;
+ return 'Add sound · picture kept · ≈ ' + fmt(v2aPer) + ' per 5 s of clip';
+ }
const fast = h3TriStepOn(cell);
let m = h3CellEtaMin(cell);
+ if (cell.fast_hd) {
+ // Already includes its Upscale & Face Fix (h3CellEtaMin prices it whole).
+ return 'Fast HD · ' + cell.width + '×' + cell.height + ' → ' + cell.final_width + '×'
+ + cell.final_height + ' ≈ ' + h3FmtEtaMin(m).replace(/^~/, '').replace(/ · batch$/, '');
+ }
let txt = cell.quality_label + ' · ' + (fast ? 'Fast' : 'Best');
if (h3FaceFixOn()) {
txt += ' + Face Fix';
@@ -1852,6 +1883,44 @@ document.getElementById('prompt') && document.getElementById('prompt')
});
+// ---- 4.19: H3 media modes ----------------------------------------------------
+// Keyframes, Extend, Lip-sync and Add sound each need a runner flag an older
+// H3 pack does not have. /status.h3 carries one boolean per capability, probed
+// on the INSTALLED runner; the server (make_job + the worker) makes the same
+// decision from the same probes — this copy only lets the UI say so first.
+globalThis.H3_MODE_CAP = { keyframe: 'keyframes', extend: 'extend', a2v: 'audio_drive', v2a: 'video_to_audio' };
+globalThis.H3_MODE_LABEL = { keyframe: 'Keyframes', extend: 'Extend', a2v: 'Lip-sync', v2a: 'Add sound' };
+
+function h3CanServe(mode) {
+ const st = (window._ENGINE_PROBES && window._ENGINE_PROBES.h3) || {};
+ if (!st.available) return false;
+ const cap = H3_MODE_CAP[mode];
+ return cap ? !!st[cap] : true;
+}
+
+function h3ClipIsH3(o) {
+ return !!(o && o.engine === 'h3');
+}
+
+// The Extend panel's length control speaks per engine: LTX adds 8-frame
+// latents up to 10 s; H3 adds 5 s windows and lands on the exact seconds,
+// up to 15 s (three windows, each carrying the last 17 frames and their sound).
+function syncH3MediaModeUi() {
+ const onH3 = document.body.dataset.engine === 'h3';
+ const sec = document.getElementById('extend_seconds');
+ if (sec) {
+ sec.max = onH3 ? '15' : '10';
+ if (!onH3 && parseFloat(sec.value) > 10) sec.value = '10';
+ }
+ const hint = document.getElementById('extendDurationHint');
+ if (hint && onH3 && sec) {
+ const s = Math.max(0.5, Math.min(15, parseFloat(sec.value) || 5));
+ const windows = 1 + Math.max(0, Math.ceil((s * 24 + 1 - 124) / 123));
+ hint.textContent = `Adds ${s.toFixed(1)} s · ${windows} H3 window${windows > 1 ? 's' : ''}`;
+ }
+}
+
+
// ---- published to the page --------------------------------------------------
// Inline handlers in the markup and the other files resolve these through
// the global scope; everything NOT listed here is private to this module.
@@ -1876,4 +1945,5 @@ Object.assign(globalThis, {
ltxCellInstallLabel, _ltxApplyShape, setH3Quality, _h3ApplyShape,
renderH3WindowPrompts, toggleH3WindowHelp, setH3ChainPrompts, setH3Tier,
h3InsertPromptStructure, h3InsertDialogueLine, h3SyncPromptHelper,
+ h3CanServe, h3ClipIsH3, syncH3MediaModeUi, h3FmtEtaMin,
});
diff --git a/webapp/js/queue.js b/webapp/js/queue.js
index 2ab9f54..a6147f5 100644
--- a/webapp/js/queue.js
+++ b/webapp/js/queue.js
@@ -73,7 +73,9 @@ function h3FinishTierKey(srcCell) {
const hit = targets.find(t => t.quality === q);
if (hit) return hit.key;
}
- return targets[0].key; // one rung up
+ // One rung up — never Fast HD by default: it is a speed recipe on the Draft
+ // canvas, offered in the list but not the "finish it properly" instinct.
+ return (targets.find(t => !t.fast_hd) || targets[0]).key;
}
function h3FinishSetTier(key) {
@@ -720,6 +722,12 @@ function setEngine(engine, opts) {
target = fallback.id;
reason = 'This ' + e.label + ' build has no first-frame support — '
+ 'update the pack to use Image mode.';
+ } else if (H3_MODE_CAP[currentMode] && st[H3_MODE_CAP[currentMode]] === false) {
+ // 4.19 modes ride on runner flags an older H3 pack does not have.
+ target = fallback.id;
+ reason = 'This ' + e.label + ' runner predates ' + (H3_MODE_LABEL[currentMode] || currentMode)
+ + ' — press Update in Pinokio (your weights stay). Back on '
+ + fallback.label + ' for now.';
}
}
if (target !== (e || {}).id) e = engineById(target) || fallback;
@@ -731,6 +739,11 @@ function setEngine(engine, opts) {
// emitted from the same ENGINES table that produced `target`.
document.body.dataset.engine = target;
if (note) { note.textContent = reason; note.hidden = !reason; }
+ // The keyframe hint and the Extend/Add-sound panels speak per engine.
+ if (currentMode === 'keyframe' && typeof setKeyframeMode === 'function') {
+ try { setKeyframeMode(window._kfMode); } catch (e) {}
+ }
+ if (typeof syncH3MediaModeUi === 'function') { try { syncH3MediaModeUi(); } catch (e) {} }
renderEngineSwitch();
try { syncModeStripToEngine(); } catch (e) {}
@@ -920,6 +933,12 @@ function updateH3Availability(s) {
// sentence on the chained cells, so a pack update that brings
// --chain-prompts in has to re-render both without a reload.
|| (next.chain_prompts !== H3.chain_prompts)
+ // 4.19: an H3 runner update brings Keyframes / Extend /
+ // Lip-sync / Add sound in without a reload.
+ || (next.keyframes !== H3.keyframes)
+ || (next.extend !== H3.extend)
+ || (next.audio_drive !== H3.audio_drive)
+ || (next.video_to_audio !== H3.video_to_audio)
// Install→repair→install flips the pill's copy and the models
// card even when `available` itself hasn't moved yet.
|| (next.repairable !== H3.repairable)
@@ -946,6 +965,8 @@ function updateH3Availability(s) {
}
if (changed) {
setEngine(currentEngine(), { persist: false });
+ // The Lip-sync form's engine row follows the runner's capabilities too.
+ if (typeof renderA2vEngineRow === 'function') { try { renderA2vEngineRow(); } catch (e) {} }
// The Finish button's label and its picker are both derived from the
// engine's own tier table, so a pack install/repair that changes the
// offered tiers has to re-label the currently-selected clip's
@@ -972,6 +993,9 @@ function updateH3Availability(s) {
// `source` is 'chip' from the engine switcher and undefined from the explicit
// "How to install" / "How to repair" buttons in the Models list, which must
// ALWAYS open the card: the user asked for it by name there.
+// H3 carried context for the next submit: 'on' unless Load Params restored a
+// recipe that ran with it off (h3_continuity=false on the sidecar).
+let _h3ContinuityRecipe = 'on';
let _h3CardSeen = false;
function openH3InstallCard(source) {
if (source === 'chip' && _h3CardSeen) { _h3NudgeEngineOffer(); return; }
@@ -1306,6 +1330,8 @@ function syncExtendDuration() {
// about 2 seconds" — kept as a tooltip for anyone who does want it.
hint.textContent = `Adds ${actualSec.toFixed(2)} s`;
hint.title = `${latents} latent frames × 8 video frames at 24 fps`;
+ // H3 counts in seconds and 5 s windows, not latents.
+ if (typeof syncH3MediaModeUi === 'function') { try { syncH3MediaModeUi(); } catch (e) {} }
// VC-25: the sticky footer's derived line has its own Extend-aware branch
// (updateDerived()) that reads this same #extend_seconds/#extend_direction
// pair — refresh it here too, or it keeps showing whatever it last said
@@ -1602,7 +1628,9 @@ function updateDerived() {
// everything below the footer (which form sections show for this mode,
// the keyframe slots, the frames gate) still has to run, or switching to
// Extend / Keyframe would leave the previous mode's sections on screen.
- const clampedMode = (mode === 'keyframe' || currentMode === 'extend');
+ // On H3 both are priced by the H3 footer line (the H3 cell), not LTX's card.
+ const clampedMode = (mode === 'keyframe' || currentMode === 'extend')
+ && document.body.dataset.engine !== 'h3';
const w = parseInt(document.getElementById('width').value || 0);
const h = parseInt(document.getElementById('height').value || 0);
const f = parseInt(document.getElementById('frames').value || 0);
@@ -1750,7 +1778,10 @@ function updateDerived() {
if (typeof _applyI2vRefModeVisibility === 'function') {
try { _applyI2vRefModeVisibility(); } catch (_) {}
}
- document.getElementById('extendSection').classList.toggle('show', currentMode === 'extend');
+ // Add sound (H3) shares Extend's source-clip picker; the extend-only
+ // controls fold under body[data-vmode="v2a"] in panel.css.
+ document.getElementById('extendSection').classList.toggle('show',
+ currentMode === 'extend' || currentMode === 'v2a');
// Colorize (restore) shows its own source-video picker. Unlike Extend it
// KEEPS the sizing + quick-metrics rows below (the source's own dims/length
// drive the output, but the prompt + seed still apply).
@@ -3663,7 +3694,9 @@ async function poll() {
// that state. Y1.036 added Extend to the same gate after the Y1.024
// download trim exposed that Extend is structurally Q8-class.
const genBtn = document.getElementById('genBtn');
- const q8GatedMode = (currentMode === 'keyframe' || currentMode === 'extend');
+ // H3 renders Keyframes and Extend on its own engine — no LTX Q8 needed.
+ const q8GatedMode = (currentMode === 'keyframe' || currentMode === 'extend')
+ && document.body.dataset.engine !== 'h3';
if (currentMode === 'ingredients' && !ingredientsServed()) {
// Belt to setMode's braces. setMode should make this unreachable, but
// this is the state the button is in if anything ever gets there again
@@ -5419,7 +5452,14 @@ function selectOutput(path, options) {
// singing shot would "continue" with invented gibberish. Swap Extend for
// "Continue the song" there instead (see /a2v/continue_song).
const outIsA2v = !!(o && o.mode === 'a2v');
- if (useExtBtn) useExtBtn.style.display = (isPhoto || isAudio || outIsH3 || outIsA2v) ? 'none' : '';
+ // 4.19: an H3 clip CAN be extended now — on H3, which carries its last 17
+ // frames and their sound into the new window. Only an H3 runner that
+ // predates --extend-from still hides the button.
+ const _h3Ext = (typeof h3CanServe === 'function') && h3CanServe('extend');
+ if (useExtBtn) useExtBtn.style.display = (isPhoto || isAudio || (outIsH3 && !_h3Ext) || outIsA2v) ? 'none' : '';
+ const addSoundBtn = document.getElementById('addSoundBtn');
+ if (addSoundBtn) addSoundBtn.style.display = (!isPhoto && !isAudio
+ && typeof h3CanServe === 'function' && h3CanServe('v2a')) ? '' : 'none';
const continueSongBtn = document.getElementById('continueSongBtn');
if (continueSongBtn) continueSongBtn.style.display = (outIsA2v && !isPhoto && !isAudio) ? '' : 'none';
// VA-26: Retake is video-only, engine-agnostic (any finished clip, H3
@@ -5499,8 +5539,13 @@ function audioUseTargets(o, probes) {
} else if (!music.available) {
cover.sub = 'needs the music engine — opens its install card';
}
+ const h3 = (probes && probes.h3) || {};
+ const h3Lip = !!(h3.available && h3.audio_drive)
+ ? [{ id: 'lipsync_h3', label: 'Lip-sync with Hailuo H3', sub: 'H3 performs it — face, body and room, your track kept exactly' }]
+ : [];
return [
{ id: 'lipsync', label: 'Lip-sync', sub: 'a face in your picture talks or sings to it' },
+ ...h3Lip,
{ id: 'musicvideo', label: 'Music video', sub: 'your pictures, planned and cut to it' },
{ id: 'soundtrack', label: 'Soundtrack for a video', sub: 'image-to-video, with this as its sound' },
cover,
@@ -5510,8 +5555,10 @@ function audioUseTargets(o, probes) {
function audioUseApply(path, target) {
closeAudioUseMenu();
const o = findOutputByPath(path);
- if (target === 'lipsync') {
+ if (target === 'lipsync' || target === 'lipsync_h3') {
if (typeof audioStudioUseAudio !== 'function') return;
+ // The Lip-sync form's engine row decides which engine performs it.
+ if (typeof setA2vEngine === 'function') setA2vEngine(target === 'lipsync_h3' ? 'h3' : 'ltx');
audioStudioUseAudio(path, o ? o.clip_sec : null, o ? o.url : '');
phosToast('Audio loaded into Lip-sync — add a picture of the face, then Generate.', { kind: 'success' });
} else if (target === 'musicvideo') {
@@ -6130,6 +6177,12 @@ function useAsExtendSourcePath(path) {
// Audio/One Shot/Images set mode=extend behind a hidden #genForm (0 px
// tall) — same root cause as VA-08's Load Params, same fix.
if (typeof workflowSwitch === 'function') { try { workflowSwitch('manual'); } catch (e) {} }
+ // 4.19: an H3 clip continues on H3 (its own motion and voice carry on);
+ // any other clip keeps the engine the user has chosen.
+ const _o = (typeof findOutputByPath === 'function') ? findOutputByPath(path) : null;
+ if (_o && h3ClipIsH3(_o) && h3CanServe('extend') && typeof setEngine === 'function') {
+ setEngine('h3');
+ }
setMode('extend');
document.getElementById('video_path').value = path;
document.getElementById('extendSrcSelect').value = path;
@@ -6138,6 +6191,27 @@ function useAsExtendSourcePath(path) {
}
function useAsExtendSource() { if (!activePath) return alert('Pick an output first.'); useAsExtendSourcePath(activePath); }
+// 4.19: Add sound — the clip on screen goes to Hailuo H3's Add sound form
+// (the Extend panel's source picker), engine switched to H3. Nothing renders
+// until Generate; the prompt is left for the user to describe the sound.
+function useAsAddSoundSource(path) {
+ path = path || activePath;
+ if (!path) { phosToast('Pick a clip first.', { kind: 'warn' }); return; }
+ if (typeof h3CanServe !== 'function' || !h3CanServe('v2a')) {
+ phosToast('Add sound needs Hailuo H3 with an up-to-date runner — press Update in Pinokio.', { kind: 'warn', duration: 6000 });
+ return;
+ }
+ if (typeof workflowSwitch === 'function') { try { workflowSwitch('manual'); } catch (e) {} }
+ if (typeof setEngine === 'function') setEngine('h3');
+ setMode('v2a');
+ document.getElementById('video_path').value = path;
+ const sel = document.getElementById('extendSrcSelect');
+ if (sel) sel.value = path;
+ updateDerived();
+ document.querySelector('aside.form-pane').scrollTop = 0;
+ phosToast('Clip loaded into Add sound — describe the sound you want, then Generate.', { kind: 'success' });
+}
+
// VA-38: hands a published Windows-partial to Extend as its source. Not a
// byte-exact resume of the original chain's plan (that would need the
// failure-path exception handler to thread window index / tail state back
@@ -6926,6 +7000,18 @@ async function loadParams(recipe) {
if (typeof workflowSwitch === 'function') { try { workflowSwitch('manual'); } catch (e) {} }
const _lpPane = document.querySelector('aside.form-pane');
if (_lpPane) _lpPane.scrollTop = 0;
+ // An H3 recipe switches the ENGINE before the mode is restored: setMode()'s
+ // Q4-tier guard and the LTX Extend clamp both read the engine, so restoring
+ // the mode first under LTX snapped H3 Keyframes/Extend to Text and clipped a
+ // 15 s H3 Extend to LTX's 10 s (Codex 4.19 #2/#3). The full engine restore
+ // further down runs again and lands on the same engine.
+ if (String((p && p.engine) || '').toLowerCase() === 'h3'
+ && typeof setEngine === 'function' && typeof engineById === 'function' && engineById('h3')) {
+ try { setEngine('h3', { persist: false }); } catch (e) {}
+ }
+ // Carried context is on unless the recipe says it ran without it; the form
+ // has no control for it, so it rides on this and goes back out on submit.
+ _h3ContinuityRecipe = (p && (p.h3_continuity === false || p.h3_continuity === 'off')) ? 'off' : 'on';
if (p.mode === 'upscale') {
// Upscale & Face Fix reopens in its own lane on the same source clip with
// the EXACT recipe that ran. A pill lights only when it names that recipe;
@@ -6962,6 +7048,7 @@ async function loadParams(recipe) {
return;
}
else if (p.mode === 'extend') setMode('extend');
+ else if (p.mode === 'v2a') setMode('v2a');
else if (p.mode === 'keyframe') setMode('keyframe');
else if (p.mode === 'i2v_clean_audio' || p.mode === 'i2v') { setMode('i2v'); document.getElementById('i2vMode').value = p.mode; document.getElementById('mode').value = p.mode; }
else if (p.character_id) setMode('character');
@@ -7097,7 +7184,11 @@ async function loadParams(recipe) {
// and never read back — a Load Params + Generate on an Extend silently
// re-rendered with the defaults (journey audit, High).
if (p.video_path) document.getElementById('video_path').value = p.video_path;
- if (p.mode === 'extend') {
+ if (p.mode === 'extend' && String(p.engine || '') === 'h3' && Number(p.h3_extend_seconds) > 0) {
+ // H3 Extend records seconds, not LTX latents.
+ const sEl = document.getElementById('extend_seconds');
+ if (sEl) { sEl.value = String(Number(p.h3_extend_seconds)); sEl.dispatchEvent(new Event('input')); }
+ } else if (p.mode === 'extend') {
const extFrames = parseInt(p.extend_frames, 10);
if (Number.isFinite(extFrames) && extFrames > 0) {
const fEl = document.getElementById('extend_frames');
@@ -8374,8 +8465,14 @@ document.getElementById('genForm').addEventListener('submit', async e => {
if (kfMode === 'keyframe') {
const startImg = (fd.get('start_image') || '').toString().trim();
const endImg = (fd.get('end_image') || '').toString().trim();
- if (!startImg || !endImg) {
- alert('Pick both a start frame and an end frame before generating.');
+ const _kfOnH3 = (fd.get('engine') || '').toString() === 'h3';
+ if (_kfOnH3 ? !endImg : (!startImg || !endImg)) {
+ // H3 needs only the end frame (its last-frame task); LTX needs both.
+ const _msg = _kfOnH3
+ ? 'Pick the end frame — the still the clip should land on. The start frame is optional on Hailuo H3.'
+ : 'Pick both a start frame and an end frame before generating.';
+ if (typeof phosToast === 'function') phosToast(_msg, { kind: 'warn', duration: 6000 });
+ else alert(_msg);
reenable();
return;
}
@@ -8391,7 +8488,8 @@ document.getElementById('genForm').addEventListener('submit', async e => {
})),
{ image: endImg, frame: frames - 1, label: 'End' },
];
- const missing = slots.filter(s => !s.image).map(s => s.label || 'Start/End');
+ const missing = slots.filter(s => !s.image && !(_kfOnH3 && s.label === 'Start'))
+ .map(s => s.label || 'Start/End');
if (missing.length) {
alert(`Pick all ${window._kfMode} keyframe images before generating: ` + missing.join(', '));
reenable();
@@ -8457,6 +8555,13 @@ document.getElementById('genForm').addEventListener('submit', async e => {
fd.set('frames', String(_t.frames));
fd.set('steps', String(_t.steps));
}
+ // 4.19: Extend on H3 adds whole seconds after the clip (its own
+ // field — LTX's extend_frames counts 8-frame latents).
+ fd.set('h3_continuity', _h3ContinuityRecipe);
+ if ((fd.get('mode') || '').toString() === 'extend') {
+ fd.set('h3_extend_seconds', (document.getElementById('extend_seconds') || {}).value || '5');
+ fd.set('extend_direction', 'after');
+ }
}
await api('/queue/add','POST',fd);
} catch (e) {
@@ -8667,7 +8772,7 @@ Object.assign(globalThis, {
lbToggleFullscreen,
audioUseTargets, audioUseApply, useAudioAsSoundtrack, openAudioUseMenu, closeAudioUseMenu,
animateActive, hide, unhide, openOutputsFolder, hideActive,
- useAsExtendSource, useAsUpscaleSource, useAsUpscaleSourcePath, setUpscalePreset,
+ useAsExtendSource, useAsAddSoundSource, useAsUpscaleSource, useAsUpscaleSourcePath, setUpscalePreset,
faceFixClip, faceFixActive, isUpscaledPath, loadParams, _flashActionDone, closeOutputInfoModal,
queueSharpExport, sharpExportActive, useLastFramePath, useLastFrameActive,
revealClipInFinder, revealActive, openClipInEditor, openActiveInEditor, kebabToggle,
diff --git a/webapp/js/settings.js b/webapp/js/settings.js
index 8100167..b3f8d51 100644
--- a/webapp/js/settings.js
+++ b/webapp/js/settings.js
@@ -117,9 +117,9 @@ function updateModelsCard(s) {
// Y1.036 — Extend joins FFLF and High in needing Q8. The Extend pipeline
// loads `transformer-dev.safetensors` for CFG-guided denoise; Q4 doesn't
// ship it after the Y1.024 download trim, so surface the same CTA here.
- const needsQ8 = (currentMode === 'keyframe')
- || (currentMode === 'extend')
- || _qualityUsesHq(document.getElementById('quality').value);
+ const _onH3 = document.body.dataset.engine === 'h3';
+ const needsQ8 = (!_onH3 && (currentMode === 'keyframe' || currentMode === 'extend'))
+ || (!_onH3 && _qualityUsesHq(document.getElementById('quality').value));
if (needsQ8 && !q8Ok && tier.allows_q8 !== false) {
if (dismissed) { card.style.display = 'none'; return; }
card.style.display = '';
@@ -304,8 +304,10 @@ function applyTierGates(tier) {
// Mode pills
document.querySelectorAll('#modeGroup .pill-btn').forEach(b => {
const m = b.dataset.mode;
- const allowed = (m === 'keyframe') ? tier.allows_keyframe
- : (m === 'extend') ? tier.allows_extend
+ // Hailuo H3 serves Keyframes and Extend on its own engine and lane.
+ const _h3 = document.body.dataset.engine === 'h3';
+ const allowed = (m === 'keyframe') ? (_h3 || tier.allows_keyframe)
+ : (m === 'extend') ? (_h3 || tier.allows_extend)
: true;
b.classList.toggle('disabled', !allowed);
if (!allowed) {
diff --git a/webapp/style/panel.css b/webapp/style/panel.css
index d70fa44..3e34906 100644
--- a/webapp/style/panel.css
+++ b/webapp/style/panel.css
@@ -3983,8 +3983,8 @@
reason in the title, and the same reason into #engineRowNote if
they click. Hiding a capability is only kind when there is nothing
to say; there is something to say here. */
- body[data-cap-tier="q4"] #modeGroup [data-mode="keyframe"],
- body[data-cap-tier="q4"] #modeGroup [data-mode="extend"] {
+ body[data-cap-tier="q4"]:not([data-engine="h3"]) #modeGroup [data-mode="keyframe"],
+ body[data-cap-tier="q4"]:not([data-engine="h3"]) #modeGroup [data-mode="extend"] {
display: none !important;
}
@@ -12650,3 +12650,31 @@ label > .ph:first-child:not(:only-child),
/* FILM-39 (4.17): the SLOW flag on a clip is a button — click runs Prepare. */
.sbe-slow-flag { cursor: pointer; pointer-events: auto; }
.sbe-slow-flag:hover { color: var(--accent-bright, var(--accent)); }
+
+/* ===== 4.19 — Hailuo H3 media modes (Extend / Add sound share #extendSection) =====
+ Add sound reuses Extend's source picker; everything that only means "extend"
+ folds while the form is in Add sound, and the reverse. H3's Length strip
+ means nothing for either (the clip, or the seconds asked for, decide the
+ length), so it folds while H3 renders them. */
+body[data-vmode="v2a"] #extendSection .extend-only { display: none !important; }
+body:not([data-vmode="v2a"]) #extendSection .v2a-only { display: none !important; }
+body[data-engine="h3"][data-vmode="extend"] #h3LengthGroup,
+body[data-engine="h3"][data-vmode="extend"] #h3LengthLabel,
+body[data-engine="h3"][data-vmode="v2a"] #h3LengthGroup,
+body[data-engine="h3"][data-vmode="v2a"] #h3LengthLabel { display: none !important; }
+#extendSection .h3-mode-hint {
+ margin: 0 0 10px; padding: 9px 11px; border-radius: 10px;
+ border: 1px solid var(--eng-soft, rgba(255,46,159,0.42));
+ background: var(--eng-dim, rgba(255,46,159,0.14));
+ color: var(--text, #e8e8ef); line-height: 1.45;
+}
+
+/* ===== 4.19 — Lip-sync engine choice (LTX | Hailuo H3) ===== */
+.a2v-engine { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
+.a2v-engine[hidden] { display: none !important; }
+.a2v-engine .pill-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
+.a2v-engine .pill-btn .sub { font-size: 11px; opacity: .72; }
+.a2v-engine [data-a2v-engine="h3"].active { border-color: rgba(255,46,159,0.55); box-shadow: inset 0 0 0 1px rgba(255,46,159,0.35); }
+#a2vH3QualityGroup .pill-btn { align-items: center; text-align: center; }
+#mvOneShotDetails:not([data-a2v-engine="h3"]) .a2v-h3-only { display: none !important; }
+#mvOneShotDetails[data-a2v-engine="h3"] .a2v-ltx-only { display: none !important; }