| #!/bin/zsh | | | | | | | | | | | | | set -euo pipefail | | | | ROOT="$(cd "$(dirname "$0")" && pwd)" | | RUNTIME="$ROOT/.runtime" | | WEIGHTS="$ROOT/models/ltx-2.5-mlx-q8" | | | | PROMPT="${1:?usage: generate "prompt" [ltx-2-mlx args...]}" | | shift | | | | | RUNTIME_REPO="https://github.com/MrMoferFRAN/ltx-2-mlx.git" | | RUNTIME_COMMIT="57952288076766abe27dda3a774b2c24f7346977" | | WEIGHTS_REPO="MrMofer/ltx-2.5-mlx-q8" | | | | for tool in git uv ffmpeg; do | | command -v "$tool" >/dev/null || { echo "error: '$tool' is required — install it with: brew install $tool" >&2; exit 1; } | | done | | | | if [[ ! -d "$RUNTIME" ]]; then | | echo "[bootstrap] Cloning MLX runtime (pinned $RUNTIME_COMMIT) ..." | | git clone --quiet "$RUNTIME_REPO" "$RUNTIME" | | git -C "$RUNTIME" checkout --quiet "$RUNTIME_COMMIT" | | fi | | | | if [[ ! -f "$WEIGHTS/transformer-distilled.safetensors" ]]; then | | echo "[bootstrap] Down LTX-2.5 q8 weights (~36 GiB, one time) ..." | | echo " License: LTX-2.x Community License — https://huggingface.co/$WEIGHTS_REPO" | | uv run --project "$RUNTIME" python - "$WEIGHTS_REPO" "$WEIGHTS" <<'PY' | | import sys | | from huggingface_hub import snapshot_download | | | | repo, dest = sys.argv[1], sys.argv[2] | | | | snapshot_download( | | repo, | | local_dir=dest, | | allow_patterns=[ | | "transformer-distilled.safetensors", | | "connector.safetensors", | | "text_encoder/", | | "vae_encoder.safetensors", | | "vae_decoder.safetensors", | | "audio_vae.safetensors", | | "vocoder.safetensors", | | "spatial_upscaler_x2.safetensors", | | "temporal_upscaler_x2.safetensors", | | "duration_head.safetensors", | | ".json", | | "LICENSE.md", | | ], | | ) | | PY | | fi | | | | | | | | exec env \ | | AGX_RELAX_CDM_CTXSTORE_TIMEOUT=1 \ | | LTX2_DIT_EVAL_EVERY=0 \ | | LTX2_GEMMA_EVAL_EVERY=0 \ | | uv run --project "$RUNTIME" ltx-2-mlx generate \ | | --model "$WEIGHTS" \ | | --distilled --frame-rate 24 \ | | --prompt "$PROMPT" \ | | "$@" |
This New Open-Weight AI Model Is Built for Video and Robots