VoxCPM_SM_LoraTrainerLoop
The Node That Actually Trains Your TTS LoRA — in Chunks
- info
- checkpoint_path
- next_step
Here's the dirty secret of training in ComfyUI: you can't interrupt a node. Once execution starts, it runs until it's done, and a 2000-step fine-tune can be a long, tense afternoon. The VoxCPM_SM_LoraTrainerLoop node is the workaround - instead of one giant train call, it trains in chunks and hands you back the next step number, so you can run a batch, check your samples, and continue where you left off.
This is the second half of the pack's training pair. The Init node only wrote a config; this node does the actual gradient work. Wire config_path from Init into it and hit run.
The inputs
config_path- the path Init produced. Get it wrong or miss it and the node stops with "Invalid config path. Please run VoxCPM_SM_LoraTrainerInit first." That message is the entire troubleshooting guide: run Init, wire the string, don't retype it.train_steps- how many steps to run per call. 2000 matches the official recipe for 5–10 minutes of audio; smaller values (say 500) turn it into a "train a bit, look, continue" flow.current_step- where to start. 0 on the first run; after that, feed thenext_stepoutput back into it and the trainer resumes from the saved state instead of starting over.save_interval- how often to write a checkpoint (default 500).
Outputs and where the LoRA goes
Three outputs: info (a progress message), checkpoint_path (the folder of the latest checkpoint), and next_step (the step number to feed back into current_step).
Checkpoints land in ComfyUI/models/loras/finetune_lora_<timestamp>/step_XXXXXXX/, and each contains a lora_weights.safetensors. Here's the part that makes this pack nice: that file embeds the training config (lora_config) in its metadata, so when you later load it in the VoxCPM_SM_Model node, the rank/alpha/enable flags are read automatically - no "what rank did I train at again?" archaeology. Just point the Model node's lora combo at that safetensors and the KSampler will use it.
What to expect
The author is upfront that this is a single-threaded trainer, written so you don't have to fire up a separate webui, and ComfyUI's architecture is the reason it can't be fast. Real talk: you're trading throughput for convenience. For the target use - a 5–10 minute voice clip, 2000 steps - it's totally workable. Validation samples render on the node so you can judge progress as it goes, and the community reports that cranking rank higher can give genuinely impressive voice fidelity.
Gotchas
- Keep the browser tab and the ComfyUI terminal open for the whole run. Losing the process mid-chunk means re-running from the last saved step - which is exactly why the chunked loop design exists.
- If a run dies, don't start from 0. Set
current_stepto the last completed step and it resumes from that checkpoint, optimizer and scheduler state included. - Save an intermediate checkpoint before you think you're done. The last step is rarely the best - that rule holds for TTS LoRAs exactly like it does for image LoRAs.
- Install is the whole-pack story: clone
https://github.com/smthemex/ComfyUI_VoxCPM_SMintoComfyUI/custom_nodes,pip install -r requirements.txt, restart, and have the model files in place first (see the Model node page). The heavy deps - funasr, modelscope, adatasets>=3,<4pin - are the usual suspects when sibling packs start throwing version errors; a dedicated venv is the fix.
TTS LoRA training inside ComfyUI is still a workaround, not a first-class citizen. But this pair of nodes makes it genuinely approachable: Init to declare intent, Loop to grind steps. When it works, you get a voice that's recognizably yours without ever leaving the graph.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| config_path | STRING | — | |
| train_steps | INT | 2000100–100000 | — |
| current_step | INT | 00–1000000 | — |
| save_interval | INT | 500100–100000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| info | STRING | — |
| checkpoint_path | STRING | — |
| next_step | INT | — |