Check your environment
On the Linux machine that will render the audio, run these two checks before downloading the weights.
python3 --version
nvidia-smi
The Python version should be 3.10 or newer. The second command should identify the NVIDIA card and its available memory. Compare that figure with the BF16 row below. A desktop install or an int8 graph uses different packages. Follow Studio setup or the ComfyUI file map for those routes.
The model team’s quick start lists the supported Python environment and the inference wheel.
Hardware requirements
YuE2-3B is a three-billion-parameter model that writes a score and then renders 48 kHz stereo audio. Memory, not raw speed, decides what you can run.
| Setup | VRAM | System RAM | Disk |
|---|---|---|---|
| Official BF16 (full precision) | 24 GB recommended (~11 GiB peak measured on an RTX 4090) | 24 GB+ | ~7 GB weights + 10–20 GB for Python packages |
| ComfyUI int8 checkpoint | 12 GB comfortable | 16 GB+ | ~4–5 GB model + ComfyUI |
| YuE2 Studio quantized sets | 5.5–12 GB depending on set | 16 GB+ | 4–10 GB |
| CPU only | — | 32 GB | Possible in some builds, hours per song |
Check your GPU:
- Linux / Windows with NVIDIA drivers: run
nvidia-smiin a terminal and read the memory column. - Windows: open Task Manager → Performance → GPU and read Dedicated GPU memory.
AMD and Intel GPUs are supported only experimentally (through Vulkan in some community builds), and reports of unintelligible vocals on integrated graphics exist. Treat NVIDIA as the supported path.
Downloading YuE2 from Hugging Face
All official files live on Hugging Face. You rarely need to download them by hand — each route below fetches what it needs — but it helps to know what is what.
| Repository | Contents | Used by |
|---|---|---|
m-a-p/YuE2-3B | Official weights (~7 GB) and the yue2_infer Python wheel | Official Python route, PSY Music Studio |
Comfy-Org/YuE2 | yue2_3b_int8_convrot.safetensors, sheetsage2_bf16.safetensors | ComfyUI templates |
| Community conversions (GGUF, MLX) | Quantized or Apple-Silicon builds | Desktop apps, experiments |
Install the Hugging Face command-line tool and download a whole repository like this:
python -m pip install "huggingface-hub==0.36.2"
hf download m-a-p/YuE2-3B --local-dir ./YuE2-3B
Files are cached under ~/.cache/huggingface unless you set HF_HOME. If Hugging Face is slow or blocked where you are, point the tool at a mirror first:
export HF_ENDPOINT=https://hf-mirror.com
On Windows PowerShell use $env:HF_ENDPOINT="https://hf-mirror.com" instead.
Install the official Python package on Linux
This is the reference implementation from the M-A-P team. It gives you every option the model supports and is the base other tools wrap.
Step 1 — prepare the system
You need a Linux machine with a recent NVIDIA driver, CUDA-capable PyTorch support, Python 3.10 or newer, and a GPU that supports BF16 (RTX 30-series and newer, or recent data-center cards). Confirm the driver with nvidia-smi.
Create an isolated environment so YuE2's dependencies don't collide with other projects:
python3 -m venv ~/yue2-env
source ~/yue2-env/bin/activate
python -m pip install --upgrade pip
If pip later installs a CPU-only PyTorch, install the CUDA build that matches your driver from the PyTorch website first, then continue.
Step 2 — install the inference package
The model card distributes the inference code as a wheel inside the model repository. At the time of writing:
python -m pip install "huggingface-hub==0.36.2"
hf download m-a-p/YuE2-3B yue2_infer-0.1.5-py3-none-any.whl --local-dir .
python -m pip install ./yue2_infer-0.1.5-py3-none-any.whl
Version numbers change between releases — copy the current file name from the model card if the command above can't find it.
Step 3 — generate your first song
Save this as song.py:
from yue2 import YuE2Pipeline
pipe = YuE2Pipeline.from_pretrained("m-a-p/YuE2-3B", device="cuda")
style = "indie pop, warm female vocal, bright guitars, steady drums, hopeful"
lyrics = """[Verse]
Streetlights hum a quiet tune
Coffee cooling in my room
[Chorus]
So I'll sing it one more time
Paper heart and borrowed rhyme
"""
song = pipe(style=style, lyrics=lyrics, cot="full", seed=42)
song.save("song.flac")
Run it with python song.py. The first run downloads the weights (about 7 GB) and is slow; later runs start in seconds. On an RTX 4090 the model card reports about 71 seconds for a 3.6-minute song.
Step 4 — understand the options
| Option | Values | Effect |
|---|---|---|
style | Free text | Genre, voice, language, instruments, mood, tempo |
lyrics | Text with [Verse], [Chorus], [Bridge], [Outro] tags | The sung words and the song's structure |
cot | full (default), melody, off | Whether YuE2 plans melody + chords, melody only, or nothing before rendering |
seed | Integer | Same inputs + same seed reproduce a take; change it for a new take |
Use cot="full" for new songs. melody leaves more freedom to the accompaniment and is the recommended mode for covers. off is faster but follows your structure less reliably. The model card also documents covers (via SheetSage2 transcription), bring-your-own ABC scores and an editing agent; follow its current examples, as those interfaces are still evolving.
How to read local speed numbers
In the model card’s RTX 4090 example, a roughly 3.6-minute song took about 71 seconds to generate. That is a reference run. For a comparison on your own machine, record the model build, planning mode, output length and peak VRAM. Measure once after the model is loaded so download and startup time do not dominate the result.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
CUDA out of memory | Model or song length too big for your card | Use a quantized build, shorten the lyrics, close other GPU apps |
| PyTorch says CUDA is unavailable | CPU-only PyTorch installed | Reinstall the CUDA build of PyTorch that matches your driver |
| Flash-attention warning or crash | Missing or mismatched flash-attn | Use the eager attention backend |
| Download stalls | Hugging Face slow or blocked | Set HF_ENDPOINT to a mirror, resume the download |
| Song stops mid-chorus | Duration or token budget too small | Raise the maximum duration setting |
| Garbled or unintelligible vocals | Experimental GPU backend or very low-bit quantization | Use an NVIDIA card or a larger model set |
| Windows installer fails | Missing WebView2 runtime | Install the Evergreen Standalone WebView2 runtime |
| First run is very slow | Weights downloading and caching | Wait once; later runs start quickly |
License before you publish
The YuE2 code and the YuE2-3B weights are licensed separately. The weights use CC BY-NC 4.0 (non-commercial), and the community desktop studio documents an additional permission that lets individual creators publish and monetize their own songs while companies need a license from the authors. The SheetSage2 transcription model used for covers is also non-commercial. Licenses can change — read the current model card before releasing anything commercially.
Check the result before changing parameters
Play the FLAC after the first successful run. If it sounds as expected, keep that prompt and seed as a starting point for later tests. To hear the model before installing it, start with the published YuE2 song examples.




