YuE2 Training Curve (loss/LR chart)
The loss chart that tells you whether your LoRA is actually learning
- chart
Why you want a chart instead of a console
LoRA training is a black box with a number attached. That number - the loss - goes down almost no matter what you do, which is exactly why eye-balling the console is a bad test and why "it trained fine" is usually a guess. This node makes the guess visible. It's the third node in the pack, it's optional, and it's the one I'd wire up before the first run rather than after the second bad one.
Concretely: it takes the trainer's training_log string, parses out steps, losses and learning rates, and renders a dark-themed chart - bold smoothed loss, faint raw loss behind it, and the LR schedule overlaid on a right-hand log axis. It's an output node, so the chart also comes out as an IMAGE you can pipe into SaveImage and keep next to the LoRA file.
It draws itself while training runs
This is the part that sells it. The trainer writes a fixed PNG into ComfyUI's temp folder every few seconds while it steps, and a small frontend extension polls that file every 3 seconds and paints it into every YuE2TrainingCurve node in your graph. You hit Queue, then watch the loss wobble downward in real time instead of refreshing a terminal. When the run ends, the final high-quality render replaces the live one.
Two things have to be true for that to work, both from the source: the trainer's live_curve widget must be on (it's on by default, and it silently disables itself with a log note if matplotlib is missing), and the browser needs to have loaded the extension in web/js/. If the node stays blank while training runs, restart ComfyUI and hard-refresh with Ctrl+F5 - that's the documented fix and it's a real one, the extension only loads on a fresh page.
The four inputs, all of them worth knowing
training_log- forceInput, so you wire it from the trainer'straining_logoutput. Nothing works without it.smooth- moving-average window, default 25, measured in logged points, not steps. Since the trainer logs everylog_everysteps (default 10), a window of 25 is roughly 250 steps of smoothing. On a 3000-step run that's about 300 log points, so 25 is a sensible ~8% window. Set it to 1 if you want to see every spike and hate yourself.show_raw- the unsmoothed trace behind the bold one. Leave it on; smoothed-only curves hide exactly the instability you're looking for.show_lr- overlays the LR schedule in orange on a log scale. This is the one people underrate: it lets you see the cosine decay and the warmup ramp actually happening, which is how you confirmwarmup_stepsandlr_schedulerdid what you assumed.
Output is a single chart IMAGE. PreviewImage for a glance, SaveImage if you're keeping records of a run.
Reading it like someone who's trained before
Loss should fall fast then flatten - that flattening is the model having learned what it can from your dataset. Three shapes worth knowing:
- A spike that recovers. Normal, and gradient clipping (
max_grad_norm = 1.0) is what stops it from derailing the LoRA. A spike that doesn't recover means your LR is too high; drop to 5e-5. - Loss collapsing toward zero. That's memorization, not success. Fewer steps or lower LR - this is the same overfitting that shows up in the audio as muffled, repetitive output.
- A flat line that barely moves. The adapter isn't getting a useful signal: the trigger word is too weak relative to the data, or the LR is too low. Try 2e-4 before you try more steps.
The chart can't tell you whether the LoRA sounds right - only your ears can, and that comparison is the one EMA was invented for. But it will tell you which of the fails you're looking at, which saves you a 40-minute run.
Install and setup
It ships with the same pack as the trainer, so there's no separate install: get Starnodes2024/ComfyUI-YuE2-Trainer in via ComfyUI Manager (search the pack title) or git clone into ComfyUI/custom_nodes, run pip install -r requirements.txt, and restart. The only dependency that matters here is matplotlib - it's in the requirements file, and if it's missing the node raises an ImportError naming the exact pip command instead of failing cryptically. It also needs the YuE2 checkpoint in models/checkpoints, because nothing in this pack loads without it.
One dependency note for the whole pack: custom nodes share ComfyUI's Python environment with no isolation, which is exactly why the mundane two-line requirements list here is a feature. If a chart node starts fighting a different pack's matplotlib pin, you've hit the standard ComfyUI dependency tax, not a YuE2 problem.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| training_log | STRING | Connect the training_log output of the YuE2 LoRA Trainer. | |
| smooth | INT | 251–500 | Moving-average window (in logged points) for the bold loss curve. 1 = no smoothing. |
| show_raw | BOOLEAN | true | Show the unsmoothed loss as a faint trace behind the smoothed curve. |
| show_lr | BOOLEAN | true | Overlay the learning-rate schedule (orange, log scale, right axis). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| chart | IMAGE | — |