Local recording

Run YuE2 Locally with Python

Install the official Python runtime on Linux and render a song to FLAC. Check your hardware first, then follow the commands through to the first playable file.

24 GB GPUThe model team’s recommendation for its BF16 Python setup.

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.

SetupVRAMSystem RAMDisk
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 checkpoint12 GB comfortable16 GB+~4–5 GB model + ComfyUI
YuE2 Studio quantized sets5.5–12 GB depending on set16 GB+4–10 GB
CPU only—32 GBPossible in some builds, hours per song

Check your GPU:

  • Linux / Windows with NVIDIA drivers: run nvidia-smi in 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.

RepositoryContentsUsed by
m-a-p/YuE2-3BOfficial weights (~7 GB) and the yue2_infer Python wheelOfficial Python route, PSY Music Studio
Comfy-Org/YuE2yue2_3b_int8_convrot.safetensors, sheetsage2_bf16.safetensorsComfyUI templates
Community conversions (GGUF, MLX)Quantized or Apple-Silicon buildsDesktop 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

OptionValuesEffect
styleFree textGenre, voice, language, instruments, mood, tempo
lyricsText with [Verse], [Chorus], [Bridge], [Outro] tagsThe sung words and the song's structure
cotfull (default), melody, offWhether YuE2 plans melody + chords, melody only, or nothing before rendering
seedIntegerSame 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

ProblemLikely causeFix
CUDA out of memoryModel or song length too big for your cardUse a quantized build, shorten the lyrics, close other GPU apps
PyTorch says CUDA is unavailableCPU-only PyTorch installedReinstall the CUDA build of PyTorch that matches your driver
Flash-attention warning or crashMissing or mismatched flash-attnUse the eager attention backend
Download stallsHugging Face slow or blockedSet HF_ENDPOINT to a mirror, resume the download
Song stops mid-chorusDuration or token budget too smallRaise the maximum duration setting
Garbled or unintelligible vocalsExperimental GPU backend or very low-bit quantizationUse an NVIDIA card or a larger model set
Windows installer failsMissing WebView2 runtimeInstall the Evergreen Standalone WebView2 runtime
First run is very slowWeights downloading and cachingWait 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.

Frequently asked questions