FL YuE2 · Joint Score Train Config
Two LoRAs, one node, and a KL leash
- YUE2_TRAIN_CONFIG
If you've trained a LoRA on anything in the last two years, you already know the shape of the ritual: dataset in, rank and learning rate out. The FL YuE2 · Joint Score Train Config node is that ritual for YuE2 - except YuE2 isn't one model. It's an autoregressive transformer that writes music tokens from lyrics and style, then a non-autoregressive (NAR) acoustic stage that turns those tokens into 48 kHz stereo audio. This node produces a config object that trains both at once, which is why it exists at all.
It's the "AI Toolkit-style" recipe the pack calls ai_toolkit_joint_v1. The older FL YuE2 · Train Config is the legacy AR-only path; you swap this one in for a joint run (example_workflows/training_studio.json ships with the legacy node).
What it actually does
The node itself is inert. It has no inputs to wire and doesn't touch the GPU - it just packages your settings into a YUE2_TRAIN_CONFIG and hands it to the LoRA Trainer node's optional config input, alongside training assets and a prepared dataset. All the real work happens in the worker.
Under the hood the trainer installs LoRA weights on the AR transformer projections and a second set on the NAR side, then trains three things per step: full-song AR cross-entropy on your recordings, a KL divergence term against the frozen base model, and sigmoid-timestep flow matching on random windows of acoustic latents. The KL term is the interesting choice - it replaces the replay/regularizer pack legacy AR training needs, which is roughly why the joint recipe measured lighter in the pack's own benchmark (9.03 GB peak versus 11.60 GB, and 1.88× faster, over a 300-step smoke split).
The settings that matter
Fourteen fields sounds like a lot. In practice you touch four.
- rank (default 32) - capacity for both AR and NAR projections. Raise it only if you have the dataset to justify it; the LR schedule is constant, so a big rank on 20 minutes of audio just overfits.
- abc_dropout (0.5) - the probability a step trains in direct mode, i.e. without the ABC score prefix. This is what keeps plain text-to-music generation working after score-conditioned training. Set it to 0 and you've trained a model that expects a score.
- ar_kl_weight (0.2) - how hard the adapter is held to the base AR distribution. Up it if your model starts sounding like your dataset and nothing else; drop it toward 0 if you want the LoRA to actually move.
- nar_start -
baseorcommunity_v4.basematches the AI Toolkit recipe;community_v4folds the released acoustic adapter in first. Pickcommunity_v4only for an explicit A/B, and note the pack's own benchmark says the base-NAR path needs more data before it can beat the community-adapter route.
The rest are the usual: learning_rate (1e-4), weight_decay (1e-4), ar_lr_multiplier (1.0, scales the AR group only against the shared rate), acoustic_window_frames (1500 - 60 s, since YuE2 runs at 25 frames per second; drop it for smaller cards), sequence_tokens (24576, the max), allow_truncation (off, so an oversized song errors instead of losing its ending), steps (3000), save_every (200), accumulation (1), seed (42).
Installing and running it
Same pack, same install as everything else here:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI-FL-YuE2.git
cd ComfyUI-FL-YuE2
python -m pip install -r requirements.txt
python -m pip install -r requirements-training.txt
The second file is the one that matters here - google-genai, transformers, soundfile, scipy, demucs==4.0.1. Install it into the Python environment that runs ComfyUI; the workers install nothing for you. Then restart, queue Training Models with download_missing on, and expect multi-GB pulls (base weights, MERT-v2-FullSong, the v4 tokenizer head, the regularizer pack).
Where people get burned
- Your prepared dataset must have score tokens. In Prepare Dataset, set
score_planningtomelodyorfull- with itoff, the trainer refuses to start outright. If you don't have.abc.txtsidecars, enabletranscribe_missing_scoresand let pinned SheetSage2 write them (CC BY-NC 4.0). - It needs real recordings, both splits. The joint recipe trains on your audio, not a replay pack, and it requires at least one train and one validation song. A "dataset" of two files technically runs and technically overfits.
- Resume is signature-checked. Config, dataset fingerprint, model revision and assets all go into a fingerprint; change any one and your
resume.ptis rejected. Joint runs also can't resume from a legacy AR checkpoint - start fresh. - You get two files, not one. Each checkpoint writes
step-NNNNNN.safetensorsandstep-NNNNNN-nar.safetensorsundermodels/loras/YuE2/<run>/. Copy them together. Load LoRA picks up both automatically, and the NAR adapter scales the entire acoustic companion including its pretrained component.
One expectation to set: on the pack's tiny benchmark, neither trained AR adapter beat the base model on the single held-out recording. Validate on a real artist dataset with your own ears - this isn't a button that makes the model better.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| rank | INT | 321–128 | LoRA rank for both AR and NAR transformer projections. |
| learning_rate | FLOAT | 0.00011e-7–0.01 | — |
| weight_decay | FLOAT | 0.00010–0.1 | — |
| ar_kl_weight | FLOAT | 0.200–2 | KL(base || adapter) weight used to preserve the base AR distribution. |
| abc_dropout | FLOAT | 0.500–1 | Probability of training an example in direct mode without its score. |
| ar_lr_multiplier | FLOAT | 1.000.01–2 | — |
| acoustic_window_frames | INT | 150064–3000 | Random NAR flow-matching window. YuE2 uses 25 frames per second. |
| nar_start | COMBO | base | AI Toolkit starts from base NAR; community_v4 folds the released acoustic adapter first. |
| sequence_tokens | INT | 24576256–24576 | — |
| allow_truncation | BOOLEAN | false | — |
| steps | INT | 30001–100000 | — |
| save_every | INT | 2001–5000 | — |
| accumulation | INT | 11–64 | — |
| seed | INT | 420–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| YUE2_TRAIN_CONFIG | YUE2_TRAIN_CONFIG | — |