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.
Python ai-filmmakingai-videoai-video-generatorapple-siliconhailuoimage-to-videolip-synclocal-ailora-trainingltx-2ltx-2-5ltx-videomacosminimax-h3mlxmusic-generationoffline-aipinokiotext-to-videovideo-generation
Y1.004 · fs.link persistent drive: models + state survive Reset
mrbizarrodf9f99319b78
diff --git a/.clinerules b/.clinerulesindex fa8737f..74782d0 100644--- a/.clinerules+++ b/.clinerules@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/.cursorrules b/.cursorrulesindex fa8737f..74782d0 100644--- a/.cursorrules+++ b/.cursorrules@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/.gitignore b/.gitignoreindex 666fe12..fb10b59 100644--- a/.gitignore+++ b/.gitignore@@ -1,6 +1,12 @@# =============================================================================# Runtime state — regenerated on every run, never commit# =============================================================================+# Y1.004+: state lives in <repo>/state/ which fs.link maps to a persistent+# drive outside the panel install. Pre-Y1.004 root-level paths are kept+# below so existing installs don't leak files into commits during the+# one-time migration window (state files get moved into state/ on first+# Y1.004 boot — see _migrate_state_dir in mlx_ltx_panel.py).+state/panel_queue.jsonpanel_hidden.jsonpanel_settings.jsondiff --git a/.windsurfrules b/.windsurfrulesindex fa8737f..74782d0 100644--- a/.windsurfrules+++ b/.windsurfrules@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/AGENTS.md b/AGENTS.mdindex fa8737f..74782d0 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/CLAUDE.md b/CLAUDE.mdindex fa8737f..74782d0 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/GEMINI.md b/GEMINI.mdindex fa8737f..74782d0 100644--- a/GEMINI.md+++ b/GEMINI.md@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/QWEN.md b/QWEN.mdindex fa8737f..74782d0 100644--- a/QWEN.md+++ b/QWEN.md@@ -446,11 +446,18 @@ The thresholds are intentional. M-Studio 64 GB is the canonical## 15a. `panel_settings.json` schema-User-controllable preferences. Persisted at the install root, gitignored-(per-user config, not part of the repo). Read at panel startup; mutated-via `POST /settings`. The helper subprocess inherits codec env vars from-this at spawn — when settings change, the panel kills the helper so the-next job picks up new values.+User-controllable preferences. Persisted at `<repo>/state/panel_settings.json`+(Y1.004+); pre-Y1.004 lived at `<repo>/panel_settings.json` and is migrated+on first boot by `_migrate_state_dir()`. State directory is gitignored.++The whole `state/` dir is symlinked into Pinokio's fs.link drive so it+survives Reset → Reinstall (see "Persistent storage / fs.link" in install.js++ update.js). All persisted-state files (`panel_settings.json`,+`panel_queue.json`, `panel_hidden.json`) live there.++Read at panel startup; mutated via `POST /settings`. The helper subprocess+inherits codec env vars from this at spawn — when settings change, the+panel kills the helper so the next job picks up new values.```jsonc{diff --git a/README.md b/README.mdindex ea2679a..5e39207 100644--- a/README.md+++ b/README.md@@ -22,19 +22,26 @@>> A one-time history scrub on 2026-05-01 made `git pull` refuse to> fast-forward for clones that pre-date it. If your Pinokio Update fires-> but you don't see new features, you're hitting that — one command-> fixes it permanently:+> but you don't see new features, you're on a divergent clone. One+> command fixes it without losing your downloaded models or settings:>> ```bash-> cd ~/pinokio/api/phosphene.git && git fetch origin && git reset --hard origin/main+> curl -fsSL https://raw.githubusercontent.com/mrbizarro/phosphene/main/recover.sh | bash> ```>-> Or download and run [`recover.sh`](./recover.sh):-> `curl -fsSL https://raw.githubusercontent.com/mrbizarro/phosphene/main/recover.sh | bash`+> Or manually:+> ```bash+> cd ~/pinokio/api/phosphene.git && git fetch origin && git reset --hard origin/main+> ```>> Then click **Update** in Pinokio (it'll succeed now), then **Stop → Start**.-> From **Y1.002 onward** Update self-recovers from any future divergence-> automatically, so this is a one-time fix.+> Your `mlx_models/` (the ~36 GB of LTX weights), generated outputs, LoRAs,+> and settings stay put.+>+> **From Y1.002 onward** Update self-recovers from any future divergence+> automatically, and **from Y1.004 onward** Pinokio's Reset → Reinstall+> path also preserves models + outputs + settings via Pinokio's `fs.link`+> drive — so a clean reinstall is no longer scary.---diff --git a/VERSION b/VERSIONindex bb06584..da0b6e3 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-Y1.003+Y1.004diff --git a/install.js b/install.jsindex c971afa..0c4a954 100644--- a/install.js+++ b/install.js@@ -35,6 +35,40 @@ module.exports = {next: null},+ // ---- Persistent storage via fs.link (Y1.004+) -------------------------+ // Pinokio's fs.link maps these directories to a virtual drive that+ // lives OUTSIDE the panel install dir, so a Reset (which deletes+ // and re-clones the install) leaves the heavy assets intact. After+ // Reset → Install, fs.link re-creates the symlinks back into the+ // fresh clone and the drive is rediscovered automatically.+ //+ // What's in the drive:+ // mlx_models/ LTX 2.3 weights (~36 GB), Gemma encoder, LoRAs+ // mlx_outputs/ generated videos+ // panel_uploads/ user-uploaded reference images+ // state/ panel_settings.json, panel_queue.json, panel_hidden.json+ //+ // What's NOT linked:+ // ltx-2-mlx/env/ — venv has historically been buggy under fs.link+ // (Python-version-restricted, pip mismatches);+ // rebuilds in ~5 min anyway. Models are the+ // expensive thing to lose, not the venv.+ //+ // First-run merge: if real folders already exist with content (e.g.+ // an upgrade from Y1.003-), fs.link merges them INTO the drive+ // before replacing them with symlinks. Idempotent on repeat runs.+ {+ method: "fs.link",+ params: {+ drive: {+ mlx_models: "mlx_models",+ mlx_outputs: "mlx_outputs",+ panel_uploads: "panel_uploads",+ state: "state"+ }+ }+ },+// ---- Clone ltx-2-mlx (skip if already cloned) -------------------------// Re-running install when the clone exists used to fail with// "destination path 'ltx-2-mlx' already exists and is not an emptydiff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.pyindex b1fc36a..7bdee0c 100644--- a/mlx_ltx_panel.py+++ b/mlx_ltx_panel.py@@ -75,8 +75,14 @@ MODEL_ID_HQ = os.environ.get("LTX_MODEL_HQ", "dgrauet/ltx-2.3-mlx-q8")# Q8 model is detected on disk so the High quality tier can be conditionally enabled.Q8_LOCAL_PATH = Path(os.environ.get("LTX_Q8_LOCAL", str(ROOT / "mlx_models/ltx-2.3-mlx-q8")))COMFY_PATTERN = os.environ.get("LTX_COMFY_PATTERN", "pinokio/api/comfy.git.*main\\.py")-QUEUE_FILE = ROOT / "panel_queue.json"-HIDDEN_FILE = ROOT / "panel_hidden.json"+# State files (queue + hidden + settings) live in <ROOT>/state/, which+# Pinokio's fs.link maps to a virtual drive that survives Reset. The+# directory is auto-created on first run; existing pre-Y1.004 installs+# get a one-time migration of root-level files into state/ at startup+# (see _migrate_state_dir below) so users don't lose their queue.+STATE_DIR = Path(os.environ.get("LTX_STATE_DIR", str(ROOT / "state")))+QUEUE_FILE = STATE_DIR / "panel_queue.json"+HIDDEN_FILE = STATE_DIR / "panel_hidden.json"HELPER_IDLE_TIMEOUT = int(os.environ.get("LTX_HELPER_IDLE_TIMEOUT", "1800"))HELPER_LOW_MEMORY = os.environ.get("LTX_HELPER_LOW_MEMORY", "true")FPS = 24@@ -171,7 +177,7 @@ OUTPUT_PRESETS: dict[str, dict[str, str]] = {# file yet get this default.DEFAULT_OUTPUT_PRESET = "standard"-SETTINGS_FILE = ROOT / "panel_settings.json"+SETTINGS_FILE = STATE_DIR / "panel_settings.json"_SETTINGS_LOCK = threading.Lock()@@ -198,6 +204,48 @@ def _settings_defaults() -> dict:}+def _ensure_state_dir() -> None:+ """Create <ROOT>/state/ if it doesn't exist. Idempotent. Called at+ startup before any state-file load so loaders can assume the dir is+ there. When fs.link is wired in install.js, this directory is a+ symlink into the persistent drive — Pinokio Reset deletes the+ panel install but leaves the linked target intact."""+ try:+ STATE_DIR.mkdir(parents=True, exist_ok=True)+ except OSError as exc:+ sys.stderr.write(f"WARN: could not create {STATE_DIR} ({exc})\n")+++def _migrate_state_dir() -> None:+ """One-time migration: move pre-Y1.004 root-level state files into+ <ROOT>/state/. Existing users who Update from Y1.003- to Y1.004++ have panel_settings.json + panel_queue.json + panel_hidden.json at+ the repo root; we move them so the new SETTINGS_FILE / QUEUE_FILE /+ HIDDEN_FILE constants find them. Idempotent — only moves files that+ exist at the source AND don't exist at the destination, so a user+ who already has Y1.004 state in place doesn't get clobbered."""+ _ensure_state_dir()+ pairs = [+ (ROOT / "panel_settings.json", SETTINGS_FILE),+ (ROOT / "panel_queue.json", QUEUE_FILE),+ (ROOT / "panel_hidden.json", HIDDEN_FILE),+ ]+ for src, dst in pairs:+ try:+ if src.exists() and src.is_file() and not dst.exists():+ # Move (not copy) so old root-level files don't linger+ # and re-confuse a second migration pass.+ shutil.move(str(src), str(dst))+ sys.stderr.write(f"NOTE: migrated {src.name} → state/\n")+ except OSError as exc:+ sys.stderr.write(f"WARN: could not migrate {src.name} ({exc})\n")+++# Run the migration once at module import, before any settings load. Cheap+# (just a few existence checks in the no-op case) and side-effect-safe.+_migrate_state_dir()++def _load_settings() -> dict:"""Read panel_settings.json. Missing file → return + write the defaultso first-run users get the sensible Standard preset. Corrupt file →@@ -228,7 +276,7 @@ def _load_settings() -> dict:def _save_settings(settings: dict) -> None:"""Atomic write so a Pinokio kill mid-write can't leave a half-file."""import tempfile, os as _os- fd, tmp = tempfile.mkstemp(prefix="panel_settings.", dir=str(ROOT))+ fd, tmp = tempfile.mkstemp(prefix="panel_settings.", dir=str(STATE_DIR))try:with _os.fdopen(fd, "w") as fh:fh.write(json.dumps(settings, indent=2))diff --git a/update.js b/update.jsindex 8b981df..d71e00b 100644--- a/update.js+++ b/update.js@@ -1,5 +1,25 @@module.exports = {run: [+ // ---- Persistent storage via fs.link (Y1.004+) -------------------------+ // Mirror of the fs.link block in install.js. Running it on Update+ // (in addition to Install) means existing pre-Y1.004 users get+ // their mlx_models/, mlx_outputs/, panel_uploads/, and state/ moved+ // into the persistent drive on their first Update — without having+ // to do a full Reset first. After this runs once, all four of+ // those paths are symlinks into the drive, and the next Reset+ // preserves their content. Idempotent on repeat runs.+ {+ method: "fs.link",+ params: {+ drive: {+ mlx_models: "mlx_models",+ mlx_outputs: "mlx_outputs",+ panel_uploads: "panel_uploads",+ state: "state"+ }+ }+ },+// Resilient pull for the panel repo (mrbizarro/phosphene). Plain// `git pull` was breaking for existing users after a history-rewrite// event on origin (commit identities were scrubbed; force-push