Skip to content

Music Trainer

speedyrulz edited this page Dec 1, 2026 · 10 revisions

RulZ Music Trainer

Trains LoRAs for local music models from a folder of songs, with a guided WebUI. It renders sample songs while it trains, with a player for each, and exports LoRAs that load in ComfyUI.

Version 0.10 trains ACE-Step 1.5 (2B and XL, MIT weights) with LoRA, LoKr or DoRA, and Stable Audio 3 (Small music, Small sound effects and Medium) with LoRA or DoRA. It writes the lyrics, captions, BPM and key a dataset is missing, splits songs into vocal and instrumental stems, finds near-duplicate songs, scores probe songs while it trains, lets you compare checkpoints by ear (blind if you like) and races settings against each other. It trains on this PC's GPU or on GPUs rented from vast.ai, with a Fleet tab that queues runs and races over several of them, and a run on vast.ai can render its sample and probe songs on this PC's GPUs while the rented GPU keeps training. MiniMax-Music3, HeartMuLa and YuE2 are planned.

The Monitor: progress, loss chart and a player for every sample

What you need

  • Windows or Linux, Python 3.10 to 3.12 and an NVIDIA GPU. A 16 GB card has room for ACE-Step 1.5 2B: on an RTX 5090, whole songs of 3 to 4 minutes trained in about 5 GB and 30 second crops in about 6.5 GB.
  • About 4 GB for setup (CUDA PyTorch and libraries), plus the model the first run downloads into the Hugging Face cache: about 11 GB for ACE-Step 1.5, 3.5 GB for Stable Audio 3 Small, 10.5 GB for Medium.
  • Songs you have the rights to train on: your own work, music licensed to you for this, or public-domain recordings.

Getting started

  1. Install it from the launcher, under AI Training, and launch it. A console opens and the WebUI opens in your browser at http://localhost:7880 (RulZ AI Trainer uses 7870, so both can run at once).
  2. Wizard: choose your song folder. It counts the songs and their lyrics and captions, reads your GPU, and fills in the Train page with starting settings.
  3. Dataset: press Prepare missing only to have lyrics, captions, BPM and key written for the songs that lack them (see below). Open a song to hear it, correct its caption and lyrics (Save writes them next to the song), and say where the music comes from under Rights. The rights are written into every LoRA trained on that folder.
  4. Train: check the settings and press Start training.
  5. Monitor: follow the loss and listen to the samples as they arrive. Stop ends early after saving a checkpoint and exporting the LoRA.

Closing the console stops the WebUI but not a running training job; the WebUI picks the job up again when you start it.

The song folder

One audio file per song (WAV, FLAC, MP3, OGG, M4A, AAC or Opus), with ACE-Step's sidecar files next to it:

File What it holds
song.caption.txt A description of the sound: genre, instruments, mood, tempo
song.lyrics.txt The lyrics with section tags such as [Verse] and [Chorus]; [Instrumental] or an empty file for none
song.json Optional: caption, bpm, keyscale, time signature, language, a custom tag

Files and folders whose names start with a dot are skipped. The encoded copy of the songs is kept in .rulz_cache inside the folder and is made again when a song or its sidecars change.

Preparing a dataset

The Prepare card on the Dataset page fills in what each song is missing:

  • Lyrics with section tags, from ACE-Step's own transcriber (the default) or Whisper large-v3. With the lrclib switch on, published lyrics from lrclib.net are used when they match the transcript; it is off by default because it sends each song's artist and title to that public service.
  • Language from the transcriber, a caption from ACE-Step's captioner, BPM from a beat tracker (Beat This), the key from the song's harmony, and the duration.

Your own text is never replaced: where a song already has a caption, lyrics or a JSON value, the prepared text waits next to yours with Accept and Dismiss. Text from a model is marked Read through until you save the song or press Looks right.

The models download the first time (the transcriber and the captioner about 22 GB each, Whisper about 3 GB) and load one at a time; cards under 24 GB load them in 4 bit (about 10 GB in use). Preparation and training share the GPU, so the WebUI runs one job at a time.

On 20 English benchmark songs, ACE-Step's transcriber missed 26.3% of the words and Whisper large-v3 28.4%, so ACE-Step is the default; it also writes the section tags and the language itself. Whisper is about four times faster.

Stems, duplicates and loudness

Three more Prepare options, all off by default:

  • Stems (vocals and instrumental): HTDemucs (Meta's Demucs v4, MIT) writes a vocal and an instrumental stem of each song into .rulz_stems inside the folder (about 340 MB of models the first time; about 7 s a song on an RTX 5090). An opened song shows a player for each stem, and training can use the instrumental stems.
  • Lyrics from the vocal stem: on the benchmark it did not help (26.1% of words missed against 26.3% from the whole song), so it stays off.
  • Find duplicates: compares every song with every other one using LAION's CLAP music-and-speech model (about 780 MB) and lists pairs that sound almost the same under Possible duplicates, with two players and Not the same song. Nothing is deleted. On the 20 benchmark songs it found all 80 altered copies (re-encoded, cut, quieter or an excerpt) and flagged 1 of 270 comparisons of different songs.

Settings worth knowing

  • Crop length: 30 seconds per step is about twice as fast as whole songs. The wizard picks 30 s on cards under 24 GB and whole songs on bigger ones.
  • Rank 8, alpha 16, learning rate 1e-4: ACE-Step's own starting values.
  • Batch size is always 1 (ACE-Step's model does not mask padding); use Gradient accumulation for a larger effective batch.
  • Samples: a set at the start (the model before training), every N steps and at the end.
  • Variant: train on base (recommended) or sft, of the 2B model or of XL (about 5B parameters, a 20 GB download). Turbo is for fast generation, not for training.
  • Adapter: LoRA or LoKr, with DoRA optional on either. All load in ComfyUI; the PEFT folder is written for plain LoRA only. A LoKr wants a higher learning rate: start around 1e-3 (measured on 2B: 1e-4 barely changed the output, 1e-2 drifted away from the training songs).
  • Base weights: bf16, or int8 (about half the memory). XL with int8 trained, with probes, inside a 15 GB limit on a rented RTX 5090, so it is meant for 16 GB cards; the wizard suggests it for XL under 24 GB.
  • Train on: full songs, or Instrumental stems for an instrumental LoRA (run Prepare with Stems first).
  • Loudness target (LUFS): empty leaves the songs as they are; a value such as -14 brings each song to that loudness before encoding. The files are not changed.

Probes and scores

With Probes and scores on (the default), every sample step renders a fixed set of probe songs at 4 seeds and scores them: the first training song's caption with and without vocals, a neutral caption, and each held-out song's own caption and lyrics. One song in eight is held out of training automatically (6 songs or more); the Held out tick on the Dataset page changes the pick.

Each render gets a style score (CLAP: how close it sounds to the training and held-out songs), a memorization check (does a 10 s stretch of its melody, in any key, or its sung words match a training song), lyric accuracy (Whisper, change since step 0) and Audiobox Aesthetics scores. The Monitor's Scores card shows each step's numbers with their spread over seeds, a drift chart and the step's renders with players.

There is no automatic best checkpoint: on a rented RTX 5090, style similarity on the in-style and held-out probes moved less with training than between seeds. The measurable sign of a LoRA learning the style was the neutral probe drifting toward the training songs. Compare by ear on the Compare page: a step is worth keeping when drift rises clearly above its spread and nothing is flagged. A probe set added about 55 s per sample step and peaked at 9.5 GB of GPU memory.

Compare and keep

The Compare page plays two probe renders of the same probe and seed side by side: two steps of one run, or the same step of two runs. One play button and seek bar drive both, A / B (or F) picks which one you hear, and both play at the same loudness. Blind mode hides which is which until you vote (keys 1, 2, 3); the Votes panel tallies blind votes per run and step.

Every scored step keeps a checkpoint (about 66 MB). Keep this one exports that step's LoRA next to the run as <run name>-chosen.safetensors and <run name>-chosen_peft/, the same files as the run's own export.

Races

The Race group on the Train page trains the same dataset 2 to 4 times with one setting changed (LoRA rank, learning rate, crop length, timestep mode or steps), one run after another, each with the same probes, seeds and held-out songs. With rank, alpha follows it so the LoRA's strength stays the same. The Monitor follows the current run; Stop ends it and cancels the rest. Compare the runs on the Compare page.

Stable Audio 3

Choose Stable Audio 3 at the top of the Train page or in the wizard. It makes instrumental music and sound effects from a caption; lyrics are not used, so there are no lyric probes or scores.

  • Licence: the weights are under the Stability AI Community License (free for research, non-commercial use and commercial use below US$1M a year after registering with Stability); the text encoder is under the Gemma Terms of Use. The app shows a summary with links the first time and downloads nothing until you accept. A LoRA you share must travel with the Notice file and licence copy the app writes next to it, and say "Powered by Stability AI".
  • Variants: Small music and Small sound effects (about 0.6B parameters, up to 120.7 s) and Medium (about 2.3B, up to 380.4 s). Adapter: LoRA (rank 16) or DoRA.
  • Training follows Stability's own LoRA training (its timestep sampling, 10% of steps without the caption, its masks, AdamW without clipping), on whole songs up to the variant's length by default.
  • Measured on a rented RTX 5090: the model, text encoder, audio codec and training loss match Stability's code exactly on the real weights of all three variants. Small trained whole songs in about 2.2 GB; a Medium run on whole songs with probes peaked at 10.1 GB. A 16 GB card has not been tried.
  • Captions matter: Stable Audio 3 renders from the caption alone, so songs with one shared caption give identical in-style and held-out probes.

The LoRA

Each ACE-Step run writes <name>.safetensors, which loads with ComfyUI's LoRA loader on ACE-Step 1.5, and <name>_peft/, a PEFT adapter folder for ACE-Step's own tools. A Stable Audio 3 run writes <name>.safetensors for ComfyUI, <name>_sa3.safetensors for Stability's own code, <name>.NOTICE.txt and <name>.LICENSE.md. In ComfyUI, Stable Audio 3 DoRA files load exactly on the base model they were trained on and closely on the tuned models. All record the base model, the training settings and the dataset's rights.

Training on vast.ai

The app can train on a GPU rented from vast.ai. The PC keeps the dataset, the settings and the results; the instance only trains, reached over ssh. You need a vast.ai account with credit, its API key stored with vastai set api-key <key> (the Rent GPUs page shows how), and this PC's ssh key on the account (the app offers to add it).

  • Rent GPUs lists offers with their price, rents from a confirmed click after reading the price again (it refuses a rise above 0.5%), and starts, stops or destroys this app's own instances. Instances bill while idle; a stopped one still bills for its disk.
  • Send to vast.ai on the Train page or in the wizard sends one run to an instance you pick or a new rental. The dialog shows what goes up (the dataset with its stems; the encode cache stays here), the settings that change, what happens after the run (stop the instance, destroy it, or leave it running, always after every result is downloaded) and the cost; an optional safety stop on the instance stops it after idle minutes. A Stable Audio 3 send carries your licence acceptance, and the instance downloads the weights with the HF_TOKEN from your vast.ai account's environment variables.
  • Install: an instance without the Music Trainer gets it after a confirm (into /workspace/RulzMusicTrainer, with its own Python environment, in a minute or a few).
  • Results: the run shows on the Monitor and Compare pages while it trains; logs, samples and the exported LoRA download into <output folder>/<run name>/. Stop on the Monitor stops that run on the instance and keeps its export.
  • With RulZ AI Trainer on the same account: the apps keep their state apart and never take each other's instances (this app's rentals are labelled rulz-music-...; RulZ AI Trainer 4.12.2 and newer skip them). On a RulZ AI Trainer instance the Music Trainer installs beside it, always leaves it running, never relabels it, and does not start a run while RulZ AI Trainer trains there.
  • Races on vast.ai: Send to vast.ai with the Race group filled sends the whole race to one instance (its runs one after another). On the Fleet tab a race can also be split: each run on its own instance, at the same time. The Monitor shows the race with its runs and a Stop the whole race button; Compare groups its runs. A race counts as finished only when every run is downloaded, so an after-run stop or destroy never comes between runs.
  • One send per instance at a time. Rendering samples on this PC while the instance trains comes in 0.10.
  • Checked on rented RTX 5090s: in 0.8 on one set up by RulZ AI Trainer's template (the install beside RulZ AI Trainer, an ACE-Step run, an instrumental-stems run stopped from the Monitor, a Stable Audio 3 Small run); in 0.9 on two from this app's own template (first boot, the Fleet tab, a split race, a whole race, Stop the whole race, a run report, Remove into the Recycle Bin). Not yet tried: renting from the app, the after-run stop or destroy, and Update and Reboot from the Fleet tab.

The Fleet tab

  • Instances: every instance with this app, found from your account or joined by a send, with its GPU, price, disk, version and run (step, loss, latest scores). Open WebUI (through vast.ai's portal), Update and restart its WebUI and Reboot each ask first; on a RulZ AI Trainer instance Reboot and Open WebUI are not offered.
  • Fleet queue: Add a run from the Train page's settings, a past run or a settings file; it is planned like a send (instance paths, rights and held-out songs, the Stable Audio 3 licence) and goes to the first idle instance, or a race goes whole to one instance or split over them. Waiting runs can be moved, removed, paused or cleared.
  • Past runs: cost, state and last scores; Download files, Open folder, Run report, Compare, Forget this run and Remove and delete files (to the Recycle Bin, only from the output folder, never on a network drive; nothing on the instance is touched).
  • Automatic downloads per kind (logs, samples, exported LoRA, checkpoints), also per run.
  • The tab never rents, starts, stops or destroys an instance.

Run report

Run report on the Fleet tab, or python -m rulzmusic.runreport <run folder>, writes a picture and a PDF into the run's report/ folder: the settings that differ from the defaults, the loss, the probe scores, spectrograms, the exports and the rights note; the PDF adds every score per probe and seed, the dataset and its captions, the held-out songs and the log's warnings. A race's report puts its runs side by side without picking a winner.

Render on this PC

Sample songs and likeness probes take the rented GPU away from training while they render. Render on this PC, on each instance's card on the Fleet tab, hands those sets to this PC's GPUs instead, so the instance keeps training.

  • Pick one or several GPUs (remembered by UUID) and turn the switch on; that is what lets the helper use them, until you turn it off or close the WebUI. Several GPUs split each set between them.
  • The helper downloads the same model into this PC's Hugging Face cache the first time and checks itself against the instance's step-0 scores before the instance sends anything. This PC and the instance must run the same version: update the instance from the Fleet tab after updating the app.
  • The instance always renders the first and the last set itself. A late or wrong answer is taken back and rendered on the instance from the same weights; after two misses the instance renders every set itself. Nothing the helper does can stop or slow down training.
  • Runs on their own model files (dit_dir, vae_dir, text_encoder_dir, model_dir) and runs with remote_render: off keep every set on the instance. Each score row says where its song was rendered.
  • Checked on a rented RTX 5090 with the helper on the instance's own GPU (probe sets handed over and back in about 44 s each while training went on). Not yet checked with the helper on a Windows PC's own GPUs or with several GPUs.

Recent versions

  • 0.10.0: Render on this PC: a run on vast.ai hands its sample and probe sets to this PC's GPUs (one or several, picked on the Fleet tab) and keeps training; the instance takes late or failed sets back.

  • 0.9.0: the Fleet tab (instances, a queue over several instances, past runs, downloads), races on vast.ai (whole or split over instances, Stop the whole race), and a run report (picture and PDF).

  • 0.8.0: Rent GPUs and Send to vast.ai: runs on rented GPUs with their progress and files on this PC, the app installed on an instance from a confirm, and RulZ AI Trainer's instances shared safely.

  • 0.7.0: Stable Audio 3 (Small music, Small sound effects, Medium) with LoRA or DoRA, matching Stability's own training on the real weights; a licence summary to accept before the first download; exports with the Notice and licence files; songs encoded in chunks so Medium fits in about 10 GB.

  • 0.6.0: ACE-Step XL; LoKr and DoRA adapters (all loading in ComfyUI); int8 base weights for XL on 16 GB cards; races between LoRA and LoKr with a learning rate per run.

  • 0.5.0: a Compare page with synced players, loudness matching and blind votes; Keep this one exports any scored step's LoRA; races of 2 to 4 runs with one setting changed.

  • 0.4.0: probes and scores while training (style, drift, memorization check, lyric accuracy, aesthetics), held-out songs, a Scores card on the Monitor; the duplicate finder uses a corrected CLAP model.

  • 0.3.0: vocal and instrumental stems (HTDemucs), training on instrumental stems, a loudness target, and a Possible duplicates list (CLAP); "Prepare missing only" covers them too.

  • 0.2.0: dataset preparation. Lyrics with section tags, language, captions, BPM, key and duration from a Prepare card; your own text is kept and new text is offered as a suggestion; optional lrclib lookups; one GPU job at a time.

  • 0.1.0: first release. ACE-Step 1.5 LoRAs; WebUI with Wizard, Dataset, Train, Monitor and Settings; samples during training with players; Stop at any point; ComfyUI-ready export.

README (full reference)

RulZ AI Tools Suite

The apps

RulZ AI Trainer

README (full reference) Releases

RulZ Music Trainer

README (full reference)

RulZ AI Trainer Optimizer

Using the app

Help

README (full reference)

Rulz Training Captioner

Getting started

Using the app

Models and GPUs

Reference

README (full reference)

RulZ LLM Suite

Using the app

Reference

Contributing

README (full reference)

RulZ Coding Agent

Using the app

Reference

Contributing

README (full reference)

RulZ Image Organizer

Using RulZ

More

README (full reference)

RulZ Image Tournament

Using the app

Developers

README (full reference)

RulZ Image Crawler

Getting started

Using the app

Help

README (full reference)

RulZ Image Preparer

Getting started

Using the app

Reference

README (full reference)

RulZ Image Grid

Using the app

Help

README (full reference)

RulZ Huggingface Manager

Using the app

Help

README (full reference)

RulZ ComfyUI Launcher

Using the app

Help

README (full reference)

RulZ Model Merger

README (full reference)

RulZ Simple Video Clip Extractor

Getting started

User guide

Help

README (full reference)

Clone this wiki locally