Nodes/ComfyUI-FL-YuE2/FL YuE2 · Audio Adapter Config
ComfyUI Node

FL YuE2 · Audio Adapter Config

The one node that decides what your YuE2 audio adapter actually learns

By filliptm·Created 6 days ago·Updated about 14 hours ago· 96
FL YuE2 · Audio Adapter Config
    • YUE2_AUDIO_TRAIN_CONFIG
    mode
    steps1000
    save_every100
    rank16
    window_frames200
    head_learning_rate0.0000
    acoustic_learning_rate0.0001
    anchor_weight0.05
    source_replay0.10
    accumulation1
    warmup_steps20
    seed42
    projection_learning_rate0.0000
    condition_learning_rate0.0010
    condition_dropout0.10

    Most nodes in this pack make music. This one makes a decision. FL YuE2 · Audio Adapter Config collects twelve required settings plus three optional ones into a single YUE2_AUDIO_TRAIN_CONFIG object, and the trainer downstream does exactly what you told it here. Get mode wrong and you'll spend an hour training weights that never touch the thing you were trying to change.

    If you're coming from image LoRAs, the local-music landscape is worth a sentence of orientation: ACE-Step is the sub-4GB workhorse people actually run, and its LoRA training is the closest thing to "Civitai for music" anyone has shipped. YuE2 is the more ambitious stack - an autoregressive model that writes a song structure from lyrics and style, plus an acoustic decoder that renders it. This adapter path is a third thing entirely: it learns an audio-in → audio-out transformation from your paired recordings. Not a song from a caption. A mapping.

    What each mode actually trains

    mode is the input that matters most, and the four choices are not difficulty levels - they're different weight groups.

    • acoustic - a new NAR LoRA plus the audio input/output projections. Purely stylistic/spectral adaptation.
    • head - the MERT-feature→token head, with gradients flowing through the frozen AR and acoustic models. Semantic-level adaptation.
    • joint - both of the above.
    • conditioned - a new LoRA plus projections plus four source-latent projections that enter decoder layers 0, 7, 14 and 21. The source token head stays fixed. This is the mode that keeps continuous source audio in the loop instead of relying on compressed tokens.

    In all four, the AR weights, MERT and the VAE stay frozen. The starting acoustic companion is preserved separately in the exported delta, so turning a knob can't accidentally eat the base audio quality.

    The inputs you'll actually set

    window_frames is the one people trip on first. It's measured at 25 frames per second, so the default 200 is eight seconds - and the tooltip's warning is literal: every pair must be at least this long. Shortest clip sets your ceiling. The hard cap is 512 frames (20.48 seconds), and longer recordings are sampled in aligned windows.

    steps is total optimizer updates including resumed ones, and save_every is both the checkpoint interval and the held-out evaluation interval. rank is the size of the new acoustic LoRA (default 16). Higher rank means more expressiveness and more VRAM - the author's own validation run used rank 8 for a 40-update sanity test, and the documented conditioned recipe pushes rank to 64 once the task is real.

    Then the regularizers, which are where the honest design shows: anchor_weight (0.05) holds the head to the starting encoder's source-token labels, and source_replay (0.1) reconstructs the source instead of the target for a fraction of updates. Set source_replay to 0 for a pure paired transformation. accumulation and warmup_steps work like they do anywhere else, and seed covers both initialization and sampling - keep it unchanged when you resume.

    The optional trio only does anything in conditioned mode: projection_learning_rate, condition_learning_rate, and condition_dropout (0.1, the probability of zeroing source latents so guidance stays usable - the same trick as text-encoder dropout).

    Wiring and installing

    The output is YUE2_AUDIO_TRAIN_CONFIG, one wire into the trainer's optional config input. Mechanically it's a plain dict handoff - this node does no computation, it just freezes your intent into an object the worker subprocess reads. That's the "one wire instead of forty" pattern the utility-node layer runs on; the tradeoff is that when something's wrong, the contents are invisible in the graph, only in run.json.

    Install like any pack: search ComfyUI-FL-YuE2 in ComfyUI Manager, or clone and install manually.

    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          # light: tiktoken, safetensors, filelock
    python -m pip install -r requirements-training.txt # needed for training/prep paths
    

    The training extras (transformers, soundfile, scipy, demucs==4.0.1, google-genai) install into the same Python environment ComfyUI runs in, and this path needs CUDA. You also need the pack's models in place - either queue a Load Models node once (~7.8 GB into ComfyUI/models/yue2/) or let Training Models pull the extra assets with download_missing on.

    Where people get burned

    Setting window_frames longer than your shortest pair, which fails at training time rather than at config time. Changing seed on a resume, which the tooltip explicitly tells you not to do. Raising rank because a rank-128 image LoRA impressed you - rank, LR and batch size did not carry across the architecture boundary in the image world, and they don't carry into audio either; start on the shipped defaults and change one thing per run. And resuming a run with a different mode, which the resume path rejects because it re-verifies the configuration. Change the experiment, not the run.

    CategoryFL YuE2/Audio Training

    Inputs (15)

    NameTypeDefaultDescription
    modeCOMBOConditioned: acoustic LoRA plus continuous source audio at four decoder layers. Other modes train the acoustic adapter, source head, or both.
    stepsINT10001–100000Total optimizer updates, including resumed steps.
    save_everyINT1001–100000Checkpoint and held-out evaluation interval.
    rankINT161–128Rank of the new acoustic LoRA. The starting companion is preserved separately in the exported delta.
    window_framesINT20025–512Aligned training window at 25 frames per second. 200 frames = 8 seconds. Every pair must be at least this long.
    head_learning_rateFLOAT0.00001e-7–0.01Learning rate for head/joint mode.
    acoustic_learning_rateFLOAT0.00011e-7–0.01Learning rate for the acoustic LoRA and audio projection weights.
    anchor_weightFLOAT0.050–1Head/joint mode: preserve the starting encoder's source-token labels. This is a source-token anchor, not a generated-corpus regularizer.
    source_replayFLOAT0.100–0.5Fraction of updates reconstructing the source instead of the target, to limit drift. Set 0 for pure paired transformation.
    accumulationINT11–32Windows accumulated per optimizer update.
    warmup_stepsINT200–10000Linear learning-rate warmup.
    seedINT420–4294967295Training initialization and sampling seed. Keep it unchanged when resuming.
    projection_learning_rateoptFLOAT0.00001e-7–0.01Conditioned mode: audio input/output projection learning rate.
    condition_learning_rateoptFLOAT0.00101e-7–0.01Conditioned mode: source projection learning rate. Warmup and cosine decay apply to all groups.
    condition_dropoutoptFLOAT0.100–1Conditioned mode: probability of zeroing source latents during training, enabling source guidance.

    Outputs (1)

    NameTypeDescription
    YUE2_AUDIO_TRAIN_CONFIGYUE2_AUDIO_TRAIN_CONFIG