Skip to content

About

Local AI music generator and Gradio web UI for YuE2-3B. Lyrics-to-song, vocals, instrumentals, editable ABC scores, and automatic Windows/Linux setup.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

YuE2-3B Studio — Local AI Music Generator & Gradio Web UI

YuE2-3B Studio is a local web app for YuE2 AI music generation. Turn lyrics and a style prompt into a complete song with vocals and accompaniment, export 48 kHz stereo FLAC, and edit melodies and chords with ABC notation. Run the YuE2-3B model from your browser on your own NVIDIA GPU.

studio_yue2

This independent interface wraps YuE2-3B and YuE2-Vae. The installer fetches the official inference code and model weights automatically.

Quick start · Requirements · Generate music · Troubleshooting · FAQ

Features

  • Text-to-music and lyrics-to-song: describe the genre, instruments, mood, tempo feel and vocal character, then supply your lyrics.
  • Local Gradio web interface: use your browser to generate, play and download music, with a song library and live generation status.
  • Editable music scores: inspect generated ABC notation, change melody or harmony, and render another version.
  • Score-conditioned covers and rearrangements: supply an ABC melody and choose a new style. Audio transcription is not included in this UI.
  • Instrumental generation: use empty lyric sections with planning turned off.
  • Generation controls: seeds, sampling settings, guidance, token limits and flow-matching steps.
  • GPU memory controls: acoustic attention chunking, phase offloading, OOM retry and optional FP8 mode.
  • Automatic setup: isolated Python environment, pinned inference runtime, resumable Hugging Face downloads, Windows and Linux launchers.

Requirements

Component Requirement
OS Windows 10/11 or Linux, 64-bit
Python 3.10–3.12; Python 3.12 recommended
GPU NVIDIA with BF16 support; 24 GB VRAM recommended
Driver NVIDIA driver compatible with the selected PyTorch CUDA build
RAM 32 GB recommended; leave room for CPU offloading
Disk About 7.8 GB of model weights; allow at least 20 GB for models, environment and installation downloads, plus generated audio
Network Internet access for first-time installation and downloads

The upstream quick start targets Linux and a 24 GB NVIDIA GPU. This wrapper includes Windows launchers and attention fallbacks. Lower-memory configurations depend on song length and settings; CPU mode is intended for development and is impractically slow for normal music generation. Apple Silicon and AMD GPU setup are not provided.

Model weights use CC BY-NC 4.0 (non-commercial). See upstream notices before using the models.

Quick start

Install Python 3.12 and a current NVIDIA driver. On Windows, enable Python's Add python.exe to PATH option.

Download this repository using Git, or use Code → Download ZIP on GitHub and extract the archive:

git clone https://github.com/nalexand/YuE2-3B-studio.git
cd YuE2-3B-studio

Windows

Double-click start.bat. On first launch it runs the installer automatically.

Or run in PowerShell:

.\install.bat
.\start.bat

Linux

Use Python 3.10–3.12 with the venv module available. On Debian/Ubuntu, install the python3-venv package if Python reports that ensurepip is unavailable.

bash install.sh
bash start.sh

Open http://127.0.0.1:7860 after the server starts. Keep the terminal open; press Ctrl+C to stop.

The default installation creates .venv/, installs PyTorch 2.10.0 with CUDA 12.8, installs the web UI dependencies, downloads the official yue2-infer 0.1.5 wheel, and downloads YuE2-3B + YuE2-Vae into models/. It leaves your system Python packages alone. No API key is required for the public model downloads. First-time setup may take a while.

Portable Python commands

The same scripts also work directly, without activating the virtual environment:

python install.py
python launch.py

Use python3 on Linux if python is not available. To select a different official PyTorch build or verify downloaded weights:

python install.py --torch-backend cu126
python install.py --torch-backend cu128 --verify

Available builds: cu126, cu128 (default), cu130, cpu. Choose one compatible with your GPU and driver; see PyTorch's installation commands. The standard install does not require building FlashAttention or installing a separate CUDA toolkit.

Downloads are resumable. Rerun the same install command after a network failure. Model and code revisions are pinned in download_models.py; existing files are reused when they match.

Generate music from lyrics

  1. Choose a full example or write a style prompt, such as “warm indie folk, fingerpicked acoustic guitar, soft drums, intimate vocals.”

  2. Enter lyrics with section markers:

    [Verse]
    We followed the river through the rain
    And watched the morning rise again
    
    [Chorus]
    Carry this light wherever we go
    Over the hills where the wildflowers grow
    
  3. Choose the planning mode: full for melody and chords, melody for melody-only planning, or off to skip symbolic planning.

  4. Click Generate song. The status shows score planning, token generation, acoustic synthesis and audio decoding.

  5. Play or download the FLAC result. Expand Song library to revisit a generation and reload its settings.

Start with a short song while checking your setup. Runtime and GPU memory use depend on hardware, song length and generation settings. Keep the seed and settings for repeatable experiments; identical audio across different hardware or software versions is not guaranteed.

Instrumental music

Use section tags with no sung text, such as [Intro], [Interlude] and [Outro], set planning to off, and describe the instrumental arrangement in the style prompt.

Edit melodies, chords and score-conditioned covers

Open Cover / re-harmonise, paste an ABC score, and enable Use this score for the next generation. Use melody for melody-only conditioning or full for a score with harmony.

After a generation, its ABC score appears in the score panel. Edit the notes or chords, set a new style, and generate another arrangement. This workflow accepts notation; it does not upload or transcribe an audio recording.

Launch options

Pass options through the launcher:

.\start.bat --port 7861 --backend torch-eager
bash start.sh --port 7861 --backend torch-eager
python launch.py --help
Option Purpose
--port 7861 Use another local port
--backend torch-eager Disable CUDA graph capture for troubleshooting
--attention sdpa Force PyTorch SDPA attention
--nar-query-chunk 512 Reduce acoustic attention memory (default: 1024)
--offload-ar Move autoregressive weights to CPU during synthesis
--no-phase-offload Keep branches resident instead of parking idle weights
--no-nar-flash Disable optional FlashAttention acceleration
--quantization fp8 Experimental FP8 mode; hardware/runtime support required
--budget 22 Set the GPU memory budget in GiB
--verify-hashes Verify model weights when loading
--no-preload Open the UI before loading the model
--model-dir, --vae-dir, --output-dir Select alternative model or output folders
--share Create a public Gradio link; the default stays on localhost

The default backend uses PyTorch and does not require vLLM. Optional backends and FlashAttention need their own compatible installations.

Files and generated output

YuE2-3B-studio/
  install.py / install.bat / install.sh   isolated installation
  start.bat / start.sh / launch.py        launch the web app
  download_models.py                     pinned official model/code downloads
  requirements.txt                       runtime dependency versions
  yue2_web/                              Gradio interface, engine, presets
  tests/                                 installer and runtime smoke checks
  models/                                downloaded files (not committed)
  outputs/                               songs and generation data (not committed)
  .venv/                                 Python environment (not committed)

Each generated song has its own directory under outputs/, containing audio, score (when planning is enabled), settings and inference artifacts. The song library reads these files locally.

Credentials, environment files, model weights, downloaded code, caches, logs and generated output are excluded from Git. If authentication is needed for a custom environment, use Hugging Face's normal login or the HF_TOKEN environment variable; never put tokens into source files.

Troubleshooting

Python is missing or unsupported: install 64-bit Python 3.12. On a machine with several Python versions, run py -3.12 install.py on Windows or PYTHON=python3.12 bash install.sh on Linux.

CUDA is unavailable: update the NVIDIA driver and rerun the installer with a supported --torch-backend. Setup checks CUDA and BF16 support before downloading the large model weights.

Out of GPU memory: close other GPU applications, shorten the lyrics, lower Max semantic tokens, keep CFG near 1.0, and lower NAR query chunk. Leave phase offloading enabled. A lower chunk size can trade speed for memory.

CUDA graphs or flash attention fail: launch with --backend torch-eager --attention sdpa --no-nar-flash.

Model download interrupted or weights missing: rerun python install.py. For an integrity check, use python install.py --verify. If a checksum fails, remove only the named corrupt model file and rerun the download.

Song ends early: increase Max semantic tokens or shorten the lyrics, within your GPU's memory limits.

Port already in use: run python launch.py --port 7861.

Linux audio-library error: install your distribution's libsndfile package (for example libsndfile1 on Debian/Ubuntu).

Development and validation

Install the runtime and official code without downloading the weights:

python install.py --torch-backend cpu --skip-models
python launch.py --no-preload

This mode checks the interface; it cannot generate songs without model weights. Run tests with the environment's Python:

.\.venv\Scripts\python.exe -m unittest discover -s tests -v
.venv/bin/python -m unittest discover -s tests -v

CI checks Windows and Linux setup, imports, UI construction and installer failure handling without requiring a GPU or downloading the checkpoints.

FAQ

What is YuE2-3B Studio?

A browser-based local AI song generator and Gradio web UI for YuE2-3B. It adds installation scripts, music-generation controls, score editing and a song library around the official YuE2 inference runtime.

Does it need a paid API or cloud music service?

No paid generation API is used. Models run locally after installation. Initial dependency and model downloads require internet access.

Can I generate vocals and instrumental music?

Yes. Supply lyrics for songs with vocals and accompaniment, or use empty sections and planning off for instrumental generation.

Can I use the models commercially?

The upstream model weights are CC BY-NC 4.0, which restricts commercial use. Review the upstream license and third-party notices.

Is this the official YuE2 repository?

No. This is an independent Studio interface maintained in nalexand/YuE2-3B-studio. The model and inference runtime come from Multimodal Art Projection's YuE project.

About

Local AI music generator and Gradio web UI for YuE2-3B. Lyrics-to-song, vocals, instrumentals, editable ABC scores, and automatic Windows/Linux setup.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages