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.10.1): continuity for one-takes — the light is locked in every beat, measured per part, retaken once on drift

mrbizarro8fecae79e250
diff --git a/README.md b/README.md
index b3a21c8..59b0693 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
</p>
-> **Current release: v4.10.0.** One take (a clip up to two minutes on either engine, written as beats), Turbo on the community's v4 adapter, a timeline that trims and moves like an NLE, anchor stills and long shots on the Storyboard, LoRA guides and update checks, closed-tab alerts, a light theme — and *The Commuter*, a 75 s one take rendered overnight at native, as the release film. Includes the v4.9.6–v4.9.8 fixes. Full notes on the [releases page](https://github.com/mrbizarro/phosphene/releases).
+> **Current release: v4.10.1.** Continuity for one-takes: the light is locked in every beat, each part is measured, and a part whose light drifts is retaken once on its own. One take (a clip up to two minutes on either engine, written as beats), Turbo on the community's v4 adapter, a timeline that trims and moves like an NLE, anchor stills and long shots on the Storyboard, LoRA guides and update checks, closed-tab alerts, a light theme — and *The Commuter*, a 75 s one take rendered overnight at native, as the release film. Includes the v4.9.6–v4.9.8 fixes. Full notes on the [releases page](https://github.com/mrbizarro/phosphene/releases).
## Overview
diff --git a/VERSION b/VERSION
index 2da4316..ad96464 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.10.0
+4.10.1
diff --git a/docs/PROMPTING.md b/docs/PROMPTING.md
index 515abec..3d76d67 100644
--- a/docs/PROMPTING.md
+++ b/docs/PROMPTING.md
@@ -10,6 +10,7 @@ Copy this whole page into your own assistant (ChatGPT, Claude, Codex) and ask it
- **Settle before the turn.** The beat before a scene change or a reveal should slow down; the model needs a moment to land before it can pivot.
- **Repeat the invariants every beat.** The subject's look, the camera position, the palette, the sound. The engine only remembers the last frame; the words carry the rest. Phosphene prepends your style block to every beat for you.
- **Something new every second.** A near miss, an object entering, a light change. A beat that describes a mood and no event reads as a still.
+- **Lock the light.** Say the time of day and the weather once, in the first beat, and never imply another hour later ("neon comes on", "dawn breaks"). Phosphene appends a continuity sentence to every beat and measures each part; a part whose light drifts is retaken once on its own.
- **Sound is part of the shot.** Say what we hear: footsteps, a band from a doorway, rain on an awning. Without sound cues the audio is near-silent ambience.
## Start from a still
diff --git a/docs/STATE.md b/docs/STATE.md
index 4640b80..29787b1 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -11,6 +11,13 @@
> with a copy button; the planner's take brief carries the night's rules
> (a scene change or a reveal is a beat of its own, a settle before it); H3
> native exports are no longer shrunk to 720p by default.
+> **Same morning, continuity.** The Commuter turned from night to grey day
+> inside part 2 and back. `take_light_lock` reads the time of day and
+> weather out of the prompt and appends one continuity sentence to every
+> beat (both engines); `take_drift` measures mean luma first-vs-last frame
+> per part and the runner retakes a drifting part once (lock doubled, seed
+> +101), keeping the steadier clip and hiding the other; the planner brief
+> states the light once and forbids a beat that implies another hour.
> **🎬 2026-09-05 — Editor v2 on dev/beta, UNRELEASED: speed, titles, transitions, the Director, sliding windows.**
> From the long-form editing brief (the measured gaps only, built our way).
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 5ec0833..e59c8a5 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -15178,6 +15178,82 @@ def take_beats(raw, n: int) -> list[str]:
return items + [""] * (n - len(items))
+# CONTINUITY (2026-09-06). In The Commuter, beat 5 was night, beat 6 turned to
+# grey daylight, beat 7 was night again — inside ONE part, at a window
+# boundary. The engine carries only the last frame between windows; the words
+# carry the rest, and a beat that says "neon flickering to life" reads as dusk
+# unless something holds the time of day. Two layers:
+# 1. `take_light_lock` reads the time of day and weather out of the prompt's
+# own words and appends one imperative sentence to every beat.
+# 2. `take_drift` measures the light between a part's first and last frame;
+# a jump past TAKE_DRIFT_MAX makes the runner retake that part once, with
+# the lock doubled and a fresh seed, and keep the steadier of the two.
+_TOD_WORDS = (("night", "night"), ("midnight", "night"), ("dusk", "dusk"), ("twilight", "dusk"),
+ ("blue hour", "blue hour"), ("golden hour", "golden hour"), ("sunset", "sunset"),
+ ("dawn", "dawn"), ("sunrise", "dawn"), ("noon", "midday"), ("midday", "midday"),
+ ("daylight", "day"), ("afternoon", "afternoon"), ("morning", "morning"))
+_WEATHER_WORDS = ("rain", "drizzle", "storm", "snow", "fog", "mist", "overcast", "clear sky", "sunny")
+TAKE_DRIFT_MAX = 0.28 # |Δ mean luma| between a part's first and last frame, 0..1
+# A blank beat means "hold": H3's runner refuses an empty window prompt, so
+# on H3 a blank beat is spelled out (LTX's windows chain holds on its own).
+TAKE_HOLD = "Nothing new begins: the settled state of the previous moment continues."
+TAKE_DRIFT_SAMPLE_SEC = 0.25 # how far in from each end the frames are read
+
+
+def take_light_lock(prompt: str) -> str:
+ """One sentence that holds the light. Reads the time of day and the weather
+ from the prompt's own words; when neither is named it still forbids a
+ change, because a take that never says "night" still must not turn to day
+ between two windows."""
+ p = (prompt or "").lower()
+ tod = next((v for k, v in _TOD_WORDS if k in p), None)
+ weather = next((w for w in _WEATHER_WORDS if w in p), None)
+ if tod and weather:
+ what = f"it is still {tod} and still {weather}"
+ elif tod:
+ what = f"it is still {tod}"
+ elif weather:
+ what = f"it is still {weather}"
+ else:
+ what = "the time of day and the weather are exactly as before"
+ return (f"Continuity: {what}; the sky, the light, the shadows and the palette "
+ f"stay exactly as they were in the previous moment — no change of time "
+ f"of day, weather or season.")
+
+
+def take_frame_light(path, at_sec: float) -> tuple[float, float] | None:
+ """(mean luma 0..1, warmth = mean R − mean B, −1..1) of one frame."""
+ try:
+ raw = subprocess.run([str(FFMPEG), "-loglevel", "error", "-ss", f"{max(0.0, at_sec):.3f}",
+ "-i", str(path), "-frames:v", "1", "-vf", "scale=64:36", "-f", "rawvideo",
+ "-pix_fmt", "rgb24", "-"], capture_output=True, check=True, timeout=60).stdout
+ if len(raw) < 64 * 36 * 3:
+ return None
+ px = list(raw)
+ r = sum(px[0::3]) / (len(px) / 3); g = sum(px[1::3]) / (len(px) / 3); b = sum(px[2::3]) / (len(px) / 3)
+ luma = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255.0
+ return (luma, (r - b) / 255.0)
+ except Exception: # noqa: BLE001
+ return None
+
+
+def take_drift(path, duration: float | None = None) -> dict:
+ """How far the light moved across one clip: first frame vs last frame."""
+ if duration is None:
+ try:
+ duration = float(subprocess.run(["ffprobe", "-v", "error", "-show_entries", "format=duration",
+ "-of", "csv=p=0", str(path)], capture_output=True, text=True, timeout=30).stdout.strip())
+ except Exception: # noqa: BLE001
+ duration = 0.0
+ a = take_frame_light(path, TAKE_DRIFT_SAMPLE_SEC)
+ b = take_frame_light(path, max(TAKE_DRIFT_SAMPLE_SEC, float(duration or 0) - TAKE_DRIFT_SAMPLE_SEC))
+ if not a or not b:
+ return {"ok": False, "delta": 0.0}
+ return {"ok": True, "luma_first": round(a[0], 3), "luma_last": round(b[0], 3),
+ "warmth_first": round(a[1], 3), "warmth_last": round(b[1], 3),
+ "delta": round(abs(b[0] - a[0]), 3), "drifted": abs(b[0] - a[0]) > TAKE_DRIFT_MAX}
+
+
def take_estimate_minutes(engine: str, quality: str, seconds) -> float | None:
"""Wall clock for the whole take, from the same cost model every other
estimate uses. None when this Mac has no number for it (LTX windows are
@@ -15917,7 +15993,10 @@ def _sb_take_concept(concept: str, seconds: int) -> str:
f"(the face, the person waiting) is the whole of its beat, nothing else "
f"in it; the beat before a change or a reveal slows down; every other "
f"beat has something new enter the frame within its first second. "
- f"Name the sound in every beat.")
+ f"Name the sound in every beat. State the time of day and the weather "
+ f"ONCE, in the first beat, and keep them for the whole take; never let a "
+ f"beat imply a different hour (no 'dawn breaks', no 'neon comes on' unless "
+ f"it is already dark) — the light must not change between beats.")
def _sb_plan_thread(board_id: str, brief: dict, previous: dict | None) -> None:
@@ -19868,11 +19947,19 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
if _take is None:
push(f"take_seconds={_take_secs_raw!r} is not one of {TAKE_SECONDS} — rendering a normal clip")
else:
- _take["beat_prompts"] = take_beats(f("beats", ""), _take["beats"])
+ _lock = take_light_lock(f("prompt", ""))
+ _take["beat_prompts"] = [(b + " " + _lock) if b else b
+ for b in take_beats(f("beats", ""), _take["beats"])]
+ _take["light_lock"] = _lock
if _take["engine"] == "h3":
+ # A take is 15 s parts whatever the form said; without a quality
+ # the tier composer fell back to draft_3s and every part became
+ # ONE window — the lock and the beats were all there, in a 3 s clip.
form["h3_length"] = [TAKE_H3_PART_LENGTH]
+ if not h3_compose_tier(f("h3_quality", ""), TAKE_H3_PART_LENGTH):
+ form["h3_quality"] = ["draft"]
form["h3_chain_prompts"] = [json.dumps(
- [_take["beat_prompts"][i] for i in _take["parts"][0]])]
+ [_take["beat_prompts"][i] or (TAKE_HOLD + " " + _lock) for i in _take["parts"][0]])]
else:
form["temporal_mode"] = ["windows"]
form["frames"] = [str(_take["frames"])]
@@ -23075,9 +23162,8 @@ def run_take_job_inner(job: dict) -> None:
for k, idxs in enumerate(parts):
if job.get("cancel_requested"):
raise RuntimeError("stopped between parts")
- chain = [beats[i] if i < len(beats) else "" for i in idxs]
- if not chain[0]:
- chain[0] = p.get("prompt") or ""
+ lock0 = take.get("light_lock") or take_light_lock(p.get("prompt") or "")
+ chain = [(beats[i] if i < len(beats) else "") or (TAKE_HOLD + " " + lock0) for i in idxs]
child_params = dict(p)
child_params.update({
"take": None,
@@ -23097,6 +23183,41 @@ def run_take_job_inner(job: dict) -> None:
out = child.get("output_path")
if not out or not Path(out).is_file():
raise RuntimeError(f"part {k + 1} produced no clip")
+ # CONTINUITY CHECK: did the light move across this part? One retake
+ # with the lock said twice and a fresh seed; keep the steadier clip.
+ drift = take_drift(out)
+ if drift.get("drifted") and not job.get("cancel_requested"):
+ push(f"[take] part {k + 1}: the light drifted (luma {drift['luma_first']} → "
+ f"{drift['luma_last']}) — retaking it once with the continuity lock doubled")
+ lock = take.get("light_lock") or take_light_lock(p.get("prompt") or "")
+ retry_params = dict(child_params)
+ retry_params["h3_chain_prompts"] = [(c + " " + lock) if c else c for c in chain]
+ retry_params["prompt"] = retry_params["h3_chain_prompts"][0]
+ try:
+ retry_params["seed"] = str(int(retry_params.get("seed") or 0) + 101)
+ except (TypeError, ValueError):
+ retry_params["seed"] = "-1"
+ retry = {"id": f"{job['id']}-p{k + 1}r", "params": retry_params,
+ "status": "running", "created_at": job.get("created_at")}
+ run_h3_job_inner(retry)
+ out2 = retry.get("output_path")
+ d2 = take_drift(out2) if out2 and Path(out2).is_file() else {"delta": 9.0}
+ if d2.get("delta", 9.0) < drift["delta"]:
+ push(f"[take] part {k + 1}: the retake holds the light better "
+ f"(Δ {d2.get('delta')} vs {drift['delta']}) — using it")
+ try:
+ set_hidden(str(out), True)
+ except Exception: # noqa: BLE001
+ pass
+ out = out2
+ else:
+ push(f"[take] part {k + 1}: the retake did not help (Δ {d2.get('delta')}) — keeping the first")
+ if out2:
+ try:
+ set_hidden(str(out2), True)
+ except Exception: # noqa: BLE001
+ pass
+ job.setdefault("take_drift", []).append(drift)
outs.append(out)
# Parts are working files: kept, hidden from the gallery. The take is
# the output.
diff --git a/test_take.py b/test_take.py
index e3d0bcb..5444700 100644
--- a/test_take.py
+++ b/test_take.py
@@ -33,9 +33,9 @@ def test_make_job_h3_take_forces_15s_parts_and_first_chain():
"take_seconds": "60", "beats": json.dumps([f"b{i}" for i in range(12)]),
"h3_quality": "high", "h3_length": "3s"})
q = j["params"]
- assert q["h3_length"] == "15s" and q["h3_chain_prompts"] == ["b0", "b1", "b2"]
+ assert q["h3_length"] == "15s" and [c.split(" Continuity")[0] for c in q["h3_chain_prompts"]] == ["b0", "b1", "b2"]
assert q["take"]["seconds"] == 60 and q["take"]["engine"] == "h3"
- assert q["take"]["beat_prompts"][11] == "b11"
+ assert q["take"]["beat_prompts"][11].startswith("b11 Continuity")
def test_make_job_ltx_take_is_the_windows_chain():
@@ -43,7 +43,7 @@ def test_make_job_ltx_take_is_the_windows_chain():
"take_seconds": "30", "beats": "one\ntwo\n"})
q = j["params"]
assert q["long_mode"] == "windows" and q["frames"] == 721
- assert q["window_prompts"][:3] == ["one", "two", ""]
+ assert [w.split(" Continuity")[0] for w in q["window_prompts"][:3]] == ["one", "two", ""]
assert q["take"]["engine"] == "ltx"
@@ -85,18 +85,19 @@ def test_take_runner_chains_parts_and_joins(tmp_path, monkeypatch):
(out_dir / f"{child['id']}.mp4.json").write_text(json.dumps({"width": 64, "height": 64, "seed": 5}))
child["output_path"] = str(out)
monkeypatch.setattr(p, "run_h3_job_inner", fake_h3)
+ monkeypatch.setattr(p, "take_drift", lambda *a, **k: {"ok": True, "delta": 0.0, "drifted": False})
j = p.make_job({"mode": "t2v", "engine": "h3", "prompt": "a hen skates", "take_seconds": "30",
"beats": json.dumps(["b1", "b2", "b3", "b4", "b5", "b6"]), "preset_label": "ride"})
p.run_take_job_inner(j)
assert len(seen) == 2
- assert seen[0]["mode"] == "t2v" and seen[0]["h3_chain_prompts"] == ["b1", "b2", "b3"]
- assert seen[1]["mode"] == "i2v" and seen[1]["h3_chain_prompts"] == ["b4", "b5", "b6"]
+ assert seen[0]["mode"] == "t2v" and [c.split(" Continuity")[0] for c in seen[0]["h3_chain_prompts"]] == ["b1", "b2", "b3"]
+ assert seen[1]["mode"] == "i2v" and [c.split(" Continuity")[0] for c in seen[1]["h3_chain_prompts"]] == ["b4", "b5", "b6"]
assert Path(seen[1]["image"]).is_file() # the last frame of part 1
assert seen[1]["take"] is None # a part is not a take
final = Path(j["output_path"])
assert final.is_file() and final.name.endswith("_take30s.mp4")
side = json.loads(final.with_suffix(final.suffix + ".json").read_text())
- assert side["take"]["seconds"] == 30 and side["take"]["beats"][5] == "b6"
+ assert side["take"]["seconds"] == 30 and side["take"]["beats"][5].startswith("b6")
assert len(side["take"]["parts"]) == 2 and side["width"] == 64
assert [f for f, flag in hidden if flag] == side["take"]["parts"]
@@ -168,3 +169,60 @@ def test_take_shot_is_priced_by_parts_and_validates():
def test_take_concept_asks_for_beats_that_never_cut():
c = p._sb_take_concept("a hen skateboards through the city", 60)
assert "12 beats" in c and "never cuts" in c and "a hen skateboards" in c
+
+
+# ---- continuity: the light lock and the drift retake ---------------------------
+def test_light_lock_reads_time_and_weather_from_the_prompt():
+ assert "still night" in p.take_light_lock("A hen skates through the city at night in the rain")
+ assert "still rain" in p.take_light_lock("A hen skates through the city at night in the rain")
+ assert "exactly as before" in p.take_light_lock("A hen skates")
+ q = p.make_job({"mode": "t2v", "engine": "h3", "prompt": "Broadway at night", "take_seconds": "30",
+ "beats": json.dumps(["a", "", "c", "d", "e", "f"])})["params"]
+ assert q["take"]["beat_prompts"][0].endswith("season.") and "still night" in q["take"]["beat_prompts"][0]
+ assert q["take"]["beat_prompts"][1] == "" # a blank beat still holds
+ assert q["h3_chain_prompts"][0].startswith("a Continuity:")
+ assert q["h3_chain_prompts"][1].startswith(p.TAKE_HOLD) # ...spelled out for H3's runner
+
+
+def _lit_clip(path: Path, first: str, last: str) -> None:
+ # two-second clip whose colour goes from `first` to `last` (a light drift)
+ subprocess.run([str(p.FFMPEG), "-loglevel", "error", "-y", "-f", "lavfi", "-i", f"color=c={first}:s=64x64:d=1:r=24",
+ "-f", "lavfi", "-i", f"color=c={last}:s=64x64:d=1:r=24", "-f", "lavfi", "-i", "anullsrc=r=48000:cl=stereo",
+ "-filter_complex", "[0:v][1:v]concat=n=2:v=1:a=0[v]", "-map", "[v]", "-map", "2:a", "-t", "2",
+ "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac", "-shortest", str(path)], check=True)
+
+
+def test_drift_metric_sees_a_night_to_day_jump(tmp_path):
+ _lit_clip(tmp_path / "steady.mp4", "0x202020", "0x242424")
+ _lit_clip(tmp_path / "jump.mp4", "0x202020", "0xd0d0d0")
+ assert p.take_drift(tmp_path / "steady.mp4")["drifted"] is False
+ d = p.take_drift(tmp_path / "jump.mp4")
+ assert d["drifted"] is True and d["delta"] > p.TAKE_DRIFT_MAX
+
+
+def test_take_runner_retakes_a_drifting_part_once_and_keeps_the_steadier(tmp_path, monkeypatch):
+ out_dir = tmp_path / "out"; out_dir.mkdir()
+ monkeypatch.setattr(p, "OUTPUT", out_dir)
+ monkeypatch.setattr(p, "STATE_DIR", tmp_path / "state")
+ hidden = []
+ monkeypatch.setattr(p, "set_hidden", lambda path, flag: hidden.append(path))
+ calls = []
+
+ def fake_h3(child):
+ calls.append(child["id"])
+ out = out_dir / f"{child['id']}.mp4"
+ if child["id"].endswith("-p1"):
+ _lit_clip(out, "0x202020", "0xd0d0d0") # part 1 drifts
+ else:
+ _lit_clip(out, "0x202020", "0x262626") # the retake and part 2 hold
+ (out_dir / f"{child['id']}.mp4.json").write_text("{}")
+ child["output_path"] = str(out)
+ monkeypatch.setattr(p, "run_h3_job_inner", fake_h3)
+ j = p.make_job({"mode": "t2v", "engine": "h3", "prompt": "Broadway at night", "take_seconds": "30",
+ "beats": json.dumps(["b1", "b2", "b3", "b4", "b5", "b6"])})
+ p.run_take_job_inner(j)
+ assert calls == [f"{j['id']}-p1", f"{j['id']}-p1r", f"{j['id']}-p2"]
+ side = json.loads(Path(j["output_path"]).with_suffix(".mp4.json").read_text())
+ assert side["take"]["parts"][0].endswith("-p1r.mp4") # the steadier retake is part 1
+ assert str(out_dir / f"{j['id']}-p1.mp4") in hidden # the drifting one is hidden
+ assert j["take_drift"][0]["drifted"] is True