Nodes/ComfyUI-FL-YuE2/FL YuE2 · LoRA Trainer
ComfyUI Node

FL YuE2 · LoRA Trainer

It stops every 200 steps and renders you a sample

By filliptm·Created 6 days ago·Updated about 14 hours ago· 96
FL YuE2 · LoRA Trainer
  • assets
  • dataset
  • config
  • adapter
action
output_namemy_song_lora
resume
selected_step0
render_previewstrue
preview_styleinstrumental piano
preview_lyrics
preview_seed42
preview_seconds30

What it is and why you'd reach for it

This is the node the whole training half of the pack exists for: it trains an AR song-generation LoRA for YuE2-3B, from your recordings, inside ComfyUI, and hands the result to Load LoRA without you ever touching a train.py.

What makes it more than a wrapper is that it stops in the middle of a long job and lets you listen. Every save_every steps it renders a sample from the checkpoint it just saved, then picks training back up. So the question "which checkpoint should I actually use?" gets answered by ear instead of by hope. On image LoRAs the standard advice is that the last epoch is usually not the best one; the same is true of music, and this node is built around admitting that.

The inputs that matter

action - train or use_saved. train runs the pipeline; use_saved skips preparation and training entirely and just selects a checkpoint from an existing run. The UI's Use button flips you into use_saved for you.

output_name (default my_song_lora) - the run folder name, inside output/yue2_training. This is the field that eats work. Training with train and a blank resume starts fresh and overwrites that run and all its checkpoints and previews. Want two experiments? Two names.

resume - a checkpoint path relative to the run folder, normally resume.pt. Blank means from scratch; set it after an interruption and training continues from the saved optimizer and random state. Existing results are preserved on an explicit resume.

selected_step - which checkpoint the output adapter should be. 0 means the latest. Any other value must match a step that was actually saved, or you get "No checkpoint at the selected step".

Then the preview block: render_previews, preview_style, preview_lyrics, preview_seed, preview_seconds. Include your dataset trigger in preview_style - the tooltip says so and it's right, otherwise you're comparing samples that never asked for the thing you trained. Leave preview_seed fixed so the only variable is the adapter.

Optional assets, dataset and config come from Training Models, Prepare Dataset and Train Config. They're lazy inputs, so they only get evaluated when train actually needs them - and it does need all three, with a clear error if you forget one.

Output: a single adapter of type YUE2_ADAPTER. Wire it straight into Load LoRA, where a connected adapter takes precedence over the dropdown.

How it works

Training does not run in ComfyUI's process. The node unloads every loaded model, clears the cache, and launches a worker subprocess that does the training and reports progress back over a stream so the node can show it. GPU operations across the pack are serialized behind a lock file, which is why you can't accidentally train and render a song at the same time.

With previews on, the loop is: train → save a checkpoint → pause → release training VRAM → load the base model + the checkpoint adapter → render a sample → reload and resume training from resume.pt. That's the trade: previews cost you rendering time and a model reload at every checkpoint, and they hand you the memory back in between. Samples are written as FLAC files next to the run's run.json, named for the step and for a fingerprint of your preview settings. Change any preview setting and every existing preview counts as missing and gets re-rendered.

Artifacts split across two places: the adapter lands in models/loras/YuE2/<run>/ where Load LoRA can see it, while metrics, previews and the complete resumable training state live in output/yue2_training/<run>/. The run.json there is the ledger, labelled with the mode - use_saved refuses anything that isn't an AR run.

Install

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   # transformers, soundfile, scipy, demucs, google-genai

Or ComfyUI Manager, search ComfyUI-FL-YuE2, then add the training requirements in ComfyUI's Python environment - the worker will not install anything for you. Restart after installing.

Start from the pack's example_workflows/training_studio.json rather than building the six-node chain from scratch. Note the warning about training_smoke.json too: it deliberately truncates sequences to make a two-step pipeline check fast, so it's a smoke test and not a settings preset.

Hardware honesty: the pack was validated on an RTX PRO 6000 Blackwell with Torch 2.11, and its own docs say other devices and 24 GB configurations are unvalidated. Training a 3B model is not a small-card activity. Close other GPU work, and lower sequence_tokens in Train Config if you're fighting for memory.

Where people get burned

You interrupted a run. The worst outcome isn't the interruption, it's re-queueing with a blank resume and overwriting the checkpoints you wanted to keep. Set resume=resume.pt.

A bare "worker failed". The real traceback is in the job log under output/yue2_training/jobs/. Read that before touching any setting.

Previews feel too slow. They are - rendering plus a full model reload at every save interval. For a long uninterrupted run, turn them off; for a run where you actually care which checkpoint wins, they're the cheapest insurance in the pipeline.

Resuming with different settings. Explicit resume expects matching data, assets and training settings. Change the config, change the run name.

Overfitting you can hear. If every preview sounds like a copy of one training track and the style prompt stops mattering, that's the classic signature - fewer steps, lower rank, or a bigger generated_fraction. Preview at 30 seconds with a fixed seed is exactly the instrument for spotting it before step 1600.

CategoryFL YuE2/Training

Inputs (12)

NameTypeDefaultDescription
actionCOMBOUse saved selects/previews checkpoints without running preparation or training.
output_nameSTRINGmy_song_loraRun folder inside output/yue2_training. Training with blank resume overwrites this run and its saved checkpoints/previews. Change the name to keep the old run.
resumeSTRINGResume checkpoint path relative to this run folder. Leave blank to train from scratch and overwrite existing results with this output name.
selected_stepINT00–1000000 selects the latest saved checkpoint.
render_previewsBOOLEANtrueRender a step-0 baseline and a sample at each save_every checkpoint, then resume training. Releases training VRAM during inference; adds rendering and reload time. Also renders missing samples for saved runs.
preview_styleSTRINGinstrumental pianoStyle prompt used for every checkpoint sample. Include your dataset trigger for a useful comparison.
preview_lyricsSTRINGLyrics for checkpoint samples. Leave blank for instrumental previews.
preview_seedINT42Fixed generation seed shared by checkpoint samples so differences are easier to compare.
preview_secondsINT308–360Maximum duration in seconds for each checkpoint sample. Longer samples take more time to render.
assetsoptYUE2_TRAINING_ASSETS
datasetoptYUE2_PREPARED_DATASET
configoptYUE2_TRAIN_CONFIG

Outputs (1)

NameTypeDescription
adapterYUE2_ADAPTER