FL Kohya Train
Where the actual training happens (and how to chain runs)
- workspace_config
- advanced_config
- caption_completed_flag
- last_lora_path
FL Kohya Train is the payoff node of the manual FL-Trainer chain: it takes the workspace_config from FL Kohya Workspace, the advanced_config from FL Kohya Adv Config, your chosen base checkpoint and dataset, and actually runs the training. It's the difference between this pack being a config editor and being a trainer.
How it works
The node does three things in sequence. First it assembles the full training config - the template (lora_sd1_5 or lora_sdxl) merged with your advanced settings, the checkpoint path, the dataset config from your workspace, and the step/epoch/LR values you set here - and writes it to config.json in the workspace. Then it launches the real training as a subprocess using the pack's vendored copy of kohya-ss/sd-scripts. Finally, as checkpoints land, it pipes sample images back over a small local server and draws them in the node with a progress bar, so you can watch overfitting happen in real time instead of discovering it after the run.
The README's headline feature lives here: chainable training. Set base_lora to latest and the node grabs the most recent .safetensors in your workspace, sets dim_from_weights, and continues training from it. That's how you modulate learning rates or datasets across epochs of runs - you literally train LoRA-to-LoRA.
Inputs that matter
- workspace_config - from FL Kohya Workspace. Non-negotiable.
- train_config_template -
lora_sdxlorlora_sd1_5, and it must match your checkpoint. - ckpt_name - your base checkpoint from
models/checkpoints. Same rule: SDXL checkpoint with the SDXL template. - max_train_epochs (100 default) and max_train_steps (0 = off). If you set steps above zero it takes over; otherwise epochs govern. Total steps ≈ images × repeats × epochs.
- learning_rate - a string, default
"0.0001". SD 1.5 likes1e-4–3e-4; SDXL prefers1e-5–1e-4. - base_lora -
latest(resume),empty(fresh), or any LoRA it finds in your workspaces andmodels/loras. This is the chaining lever. - sample_prompt - what the trainer generates at each checkpoint so you can judge it.
- advanced_config - from FL Kohya Adv Config; if you want only template defaults, wire a default AdvConfig anyway, it expects the object.
It also has an optional caption_completed_flag input - wire anything into it (say, the output of a captioning node) as a "captions are done, go" gate. The output is last_lora_path, the path to the newest .safetensors, which you can feed straight into a LoraLoader to test the result without hunting through folders.
Install
Manager search "FL-Trainer", or git clone https://github.com/filliptm/ComfyUI_FL-Trainer into custom_nodes and restart. First run clones the pinned sd-scripts and installs a few Python deps automatically.
Gotchas
- It blocks the ComfyUI queue while training - the whole run is synchronous. Interrupt/cancel kills the training subprocess cleanly enough, but plan around it.
- Outputs land in
ComfyUI/output/FL_train_workspaces/<name>/output/, not inmodels/loras. Copy (or point a LoraLoader at) the file when you want it as a regular LoRA. - Save-every-n-epochs exists for a reason. The last checkpoint is rarely the best one;
latestresuming from a too-overtrained checkpoint is the classic way to dig a hole. - SD 1.5/SDXL only - the vendored sd-scripts is pinned to an old commit, so don't point this at Flux or newer.
It's the least glamorous node in the pack and the one that does the real work. If the EasyTrain one-node path feels like a black box, this chain is how you open it.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| workspace_config | FL_TT_SS_WorkspaceConfig | — | |
| train_config_template | COMBO | 2 options: lora_sdxl, lora_sd1_5 | |
| ckpt_name | COMBO | 0 options: | |
| max_train_steps | INT | 00–2147483647 | — |
| max_train_epochs | INT | 1000–2147483647 | — |
| save_every_n_epochs | INT | 1 | — |
| learning_rate | STRING | 0.0001 | — |
| base_lora | COMBO | latest | 2 options: latest, empty |
| sample_prompt | STRING | — | |
| advanced_config | FL_TT_SS_AdvConfig | — | |
| caption_completed_flagopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| last_lora_path | STRING | — |