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
fix: pre-ship audit pass 3 — installer robustness + identity scrub
mrbizarroe45da9068cde
diff --git a/image_engine.py b/image_engine.pyindex 592b540..def7559 100644--- a/image_engine.py+++ b/image_engine.py@@ -503,7 +503,7 @@ def _resolve_mflux_bin(config: ImageEngineConfig) -> str | None:# image_engine.py lives AT the repo root (panel.git/image_engine.py).# Regression in d7a7caa: a `.parent.parent` accidentally walked one- # directory too high to /Users/salo/pinokio/api/, where neither the+ # directory too high to Pinokio's api/ dir, where neither the# ltx-2-mlx env nor the image-gen env exist — every probe fell# through to shutil.which() which (with no global mflux on PATH)# returned None, so health_check() reported "mflux not installed"diff --git a/install.js b/install.jsindex be08dfa..ddea612 100644--- a/install.js+++ b/install.js@@ -184,7 +184,19 @@ module.exports = {// Force the mlx pin BEFORE installing ltx-* packages so their deps// resolve to the pinned version instead of pulling latest 0.31.x."uv pip install --python env/bin/python 'mlx==0.31.1' 'mlx-lm==0.31.1' 'mlx-metal==0.31.1'",- "uv pip install --python env/bin/python ./packages/ltx-core-mlx ./packages/ltx-pipelines-mlx",+ // Y3 — Train Character ships in 3.0. Without ltx-trainer-mlx in+ // the venv, the trainer subprocess fails at `import yaml` because+ // pyyaml is a transitive dep of ltx-trainer (declared in its+ // pyproject). Codex pre-ship review 2026-05-18 caught this.+ "uv pip install --python env/bin/python ./packages/ltx-core-mlx ./packages/ltx-pipelines-mlx ./packages/ltx-trainer",+ // Auto-caption (Gemma 3 12B via mlx-vlm) needs the mlx-vlm+ // package. Pinned to 0.4.4 — caption_with_gemma.py's import+ // surface (load, generate, prompt_utils.apply_chat_template)+ // is stable at that version. --no-deps so we don't drag in+ // mlx-vlm's heavy default deps (PIL>=10, av, etc. that fight+ // mflux/transformers pins). The runtime imports it lazily so+ // a partial install doesn't break the rest of the panel.+ "uv pip install --python env/bin/python --no-deps 'mlx-vlm==0.4.4'",// hf_transfer is HuggingFace's Rust-based downloader — 5-10× faster// than the default Python downloader for big repos like Q8 (~25 GB).// The panel sets HF_HUB_ENABLE_HF_TRANSFER=1 in download envs; if the@@ -196,8 +208,7 @@ module.exports = {// See agent/engine.py for routing details. Falls back to stdlib// urllib if missing — safe to omit but the loop is less robust.//- // smolagents: Phase 2 of the agent-layer refactor (see- // /Users/salo/.claude/plans/fancy-conjuring-lovelace.md). Powers+ // smolagents: Phase 2 of the agent-layer refactor. Powers// the optional CodeAgent runtime in agent/runtime_smol.py,// selectable per-request via PHOSPHENE_RUNTIME=smol. smolagents// pulls transformers as a transitive dep — the huggingface-hubdiff --git a/lora_lab/evaluate.py b/lora_lab/evaluate.pyindex 2e3cc8d..d897419 100644--- a/lora_lab/evaluate.py+++ b/lora_lab/evaluate.py@@ -36,31 +36,39 @@ from pathlib import Pathimport mlx.core as mxfrom ltx_pipelines_mlx import BasePipeline+from lora_lab import resolve_default_model_dir, resolve_default_text_encoder+logger = logging.getLogger(__name__)-DEFAULT_MODEL_DIR = (- Path.home()- / ".cache/huggingface/hub/models--dgrauet--ltx-2.3-mlx-q4"- / "snapshots/53a6f5f39d9c074bc73e6a18ba391f40ddffaa68"-)+# Resolved at import time via the same logic the trainer uses (env override+# LTX_MODELS_DIR → vendored mlx_models/ → HF cache fallback). Hardcoding the+# old dgrauet HF snapshot path here used to break the public Pinokio install,+# whose model dir is the vendored mlx_models/ltx-2.3-mlx-q4 — completely+# unrelated to ~/.cache/huggingface.+DEFAULT_MODEL_DIR = resolve_default_model_dir()+# Prompts use `{trigger}` as a placeholder for the LoRA trigger token. The+# CLI substitutes it via str.format at runtime — pass `--trigger mychar` (or+# whatever token the LoRA was trained on) to fill it in. Default is `mychar`+# so a fresh user can still smoke-test the eval pipeline without editing+# this file.DEFAULT_PROMPTS = [- "salotrn, close-up portrait, facing camera, neutral expression, soft daylight, blurred indoor background",- "salotrn, medium shot, three-quarter angle, slight smile, warm indoor lighting, dark t-shirt",- "salotrn, half-body, looking up, outdoor sunny afternoon, light shirt, blue sky",- "salotrn, close-up portrait, looking away, evening light, profile view",- "salotrn, medium shot, big grin, outdoor tropical balcony, daytime, dark t-shirt, palm trees background",- "salotrn, close-up selfie, facing camera, deadpan expression, gray t-shirt, indoor home gym",- "salotrn, half-body shot, facing camera, hands in pockets, autumn forest, soft overcast light",- "salotrn, close-up portrait, three-quarter angle, contemplative expression, cafe interior, golden hour",- "salotrn, full-body shot, facing camera, walking, urban street, daytime",- "salotrn, close-up portrait, looking down, dramatic backlight, dark background",- "salotrn, medium shot, slight smile, library shelves behind, warm indoor light",- "salotrn, close-up selfie, big grin, beach background, bright outdoor light",- "salotrn, half-body, facing camera, sitting at desk with computer, screen lighting, indoor",- "salotrn, three-quarter angle, looking out window, overcast daylight, indoor",- "salotrn, close-up portrait, facing camera, serious expression, neutral background, studio lighting",+ "{trigger}, close-up portrait, facing camera, neutral expression, soft daylight, blurred indoor background",+ "{trigger}, medium shot, three-quarter angle, slight smile, warm indoor lighting, dark t-shirt",+ "{trigger}, half-body, looking up, outdoor sunny afternoon, light shirt, blue sky",+ "{trigger}, close-up portrait, looking away, evening light, profile view",+ "{trigger}, medium shot, big grin, outdoor tropical balcony, daytime, dark t-shirt, palm trees background",+ "{trigger}, close-up selfie, facing camera, deadpan expression, gray t-shirt, indoor home gym",+ "{trigger}, half-body shot, facing camera, hands in pockets, autumn forest, soft overcast light",+ "{trigger}, close-up portrait, three-quarter angle, contemplative expression, cafe interior, golden hour",+ "{trigger}, full-body shot, facing camera, walking, urban street, daytime",+ "{trigger}, close-up portrait, looking down, dramatic backlight, dark background",+ "{trigger}, medium shot, slight smile, library shelves behind, warm indoor light",+ "{trigger}, close-up selfie, big grin, beach background, bright outdoor light",+ "{trigger}, half-body, facing camera, sitting at desk with computer, screen lighting, indoor",+ "{trigger}, three-quarter angle, looking out window, overcast daylight, indoor",+ "{trigger}, close-up portrait, facing camera, serious expression, neutral background, studio lighting",]@@ -104,6 +112,9 @@ def main() -> int:p.add_argument("--seed-start", type=int, default=1000)p.add_argument("--prompts-file", default=None, help="optional .txt file with one prompt per line; else use DEFAULT_PROMPTS")p.add_argument("--limit", type=int, default=None, help="only run the first N prompts")+ p.add_argument("--trigger", default="mychar",+ help="trigger token substituted for `{trigger}` in DEFAULT_PROMPTS "+ "(must match what the LoRA was trained on). Ignored when --prompts-file is given.")p.add_argument("--model-dir", default=str(DEFAULT_MODEL_DIR))p.add_argument("--low-memory", action="store_true",help="reload transformer between renders (cuts peak RAM, slower); default keeps loaded across renders")@@ -118,7 +129,10 @@ def main() -> int:if args.prompts_file:prompts = [line.strip() for line in Path(args.prompts_file).read_text().splitlines() if line.strip()]else:- prompts = list(DEFAULT_PROMPTS)+ # Substitute the trigger token into the {trigger}-placeholder defaults.+ # Falls back to a literal `mychar` if the user forgot to pass --trigger.+ trigger = (args.trigger or "mychar").strip() or "mychar"+ prompts = [p.format(trigger=trigger) for p in DEFAULT_PROMPTS]if args.limit:prompts = prompts[: args.limit]print(f"running {len(prompts)} prompts | {args.width}x{args.height} {args.frames}f {args.num_steps}step")@@ -128,7 +142,7 @@ def main() -> int:pipe = BasePipeline(model_dir=args.model_dir,- gemma_model_id="mlx-community/gemma-3-12b-it-4bit",+ gemma_model_id=resolve_default_text_encoder(),low_memory=args.low_memory,low_ram_streaming=False,)diff --git a/lora_lab/evaluate_dev.py b/lora_lab/evaluate_dev.pyindex ca165a4..17ac9a8 100644--- a/lora_lab/evaluate_dev.py+++ b/lora_lab/evaluate_dev.py@@ -37,21 +37,26 @@ from ltx_core_mlx.loader.sd_ops import LTXV_LORA_COMFY_RENAMING_MAPfrom ltx_core_mlx.loader.sft_loader import SafetensorsStateDictLoaderfrom ltx_core_mlx.utils.memory import aggressive_cleanup+from lora_lab import resolve_default_model_dir, resolve_default_text_encoder+logger = logging.getLogger(__name__)-DEFAULT_MODEL_DIR = (- Path.home()- / ".cache/huggingface/hub/models--dgrauet--ltx-2.3-mlx-q4"- / "snapshots/53a6f5f39d9c074bc73e6a18ba391f40ddffaa68"-)+# Same resolver story as evaluate.py — env (LTX_MODELS_DIR) → vendored+# mlx_models/ → HF cache fallback. The previous hardcoded dgrauet snapshot+# path silently broke fresh Pinokio installs whose model dir lives at+# <panel-root>/mlx_models/ltx-2.3-mlx-q4 (not in ~/.cache/huggingface).+DEFAULT_MODEL_DIR = resolve_default_model_dir()+# `{trigger}` is substituted in main() so this file is reusable for any+# character LoRA. Pass `--trigger mychar` (or whatever token the LoRA was+# trained on); default is `mychar`.DEFAULT_PROMPTS = [- "salotrn man, close-up portrait, facing camera, neutral expression, soft daylight",- "salotrn man, medium shot, three-quarter angle, slight smile, warm indoor lighting",- "salotrn man, half body shot, looking up, outdoor sunny afternoon",- "salotrn man, close-up portrait, looking away, profile view, evening light",- "salotrn man, medium shot, big grin, outdoor tropical balcony, daytime",+ "{trigger} man, close-up portrait, facing camera, neutral expression, soft daylight",+ "{trigger} man, medium shot, three-quarter angle, slight smile, warm indoor lighting",+ "{trigger} man, half body shot, looking up, outdoor sunny afternoon",+ "{trigger} man, close-up portrait, looking away, profile view, evening light",+ "{trigger} man, medium shot, big grin, outdoor tropical balcony, daytime",]@@ -114,6 +119,9 @@ def main() -> int:p.add_argument("--seed-start", type=int, default=1000)p.add_argument("--prompts-file", default=None)p.add_argument("--limit", type=int, default=None)+ p.add_argument("--trigger", default="mychar",+ help="trigger token substituted into `{trigger}` placeholders in "+ "DEFAULT_PROMPTS. Ignored when --prompts-file is given.")p.add_argument("--model-dir", default=str(DEFAULT_MODEL_DIR))p.add_argument("--low-memory", action="store_true")p.add_argument("-v", "--verbose", action="store_true")@@ -127,7 +135,8 @@ def main() -> int:if args.prompts_file:prompts = [line.strip() for line in Path(args.prompts_file).read_text().splitlines() if line.strip()]else:- prompts = list(DEFAULT_PROMPTS)+ trigger = (args.trigger or "mychar").strip() or "mychar"+ prompts = [p.format(trigger=trigger) for p in DEFAULT_PROMPTS]if args.limit:prompts = prompts[: args.limit]print(f"running {len(prompts)} prompts via DEV pipeline | {args.width}x{args.height} {args.frames}f "@@ -138,7 +147,7 @@ def main() -> int:pipe = TI2VidOneStagePipeline(model_dir=args.model_dir,- gemma_model_id="mlx-community/gemma-3-12b-it-4bit",+ gemma_model_id=resolve_default_text_encoder(),low_memory=args.low_memory,low_ram_streaming=False,)diff --git a/lora_lab/preprocess_images.py b/lora_lab/preprocess_images.pyindex a09c1d0..6ee0167 100644--- a/lora_lab/preprocess_images.py+++ b/lora_lab/preprocess_images.py@@ -264,7 +264,14 @@ def main() -> int:"(center=default+backward-compatible; top=preserves face on portrait sources ""going to landscape target; bottom=preserves lower body)")p.add_argument("--model-dir", default=DEFAULT_MODEL_DIR)- p.add_argument("--gemma", default="mlx-community/gemma-3-12b-it-4bit")+ # Default left as None so the preprocess_images() body's local+ # resolver (resolve_default_text_encoder) picks the right path.+ # Hardcoding the HF repo id here would duplicate-download Gemma to+ # HF_HOME on a vendored install that already has it under+ # mlx_models/gemma-3-12b-it-4bit/.+ p.add_argument("--gemma", default=None,+ help="Gemma model dir or repo id. Default: resolved "+ "via LTX_MODELS_DIR or vendored mlx_models/.")p.add_argument("-v", "--verbose", action="store_true")args = p.parse_args()diff --git a/lora_lab/train_character.py b/lora_lab/train_character.pyindex 2ad4649..03d2321 100644--- a/lora_lab/train_character.py+++ b/lora_lab/train_character.py@@ -218,7 +218,7 @@ def load_spec(spec_path: Path) -> dict[str, Any]:cs = spec["advanced"].get("caption_strategy")if cs == "trigger_simple":# Panel-side alias; means "trigger word + a tiny framing hint",- # which is what class_word does ("salotrn man, close-up portrait").+ # which is what class_word does (e.g. "mychar man, close-up portrait").spec["advanced"]["caption_strategy"] = "class_word"for k in _REQUIRED_SPEC_KEYS:diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.pyindex 810c372..c463263 100644--- a/mlx_ltx_panel.py+++ b/mlx_ltx_panel.py@@ -690,10 +690,13 @@ def _safe_loras_dir() -> Path:# ============================================================================## Phosphene's panel runs the inference side; the actual LoRA training pipeline-# lives in a sibling lab repo at /Users/salo/AI/projects/lora-lab/ — separate-# tree, separate git, isolated dependencies (memory file: lora_lab notes).-# This panel never imports the lab as Python. It calls the lab's training-# entry-point as a subprocess via the lab's `scripts/run.sh` shim, which+# is vendored at ``<panel-root>/lora_lab/`` (commit e9ce853) so an installer-+# only user gets training out of the box without cloning a second repo. The+# LTX_LORA_LAB_ROOT env var (read at module load into LORA_LAB_ROOT) can+# repoint at an external authoring tree for in-place iteration.+#+# This panel never imports the lab as Python at module load time. It calls+# the training entry-point as a subprocess via scripts/lora_lab_run.sh, which# selects the ltx-2-mlx venv python + sets PYTHONPATH so the training script# can `import ltx_pipelines_mlx` and friends. No new venv. No new service.#@@ -827,8 +830,8 @@ TRAIN_VOICE_MAX_BYTES = 50 * 1024 * 1024 # 50 MBTRAIN_VOICE_MIN_SECONDS = 3 # advisory; we don't ffprobeTRAIN_VOICE_MAX_SECONDS = 60 # advisory; we don't ffprobe-# Audio-phase defaults. Measured ~4 s/step on M4 Max during the salotrn-# end-to-end run on 2026-05-15 (250 steps in 17 min). The original 30 s/step+# Audio-phase defaults. Measured ~4 s/step on M4 Max during an end-to-end+# voice-LoRA run on 2026-05-15 (250 steps in 17 min). The original 30 s/step# heuristic massively overestimated — chip labels were showing 2 h for what# is actually ~17 min, scaring users off the voice phase. The audit's earlier# 24 s/step number conflated preprocess + setup time with pure training.@@ -23956,11 +23959,11 @@ document.getElementById('genForm').addEventListener('submit', async e => {// Safety net: if the prompt mentions a trigger word from a LoRA the user// has installed but NOT toggled active for this render, ask before- // submitting. The #1 silent-failure mode is "I typed 'salotrn' but- // forgot to switch on the picker chip" — the render then runs without- // fusion, and the face/style doesn't reproduce. Compare prompt vs.- // (_knownUserLoras minus _activeLoras) and surface a confirm() so the- // mismatch isn't invisible.+ // submitting. The #1 silent-failure mode is "I typed my LoRA's trigger+ // word but forgot to switch on the picker chip" — the render then runs+ // without fusion, and the face/style doesn't reproduce. Compare prompt+ // vs. (_knownUserLoras minus _activeLoras) and surface a confirm() so+ // the mismatch isn't invisible.try {const promptRaw = (fd.get('prompt') || '').toString();const promptLower = promptRaw.toLowerCase();diff --git a/patch_mflux_fbcache.py b/patch_mflux_fbcache.pyindex c31035a..5027677 100644--- a/patch_mflux_fbcache.py+++ b/patch_mflux_fbcache.py@@ -253,8 +253,16 @@ QWEN_HELPER_NEW = QWEN_HELPER_INSERT_AFTER + """def _patch_qwen() -> int:target = _find("mflux/models/qwen/model/qwen_transformer/qwen_transformer.py")if target is None:- print("[qwen] mflux qwen_transformer.py not found — mflux not installed in expected venv root")- return 1+ # mflux isn't installed. This is the normal state for users who+ # never opted into Qwen image gen — they shouldn't have their+ # Update fail because of a patch script that has nothing to+ # patch. The previous return code (1) made Pinokio Update bail+ # for everyone who didn't run install_qwen.js. Return 0 with a+ # benign message instead; install_qwen.js will re-invoke this+ # script after the venv has mflux.+ print("[qwen] mflux not installed — skipping FBCache patch "+ "(this is normal if you haven't installed Qwen image gen).")+ return 0src = target.read_text()if PATCH_MARKER in src:print(f"[qwen] {target.name}: already patched (marker present)")diff --git a/scenema_client.py b/scenema_client.pyindex a5b8aa2..89f40f5 100644--- a/scenema_client.py+++ b/scenema_client.py@@ -61,12 +61,30 @@ import urllib.requestSCENEMA_URL = os.environ.get("SCENEMA_URL", "http://127.0.0.1:8000/generate")SCENEMA_TIMEOUT_SEC = int(os.environ.get("SCENEMA_TIMEOUT_SEC", "600"))-# Pinokio bundles ffmpeg under its own prefix; use that path explicitly so-# we don't depend on PATH ordering (the panel often has a sanitised PATH).-FFMPEG_BIN = os.environ.get(- "PHOSPHENE_FFMPEG",- "/Users/salo/pinokio/bin/ffmpeg-env/bin/ffmpeg",-)+# Pinokio bundles ffmpeg under its own prefix; locate it dynamically the+# same way the rest of the panel does (env override → standard Pinokio+# locations → system PATH). PHOSPHENE_FFMPEG takes precedence so a power+# user can pin a specific binary.+def _resolve_ffmpeg() -> str:+ from pathlib import Path+ import shutil+ explicit = os.environ.get("PHOSPHENE_FFMPEG")+ if explicit and Path(explicit).is_file():+ return explicit+ for c in (+ Path.home() / "pinokio" / "bin" / "ffmpeg-env" / "bin" / "ffmpeg",+ Path("/Applications/Pinokio.app/Contents/Resources/bin/ffmpeg-env/bin/ffmpeg"),+ ):+ if c.is_file():+ return str(c)+ sys_ffmpeg = shutil.which("ffmpeg")+ if sys_ffmpeg:+ return sys_ffmpeg+ # Last resort — return whatever was explicitly set (or a sensible+ # vendored guess) so the real error surfaces at runtime, not import.+ return explicit or str(Path.home() / "pinokio" / "bin" / "ffmpeg-env" / "bin" / "ffmpeg")++FFMPEG_BIN = _resolve_ffmpeg()# ---------------------------------------------------------------------------diff --git a/update.js b/update.jsindex a92fb22..8979869 100644--- a/update.js+++ b/update.js@@ -60,19 +60,48 @@ module.exports = {message: "./ltx-2-mlx/env/bin/pip install --force-reinstall --no-deps 'mlx==0.31.1' 'mlx-lm==0.31.1' 'mlx-metal==0.31.1'"}},- // Re-install ltx-core-mlx + ltx-pipelines-mlx from local packages.- // Critical for users who hit the dcd639e pin window (commits 157b259- // through e02e288): their site-packages still has 0.1.0 installed- // even after `git checkout main` updates the source tree to 0.2.0+.- // Without this re-install they'd have working source but broken- // installed code (e.g. ExtendPipeline.extend_from_video missing- // cfg_scale kwarg). --force-reinstall guarantees overwrite;+ // Re-install ltx-core-mlx + ltx-pipelines-mlx + ltx-trainer-mlx from+ // local packages. Critical for users who hit the dcd639e pin window+ // (commits 157b259 through e02e288): their site-packages still has+ // 0.1.0 installed even after `git checkout main` updates the source+ // tree to 0.2.0+. Without this re-install they'd have working source+ // but broken installed code (e.g. ExtendPipeline.extend_from_video+ // missing cfg_scale kwarg). --force-reinstall guarantees overwrite;// --no-deps avoids re-resolving (and re-pulling) mlx etc.+ //+ // 3.0: ltx-trainer added so existing v2 installs can run the new+ // Train Character tab without re-installing from scratch. The+ // trainer subprocess fails at `import yaml` without pyyaml, which+ // is a transitive dep of ltx-trainer-mlx — installing the local+ // package brings it cleanly.+ {+ method: "shell.run",+ params: {+ path: "ltx-2-mlx",+ message: "./env/bin/pip install --force-reinstall --no-deps ./packages/ltx-core-mlx ./packages/ltx-pipelines-mlx ./packages/ltx-trainer"+ }+ },+ // 3.0: pyyaml + pydantic + tqdm + rich are ltx-trainer-mlx's+ // transitive deps. We just installed ltx-trainer with --no-deps so+ // those weren't resolved. Install them explicitly (idempotent — pip+ // skips when already present).+ {+ method: "shell.run",+ params: {+ path: "ltx-2-mlx",+ message: "./env/bin/pip install 'pyyaml>=6.0' 'pydantic>=2.0' 'tqdm>=4.65' 'rich>=13.0'"+ }+ },+ // 3.0: auto-caption (Gemma 3 12B via mlx-vlm) needs mlx-vlm 0.4.4.+ // --no-deps because mlx-vlm's heavy default deps fight our mflux /+ // transformers / mlx pins. The runtime import is lazy so a partial+ // install doesn't break the panel — but the Auto-caption button+ // will fail noisily if mlx-vlm is missing. Install idempotently.{method: "shell.run",params: {path: "ltx-2-mlx",- message: "./env/bin/pip install --force-reinstall --no-deps ./packages/ltx-core-mlx ./packages/ltx-pipelines-mlx"+ message: "./env/bin/pip install --no-deps 'mlx-vlm==0.4.4'"}},// Y1.022: hf_transfer is HuggingFace's Rust accelerator — 5-10× faster@@ -102,8 +131,7 @@ module.exports = {}},// smolagents: powers the optional CodeAgent runtime in- // agent/runtime_smol.py (Phase 2 of the agent-layer refactor —- // see /Users/salo/.claude/plans/fancy-conjuring-lovelace.md).+ // agent/runtime_smol.py (Phase 2 of the agent-layer refactor).// Off by default; the panel uses it only when launched with// PHOSPHENE_RUNTIME=smol.//