Local music generation
Last updated
YuE2 local music generation: make vocal songs and arrangements from lyrics
Create a vocal song from lyrics and style with YuE2
YuE2 takes lyrics and musical style, creates a melody-and-chord plan, then outputs a 48 kHz stereo song with vocals and accompaniment combined. You can inspect and revise the score plan, but revisions rerender the whole song rather than editing only part of the waveform.
If you want a short song for a video using your own lyrics, first identify whether you are using YuE v1 or YuE2. The current repository main is YuE2; its README says the original YuE code, documentation, and license are preserved on the YuE-v1 branch. The setup steps, Python API1, 24 GB VRAM2, and RTX 4090 figures below refer to YuE2.
Check official runtime and memory requirements
The official quick start specifies Linux, Python 3.12, and a BF163-capable NVIDIA GPU4 with 24 GB; the Hugging Face quick start documents CUDA5 and recommends 24 GB of available system RAM6. The model card’s roughly 11 GiB peak for a typical generation is not a minimum card capacity. The RTX 4090 full-mode measurement used 11.18 GiB; the maximum-context test used 14.08 GiB. Memory varies with input length, runtime7, and other GPU workloads.
The current official quick start does not include Apple Silicon Metal8, AMD ROCm9, or native Windows paths. That does not prove other environments are impossible, but the commands and figures here do not establish that they work there. Find a separate upstream runtime path and test it directly.
Install in a Python virtual environment and check the first output
Install in a Python 3.12 virtual environment10 so packages do not mix with other music tools. Weights download on first use, requiring network access and disk space. If no request file is specified, the repository’s default request is used, so specify a new output path. Check the truncated indicator along with the completion message and distinguish incomplete output from a finished song.
After the first run, play outputs/first-song/audio.flac and check whether it matches the lyrics and style. The folder also contains score.abc11, semantic tokens12, acoustic latents13, generation settings, and model identifiers.
git clone https://github.com/multimodal-art-projection/YuE.git
cd YuE
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install .python examples/generate.py --output outputs/first-songUnderstand the default path that combines vocals and accompaniment
The default text-to-music path combines vocals and accompaniment from lyrics and style. Keep genre, instruments, vocal character, and tempo consistent in the style; mark the sung words and sections in the lyrics. Example: “soulful low-mid vocal, slow neo-soul, Rhodes and bass, 82 BPM14.” The default output is 48 kHz stereo, not separated vocal and accompaniment stems.
If you need an instrumental, do not assume that writing “instrumental” in the style removes vocals; test a short sample. If vocals leak into the result, consider a dedicated instrumental path or another program.

Review Korean input separately from actual singing
The README mentions multiple languages and publishes English and Chinese examples, while the model-card language tags are Chinese and English. No Korean-specific checkpoint15 or quality evaluation was found. Korean input is separate from pronunciation and lyric accuracy: generate one or two lines before a full song and check for omissions, substitutions, final consonants, liaison, and syllable alignment.
For the first comparison, keep genre and runtime fixed and replay the phrase where pronunciation matters. If there is a problem, adjust lyric syllable count or spacing one at a time and record the input. Have a person review Korean lyrics with important pronunciation requirements before public delivery.

Distinguish the roles of full, melody, and off modes
For a new song, full plans melody and chords before generation. For a cover arrangement, the official documentation recommends melody mode, which plans only the melody and creates accompaniment in a new style. Off generates from lyrics and style without score planning; you can supply your own score as ABC input if it uses supported syntax.
The Python API is plan() → generate_semantic() → synthesize() → decode16(). plan() creates score.abc and plan files; semantic creates music tokens, synthesize creates acoustic latents, and the VAE decoder reconstructs the stereo waveform. This differs from YuE v1’s 7B Stage 1, 1B Stage 2, and XCodec Mini path. Do not mix v1 checkpoints into the YuE2 description.

Revise a score copy and regenerate the whole song
To revise a chorus, keep the original score.abc and change one element in a copy—pitch, rhythm, harmony, or section length. The score edits a plan; it is not a tool for painting over part of an existing waveform, so a revised score rerenders the whole song. You can also resume from a saved plan at the semantic stage.
Rather than overwriting files inside a saved plan, pass a copy of score.abc as the abc argument in a new request. Keep the settings, model identifier, tokens, latents, and truncated status saved by save_artifacts(); store original audio, score, and revisions separately for comparison.
import json
from pathlib import Path
from yue2 import YuE2Pipeline
request = json.loads(Path("examples/song.json").read_text(encoding="utf-8"))
with YuE2Pipeline.from_pretrained("m-a-p/YuE2-3B", device="cuda") as pipe:
song = pipe(**request)
song.save_artifacts("outputs/my-song")
print(song.truncated)Read published speed and VRAM within their conditions
The model card’s RTX 4090 full run generated 214.85 seconds of audio in 71.04 seconds, about 3.02× real time. It is the average of 32 warm requests after model preparation. Conditions were PyTorch17 2.10, Transformers 4.57.6, CUDA graphs18, FlashAttention19, unquantized BF16 AR/NAR20, FP3221 VAE22, and default YuE2-Vae. Initial path resolution and saving are excluded.
Melody generated 214.67 seconds in 68.68 seconds (11.02 GiB); off generated 196.88 seconds in 57.91 seconds (11.09 GiB). H800 full was a single run generating 224.96 seconds of audio in 54.74 seconds with 10.34 GiB.
Scroll sideways to compare all columns.
| Device and mode | Audio | Generation | RTF | Peak memory |
|---|---|---|---|---|
| RTX 4090 · full | 214.85 s | 71.04 s | 0.331 | 11.18 GiB |
| RTX 4090 · melody | 214.67 s | 68.68 s | 0.320 | 11.02 GiB |
| RTX 4090 · off | 196.88 s | 57.91 s | 0.294 | 11.09 GiB |
| H800 · full (one run) | 224.96 s | 54.74 s | 0.243 | 10.34 GiB |
Explore broader speed and hardware comparisons
When comparing model-card measurements with your own workflow, align preparation, warm-up, and saving conditions. A separate guide covers how to compare figures across music models.
Check weight terms separately from lyric and recording rights
The official terms dated September 16, 2026 apply Apache 2.0 to code and documentation, and CC BY-NC 4.0 plus additional creator permission to YuE2-3B/VAE weights. Individual content creators and musicians may publish, distribute, sell, license, and monetize generated work without a separate commercial license or rights-holder fee/royalty. Commercial use of the weights themselves by a company is not covered and requires a separate license.
These terms do not grant rights to supplied lyrics, compositions, recordings, or a particular singer’s voice and identity. Check each applicable term when combining other checkpoints, tools, or data or redistributing weights; record the version, license, and necessary permissions before release.
Terminology notes
API — A defined interface that lets other code call a program’s functions.
Back to the textVRAM — Memory used by a graphics card’s GPU to store model weights and intermediate values.
Back to the textBF16 — A 16-bit floating-point format for model values. Its exponent has the same width as FP32, giving it a similarly wide value range.
Back to the textGPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.
Back to the textCUDA — A software platform for general-purpose computing on NVIDIA GPUs.
Back to the textSystem RAM — System memory that temporarily holds data while programs run.
Back to the textRuntime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.
Back to the textMetal — Apple’s low-level technology for graphics and parallel GPU computation.
Back to the textROCm — AMD’s software platform for AI and high-performance computing on GPUs. Support depends on the combination of GPU, operating system, driver, and framework versions.
Back to the textPython virtual environment — An isolated space for installing Python packages per project, helping reduce package-version conflicts.
Back to the textABC notation — A text notation for score information such as pitch and rhythm.
Back to the textToken — A unit into which a model divides input or output for processing.
Back to the textLatent representation — An intermediate representation in which a model encodes input information compactly. A decoder is usually needed to reconstruct an image, audio, or other output.
Back to the textBPM — Short for Beats Per Minute, a tempo measure indicating the number of beats per minute.
Back to the textCheckpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.
Back to the textToken decoding — The stage that generates successive output tokens using the input and the response produced so far.
Back to the textPyTorch — A software framework for building and running AI models. Check the compatible PyTorch version and hardware support along with the model.
Back to the textCUDA Graphs — A CUDA feature that records and reuses a sequence of GPU operations. It can reduce submission overhead.
Back to the textFlashAttention — An attention algorithm that computes in tiles, keeps intermediate values in fast on-chip memory, and reduces GPU-memory traffic without storing the full attention matrix.
Back to the textAR / NAR — AR (autoregressive) generation proceeds in order, conditioned on prior outputs. NAR (non-autoregressive) generation is less sequential.
Back to the textFP32 — A 32-bit floating-point format. It uses more memory per value than BF16 and can represent values more precisely.
Back to the textVAE — Short for Variational Autoencoder. It can encode input into a compact latent representation or decode that representation into an output.
Back to the text
Frequently asked questions
- What should you check first in this article?
- YuE2 takes lyrics and musical style, creates a melody-and-chord plan, then outputs a 48 kHz stereo song with vocals and accompaniment combined. You can inspect and revise the score plan, but revisions rerender the whole song rather than editing only part of the waveform.
- How much memory does it need?
- The official quick start specifies Linux, Python 3.12, and a BF16-capable NVIDIA GPU with 24 GB; the Hugging Face quick start documents CUDA and recommends 24 GB of available system RAM. The model card’s roughly 11 GiB peak for a typical generation is not a minimum card capacity. The RTX 4090 full-mode measurement used 11.18 GiB; the maximum-context test used 14.08 GiB. Memory varies with input length, runtime, and other GPU workloads.
- When is it better not to choose this?
- The official terms dated September 16, 2026 apply Apache 2.0 to code and documentation, and CC BY-NC 4.0 plus additional creator permission to YuE2-3B/VAE weights. Individual content creators and musicians may publish, distribute, sell, license, and monetize generated work without a separate commercial license or rights-holder fee/royalty. Commercial use of the weights themselves by a company is not covered and requires a separate license.
- Where can you check the conditions and sources?
- The README mentions multiple languages and publishes English and Chinese examples, while the model-card language tags are Chinese and English. No Korean-specific checkpoint or quality evaluation was found. Korean input is separate from pronunciation and lyric accuracy: generate one or two lines before a full song and check for omissions, substitutions, final consonants, liaison, and syllable alignment.
Read next
Local speech recognition & synthesis
Separate voices and sounds in recordings with SAM Audio
Image and video generation
Add sound effects to a video with MMAudio
Local music generation
Local AI music generation: make songs and background music on your computer
Local music generation
Run ACE-Step 1.5 locally: setup through your first song
