Nodes/ComfyUI Flux Trainer/Flux Train Save Model
ComfyUI Node

Flux Train Save Model

Save intermediate checkpoints mid-train (so you can pick the best one)

By kijai·Created 2 years ago·Updated about a year ago· 1,156
Flux Train Save Model
  • network_trainer
  • network_trainer
  • model_path
  • steps
copy_to_comfy_model_folderfalse
end_trainingfalse

Here's a LoRA-training truth that never changes across architectures: the last checkpoint is usually not the best one. Somewhere in the middle of your run, likeness peaked before the model started overfitting and losing prompt control. FluxTrainSaveModel is how you capture those in-between snapshots so you actually have them to choose from later.

You drop it into your training chain between FluxTrainLoop segments, and every time the trainer passes through, it writes the current LoRA to disk. Train 500 steps, save, train 500 more, save - now you've got a ladder of checkpoints instead of a single all-or-nothing final file.

How it works

FluxTrainSaveModel sits mid-chain: it takes the network_trainer (NETWORKTRAINER), saves the current model state, and passes the trainer straight back out so training can continue. Because it forwards the trainer, it's non-terminal - unlike FluxTrainEnd, the run keeps going after it.

The two settings:

  • copy_to_comfy_model_folder (default false) - flip this to true and the saved LoRA gets copied into your ComfyUI models/loras folder automatically, so you can test it in a normal generation workflow without moving files by hand. Genuinely convenient for a save-and-preview loop.
  • end_training (default false) - a shortcut to finalize the run at this save point instead of continuing. Usually left false when you're using this for intermediates.

Outputs are the forwarded network_trainer, the model_path (where this checkpoint landed), and the current steps count so you know which snapshot this is.

Why it matters

Pair this with FluxTrainValidate and you get the whole quality-control loop: save a checkpoint, generate a preview from it, eyeball whether the likeness is there yet, keep going. When the run finishes you're not guessing - you compare your saved checkpoints and keep the one that hit the sweet spot. Without intermediate saves you're stuck with whatever the final step gave you, overfit or not.

Installing the pack

ComfyUI Manager: search ComfyUI Flux Trainer, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-FluxTrainer
pip install -r ComfyUI-FluxTrainer/requirements.txt

Torch 2.4.0+ recommended, plus kijai's ComfyUI-KJNodes for the example workflows.

Common issues

Disk fills up fast. Each intermediate LoRA is a real file, and if you save every few hundred steps across a long run they add up - especially larger-rank LoRAs. Save at a sensible cadence, not obsessively, and clean out the ones you don't keep.

You saved but can't test it. If copy_to_comfy_model_folder is false, the checkpoint sits in the trainer's output directory, not where ComfyUI looks for LoRAs. Turn that toggle on, or read the model_path output and copy the file yourself.

Saving isn't validating. This node writes a file; it doesn't tell you if the file is any good. That's FluxTrainValidate's job. Use both together - a pile of checkpoints with no previews still leaves you guessing which one to keep.

CategoryFluxTrainer

Inputs (3)

NameTypeDefaultDescription
network_trainerNETWORKTRAINER
copy_to_comfy_model_folderBOOLEANfalsecopy the lora model to the comfy lora folder
end_trainingBOOLEANfalseend the training

Outputs (3)

NameTypeDescription
network_trainerNETWORKTRAINER
model_pathSTRING
stepsINT