Skip to content

Magenta Setup

The preferred generation path is --magenta-backend bridge. It uses a persistent native executable built against upstream magentart::core, loads Magenta resources once, and accepts generation requests over newline-delimited JSON.

Managed Assets

The CLI downloads Magenta resources and the selected .mlxfn model directly from Hugging Face by default. The expected workspace-local layout is:

text
.magenta-home/magenta-rt-v2/models/mrt2_small/mrt2_small.mlxfn
.magenta-home/magenta-rt-v2/resources

Run setup:

bash
target/debug/vidbgm magenta-setup --magenta-model mrt2_small --yes

Check status:

bash
target/debug/vidbgm magenta-status --magenta-model mrt2_small

The desktop app does not bundle these model files. Its first-run setup action uses the same Hugging Face downloader, but writes the model and shared resources to the Tauri app data directory. The native bridge can still be resolved from a development checkout or from VIDBGM_MAGENTA_BRIDGE.

Bridge Paths

The CLI first looks for the prebuilt-MLX bridge:

text
.vidbgm/magenta-realtime/build-prebuilt-mlx/examples/vidbgm_bridge/vidbgm-magenta-bridge

Then it checks the source-MLX build path:

text
.vidbgm/magenta-realtime/build/examples/vidbgm_bridge/vidbgm-magenta-bridge

Build The Bridge Manually

bash
cd .vidbgm/magenta-realtime
git apply ../../patches/magenta-vidbgm-persistent-bridge.patch
../../.venv-magenta/bin/cmake . -B build-prebuilt-mlx \
  -DMAGENTART_USE_SYSTEM_MLX=ON \
  -DCMAKE_PREFIX_PATH="$PWD/../../.venv-magenta/lib/python3.12/site-packages/mlx"
../../.venv-magenta/bin/cmake --build build-prebuilt-mlx --target vidbgm-magenta-bridge -j10

Fallbacks

--magenta-backend auto tries the bridge first, then the optional Python mrt CLI, then the deterministic synth backend while recording warnings.

Use --magenta-backend bridge when missing native setup should fail loudly instead of falling back.

Rust CLI and Tauri desktop docs for adaptive video background music generation.