modelbeast/scripts/install_mflux.sh
MODELBEAST 76f065d3a6 A/B image-gen: local FLUX (mflux/MLX) + OpenRouter nano-banana operators
- flux_local: prompt->image fully on-device via mflux (schnell/dev, steps,
  quantize, seed, size). Both FLUX repos are HF-gated as of 2026-07 (schnell
  included) — clean GatedRepoError surfaces with a hint; needs owner HF token.
- openrouter_image: prompt->image via OpenRouter chat/completions with
  modalities [image,text]; parses data-URL images from the response; model
  picker for nano-banana / nano-banana-pro. Gated on OPENROUTER_API_KEY.
- settings: openrouter_key added to vault (masked/redacted/env-injected)
- scripts/install_mflux.sh; venv installed
- A/B flow: run both with the same prompt, judge in Compare mode

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:31:19 +10:00

20 lines
808 B
Bash
Executable File

#!/usr/bin/env bash
# mflux — MLX-native FLUX image generation for Apple Silicon. No auth needed for
# FLUX.1 schnell (Apache-2.0, ungated); dev weights are HF-gated (license accept
# + HF token). Weights auto-download from HuggingFace on first generate.
set -euo pipefail
cd "$(dirname "$0")/.."
UV=/opt/homebrew/bin/uv
echo "[mflux] creating venv (python 3.12) ..."
$UV venv --python 3.12 venvs/mflux
PY="$(pwd)/venvs/mflux/bin/python"
echo "[mflux] installing mflux ..."
$UV pip install --python "$PY" -U mflux
echo "[mflux] verifying ..."
"$PY" -c "import mflux; print('[mflux] import OK, version:', getattr(mflux, '__version__', 'unknown'))" || true
ls venvs/mflux/bin/ | grep -E "^mflux" | head -8
echo "[mflux] done — first generation downloads weights (schnell ~24GB bf16, less if quantized)"