Nodes/ComfyUI-FL-YuE2/FL YuE2 · Prepare Audio Pairs
ComfyUI Node

FL YuE2 · Prepare Audio Pairs

The boring node that makes the training run possible

By filliptm·Created 6 days ago·Updated about 14 hours ago· 96
FL YuE2 · Prepare Audio Pairs
  • dataset
  • assets
  • YUE2_PREPARED_AUDIO_PAIRS
cache_directorypaired_features

Nothing about FL YuE2 · Prepare Audio Pairs is fun. It has three inputs, one output, no knobs worth arguing about, and it's the node most people skip past on their way to the trainer. It's also the one doing the actual translation between "a folder of WAVs" and "tensors a GPU can chew" - and it's why a training run that felt impossible to control becomes repeatable.

The workflow it belongs to is a straight line: Paired Audio Dataset → Prepare Audio Pairs → Audio Adapter Trainer → Audio to Audio. Two wires go in, one comes out, and the trainer downstream is very literal about which one it accepts.

What it actually computes

Three things happen in this node, per pair:

  • Audio is converted to 48 kHz stereo. Everything downstream assumes that format, so sample-rate mismatches stop being a thing you debug later.
  • Source MERT features are extracted at 25 Hz. This is the continuous-audio side: the source recording becomes a frame-level feature stream that the tokenizer head (and, in conditioned mode, the source projections) consume. Twenty-five frames a second is also why window_frames in the config node is "200 frames = 8 seconds" - same clock.
  • Target audio is encoded through the VAE posterior mean, giving the acoustic latents the LoRA is trained against.

One detail that turns out to matter for reproducible inference: source features are normalized over the full recording before windowing, in both training and inference. Doing it per-window would make each 8-second slice disagree with its neighbours. The aligned source/target windows the trainer samples always share the same frame offset, and that's guaranteed by this stage's structure rather than by luck.

It runs in a worker subprocess - same as the trainer - so a long extraction doesn't hold your ComfyUI process hostage, and it exits when it's done.

The three things you connect

dataset takes the YUE2_AUDIO_PAIRS output from the dataset node. assets is the YUE2_TRAINING_ASSETS object from Training Models - that's where the model paths, head, MERT revision and starting acoustic companion all come from, along with the download_missing switch that controls whether a missing asset gets fetched while you queue. If you're offline, turn downloads off and make sure the assets are already in your model folders.

cache_directory names the folder under output/yue2_training/ where the prepared source features and target latents get written (default paired_features). That's the whole node.

The output is YUE2_PREPARED_AUDIO_PAIRS, which is a path to that cache. Wire it into the trainer's dataset input - the optional input named dataset on the trainer, not the dataset node itself. If you skip this node and wire a manifest straight into the trainer, you'll get "Select a prepared paired-audio dataset", which is the pack's polite way of saying you jumped a step.

Install

Manager → search ComfyUI-FL-YuE2, or:

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          # tiktoken, safetensors, filelock
python -m pip install -r requirements-training.txt # transformers, soundfile, scipy, demucs, google-genai

The training extras are mandatory here - this is one of the two paths in the pack that genuinely needs them, and requirements.txt alone won't cut it. It also needs CUDA and a BF16-capable NVIDIA GPU; the preparation and training code paths are CUDA-only, so AMD and Apple users are out of this one for now. And queue Training Models once so the MERT asset and tokenizer head exist locally.

Where people get burned

Skipping preparation because the dataset node "already worked". The dataset node validates; it doesn't compute. Nothing downstream runs without this pass.

Editing your audio and re-queuing only half the chain. Preparation records hashes of what it produced, and the dataset manifest hashes the source and target files. Change a recording and the mismatch surfaces as "prepare the pairs again" - usually on the trainer, which is a confusing place to first hear about it. Re-run dataset → prepare, then resume.

Reusing a cache_directory name across different datasets. It's cheap to point a new experiment somewhere new, and it means the cache can't quietly describe a different pairing than the dataset you think you're training on.

Reading a failed first run as a broken pack. This stage touches every second of every recording with MERT. Long pairs take a while, the first pass is the slow one, and it's normal. If the node doesn't appear at all after an update, restart ComfyUI and read the startup import error - this pack is one import away from being invisible when a dependency is missing.

CategoryFL YuE2/Audio Training

Inputs (3)

NameTypeDefaultDescription
datasetYUE2_AUDIO_PAIRS
assetsYUE2_TRAINING_ASSETS
cache_directorySTRINGpaired_featuresPrepared source features and target latents under output/yue2_training.

Outputs (1)

NameTypeDescription
YUE2_PREPARED_AUDIO_PAIRSYUE2_PREPARED_AUDIO_PAIRS