Nodes/ComfyUI Flux Trainer/SDXL Train Validate
ComfyUI Node

SDXL Train Validate

Preview images while you train an SDXL LoRA

By kijai·Created 2 years ago·Updated about a year ago· 1,156
SDXL Train Validate
  • network_trainer
  • validation_settings
  • network_trainer
  • validation_images

Despite the pack being called "Flux Trainer," it also trains SDXL - and this is the validation node for that path. Its whole job is to stop mid-training, generate a batch of sample images from the LoRA as it currently stands, and hand you those images so you can see what's happening. It's the SDXL sibling of the Flux validation loop, and it exists for the same reason: training blind is a great way to waste an hour discovering your LoRA overcooked halfway through.

Why you'd use it

SDXL LoRA training is mature, well-documented territory - most of the settled recipes and copy-paste configs floating around were written against this lineage. But even with good settings, the useful move is to look at intermediate output. The final checkpoint often isn't your best one; overfitting sneaks up as steps pile on. SDXLTrainValidate turns "hope it's fine" into "here are actual pictures at this step," which is the difference between catching a bad run early and finding out at the end.

How it works

It takes the live training session (network_trainer, the NETWORKTRAINER object FluxTrainer threads through the graph), runs a generation pass with the current LoRA weights, and outputs the resulting images plus the trainer itself so you can keep going. Wire the network_trainer output onward to continue training or to a save node; wire validation_images to a Preview Image node to actually see them. Under the hood this is the SDXL generation path from kohya's scripts, which the pack wraps.

The inputs that matter

This node is deliberately thin:

  • network_trainer (required) - the live SDXL training session coming in from upstream. That's the only thing it needs.
  • validation_settings (optional) - plug in a validation-settings node to control the sample images: resolution, steps, guidance, seed. Leave it off and it uses defaults, but connecting it (with a fixed seed especially) means every checkpoint's previews are directly comparable instead of drifting because the seed changed.

Outputs: network_trainer (chain it) and validation_images (an IMAGE you send to a preview).

Installing ComfyUI-FluxTrainer

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

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

Restart ComfyUI. Torch 2.4.0 or newer recommended. The example workflows use ComfyUI-KJNodes, and optional debug nodes come from rgthree-comfy.

Common issues

The first thing to get straight is that this validates an SDXL run - it's the wrong node for a Flux training graph, which has its own validation loop. Category matters: this one lives under FluxTrainer/SDXL. Pointing it at the wrong trainer type is a setup mistake, not a bug in the node.

Second, remember validation costs time. Each pass is a small generation job, so if a run drags, an overly frequent validation cadence (governed by the loop node you place this inside) at high resolution is a likely culprit. Preview enough to catch problems, not so much you're spending your GPU budget rendering samples instead of training.

If the previews look bad but training metrics seem fine, don't panic at the first checkpoint - early samples are supposed to look rough. Watch the trend across several validation points. And keep in mind the pack is experimental and SDXL support here is one path among several; for plain SDXL work a lot of people use dedicated trainers. The reason to be in FluxTrainer is that you want to train inside ComfyUI - and if you're doing that, watching the run with this node is exactly the right habit.

CategoryFluxTrainer/SDXL

Inputs (2)

NameTypeDefaultDescription
network_trainerNETWORKTRAINER
validation_settingsoptVALSETTINGS

Outputs (2)

NameTypeDescription
network_trainerNETWORKTRAINER
validation_imagesIMAGE