Skip to main content

Train a LoRA Inside ComfyUI: Node Workflows for Face Training

Train a LoRA in ComfyUI with the built-in Train LoRA node: the full training graph node by node, its defaults, custom trainer nodes and when to use Kohya.

Founder of IImagined.ai

Published
Oct 11, 2026
Reading time
11 min read
Quick answer

You can train a LoRA inside ComfyUI with its built-in nodes: Load Image-Text (from Folder) feeds Make Training Dataset, which feeds Train LoRA, and Save LoRA Weights writes the file. The nodes are flagged experimental and lack periodic saves, sample images and a scheduler, so use them for quick tests and a dedicated trainer such as Kohya sd-scripts or AI Toolkit for the run you keep. Custom node packs can start those trainers from the canvas.

You can train a LoRA inside ComfyUI with its built-in training nodes: Load Image-Text (from Folder) feeds Make Training Dataset, which feeds Train LoRA, and Save LoRA Weights writes the file. The nodes ship with ComfyUI core and are flagged experimental, so they suit a quick test inside a workflow, while a dedicated trainer such as Kohya is still the better home for the run you plan to keep.

Checked in October 2026 against ComfyUI v0.39.0: the source of its training nodes and dataset nodes, the built-in node docs for Train LoRA and Make Training Dataset, the READMEs of ComfyUI Realtime LoRA Toolkit and ComfyUI-FluxTrainer, and the sd-scripts training docs. The graph below follows each node's declared inputs and outputs. We publish no sample results from it, and the node docs link to no official training template, so expect to adjust it on your own machine.

Training is the heavy option. If you only need the same face across a few dozen images, the templates in our ComfyUI consistent character workflow need no training at all, and the consistent character AI guide shows where a LoRA sits among the other methods.

What you will have at the end

A training graph you understand node by node, a LoRA file on disk, and a way to test it in the same canvas. You will also know which of ComfyUI's three training options fits the job.

Three ways to train a LoRA in ComfyUI

"Train LoRA in ComfyUI" can mean the built-in nodes or a custom node pack that starts an outside trainer for you. They are different tools.

OptionWhat it isModelsNeedsUse it for
Built-in training nodesPart of ComfyUI core, flagged experimentalAny model you load as MODEL; the docs list no tested base modelsNothing to installQuick tests inside a workflow
ComfyUI Realtime LoRA ToolkitCustom nodes that drive sd-scripts, Musubi Tuner or AI-ToolkitSDXL, SD 1.5, FLUX.1-dev, FLUX Klein 4B and 9B, Z-Image, Qwen Image, Wan 2.2The backend trainer, installed separatelyA full trainer run started from the canvas
ComfyUI-FluxTrainerCustom nodes wrapping kohya's training scriptsFLUX.1Its pip requirements; torch 2.4.0 or higher recommendedFLUX.1 runs, if it still matches your ComfyUI version

This tutorial builds the first option, because it is the one already in your install, then covers the other two and when to leave ComfyUI for a dedicated trainer.

Pre-flight for the built-in graph
  • ComfyUI is up to date (the node names below are from v0.39.0)
  • The base checkpoint you will generate with is loaded and working
  • 10 to 20 sharp, varied images of one face are in a subfolder of ComfyUI/input
  • Each image has a .txt caption with the same file name
  • Every caption contains your trigger word, an invented token
  • The subject is an original persona or your own face
  • You have free VRAM beyond what the checkpoint needs for inference

ComfyUI LoRA training workflow: the graph at a glance

The built-in graph is five stages in a row. Images and captions are encoded once, the training node works on those encodings, and the result is saved and tested without leaving the canvas.

The built-in training graph
  1. 01
    Load

    Checkpoint, plus images and captions from a folder

  2. 02
    Encode

    Make Training Dataset: latents and conditioning

  3. 03
    Train

    Train LoRA: weights, loss map, step count

  4. 04
    Save

    Save LoRA Weights and Plot Loss Graph

  5. 05
    Test

    Load LoRA Model into a normal sampler

Train LoRA node in ComfyUI: every node explained

Add the nodes in this order. Search each by its display name; Train LoRA, Make Training Dataset and Resolution Bucket sit under the model/training category.

Build the graph, node by node
  1. 1
    Load Checkpoint

    The standard loader. Result: MODEL, CLIP and VAE outputs, which feed the dataset and training nodes.

  2. 2
    Load Image-Text (from Folder)

    Pick your subfolder of the input directory. It reads PNG, JPG, JPEG and WEBP files and the .txt caption named after each. Result: an images list and a texts list.

  3. 3
    Make Training Dataset

    Connect images, texts, VAE and CLIP. It encodes each image to a latent and each caption to conditioning. Result: two lists of equal length.

  4. 4
    Resolution Bucket (optional)

    Groups latents and conditioning by resolution so mixed aspect ratios can be batched. If you add it, switch bucket_mode on in Train LoRA.

  5. 5
    Train LoRA

    Connect MODEL, latents, and conditioning into positive. Set steps, learning_rate and rank. Result: lora, loss_map and steps outputs.

  6. 6
    Save LoRA Weights

    Connect lora and steps. Result: a .safetensors file in the output folder under loras, with the step count in its name.

  7. 7
    Plot Loss Graph

    Connect loss_map. Result: a loss-over-steps chart you can read after the run.

  8. 8
    Load LoRA Model

    Connect the base MODEL and the lora output, then wire it into your usual sampler. Result: test images from the fresh LoRA.

Two details in the dataset nodes save time. Load Image-Text (from Folder) understands the kohya folder convention, so a subfolder named with a number prefix, such as 5_face, repeats its images that many times. And Make Training Dataset takes captions three ways: one per image, a single caption for every image, or none at all.

These are the Train LoRA inputs and the defaults ComfyUI documents for them:

InputDefaultWhat it controls
steps16Number of training steps, from 1 to 100,000
learning_rate0.0005Size of each update
rank8Rank of the LoRA layers, from 1 to 128
batch_size, grad_accumulation_steps1 and 1Images per step, and steps accumulated before each update
optimizerAdamWAlso Adam, SGD and RMSprop
loss_functionMSEAlso L1, Huber and SmoothL1
algorithmLoRAAlso LoHa, LoKr and OFT
training_dtype, lora_dtypebf16 and bf16Precision for training and for the saved weights
gradient_checkpointingOn, depth 1Lower memory use at some cost in speed
offloadingOffMoves model weights to the CPU during training to save GPU memory
existing_lora[None]A saved LoRA in models/loras to continue training from
bucket_modeOffExpects pre-bucketed latents from the Resolution Bucket node
bypass_modeOffApplies adapters through hooks; meant for quantized models
seed0Weight initialisation and noise sampling

ComfyUI: how to train a LoRA for a face

Start with the dataset, because the node cannot fix it. Vendor docs put a face at 10 to 20 images; how many images to train a face LoRA lists the sources and the character LoRA dataset checklist gives the shot list. Write captions that name the trigger word and describe what changes in each image, so outfits and backgrounds stay promptable.

ComfyUI's docs give defaults, not a face recipe, so borrow a starting point from the trainers that do document one. They start a face or character at roughly 1,000 to 2,000 steps; face LoRA training steps and learning rate has the table. One difference matters: the built-in node creates its LoRA with an alpha of 1, and the sd-scripts docs say that with an alpha of 1, learning rates from 1e-4 to 1e-3 are common. The node's default of 0.0005 sits inside that range, so leave it for a first run.

The node saves once, at the end. To get checkpoints you can compare, train in chunks:

  1. Run a short chunk, for example a few hundred steps. Result: one file with the step count in its name.
  2. Move that file from the output folder into ComfyUI/models/loras without renaming it. Train LoRA reads the earlier step count from the _steps_ part of the file name.
  3. Select it in existing_lora and queue the same number of steps again. Result: the steps output adds the earlier steps, so the next file is named with the running total.
  4. Repeat until the samples stop improving, keeping every file.
  5. Test each file with the same prompts and seed, and keep the one that holds the face and still follows new prompts.

For the test itself, Load LoRA Model has a strength_model input that defaults to 1.0. In any other workflow, load the saved file with the standard Load LoRA node described in ComfyUI's LoRA tutorial. The ComfyUI AI influencer workflow shows where that LoRA sits in a full persona graph.

Custom trainer nodes: Realtime LoRA Toolkit and FluxTrainer

Custom node packs take the opposite approach. They put a node on the canvas that starts a dedicated trainer in the background, so you get that trainer's features without opening a terminal.

  • ComfyUI Realtime LoRA Toolkit. One trainer node per model family: SDXL and SD 1.5 through kohya sd-scripts, FLUX Klein 4B and 9B, Z-Image, Qwen Image and Wan 2.2 through Musubi Tuner, and FLUX.1-dev through AI-Toolkit. You install the backend yourself and give the node its path. The README lists about 13 GB of VRAM for Klein 4B and advises Python 3.10 to 3.12. Last updated August 2026.
  • ComfyUI-FluxTrainer. A wrapper around slightly modified kohya scripts for FLUX.1, with an example workflow in its examples folder. Its README calls the nodes experimental and says the default settings are not necessarily good. Its last update was April 2025, so test it against your ComfyUI version before relying on it.

If Flux is the goal, our Flux LoRA walkthrough covers the routes outside ComfyUI, including the hosted ones.

Why final runs still belong in Kohya or AI Toolkit

Because of what the built-in node does not have yet. This is a feature comparison from the two projects' source and docs, not a quality test.

Built-in Train LoRA node or Kohya sd-scripts
Train LoRA node (ComfyUI v0.39.0)
  • One file at the end; no save-every-N setting
  • No sample images during the run
  • AdamW, Adam, SGD or RMSprop
  • No learning-rate scheduler input
  • Alpha fixed at 1 in the source
  • Flagged experimental
Kohya sd-scripts (v0.12.0)
  • Saves every N epochs or every N steps
  • Renders sample prompts at set intervals
  • AdamW8bit, AdamW, Lion, DAdaptation, Adafactor
  • Constant, cosine, linear and warmup schedules
  • network_alpha is yours to set
  • A separate text-encoder learning rate

Saved checkpoints and sample images are how you find the point where a face LoRA is trained but not overcooked. Without them you are guessing, or training in chunks by hand. Our guide to face LoRA overfitting shows what going past that point looks like. So we use the split this way: the built-in graph to check that a dataset trains at all, and a dedicated trainer for the run that produces the file you post with.

Pick that trainer by base model. sd-scripts lists SD 1.x and 2.x, SDXL, SD3, FLUX.1, Lumina, HunyuanImage-2.1 and Anima. For FLUX.2 klein, Z-Image or Qwen-Image, use AI Toolkit or Musubi Tuner. Our LoRA training guide walks through a Kohya run, and the AI Influencers program goes deeper on the whole build: Flux and SDXL setup, LoRA training for consistent faces and ControlNet for body consistency.

Whose face you can train locally

A local graph has no platform checking your uploads, which moves the responsibility to you. Train an original AI persona or your own face. Anyone else needs their written consent for training and for every use you plan. The base model's terms still apply: Black Forest Labs' usage policy, for example, covers FLUX models and their derivatives and bars unlawful impersonation and abusive or misleading depictions of real people.

Troubleshooting the training graph

SymptomFix
Error: number of texts does not match number of imagesMake Training Dataset accepts one caption per image, one caption for all, or none. Check for a missing .txt file.
The face barely changesSteps is still at the default of 16, or far too low. Raise it and train again.
Out of memoryKeep gradient_checkpointing on and batch_size at 1, then switch offloading on.
Loss turns to NaNComfyUI's own warning: set training_dtype to bf16, or remove fp16 accumulation from your --fast flags.
A quantized model will not trainSwitch bypass_mode on, which applies the adapters without modifying the weights.
Continuing from existing_lora throws an errorThe file was renamed, or saved without the steps input connected. Train LoRA reads the earlier step count from the _steps_ part of the name.
The LoRA is missing from the Load LoRA listSave LoRA Weights wrote it to the output folder. Move it to ComfyUI/models/loras and refresh.

Training a LoRA in ComfyUI: FAQ

Can you train a LoRA inside ComfyUI?

Yes. ComfyUI core ships training nodes: Load Image-Text (from Folder), Make Training Dataset, Train LoRA, Save LoRA Weights, Plot Loss Graph and Load LoRA Model. All are flagged experimental in the source as of v0.39.0. Custom node packs such as ComfyUI Realtime LoRA Toolkit and ComfyUI-FluxTrainer go further by driving kohya sd-scripts, Musubi Tuner or AI-Toolkit from the canvas. Checked October 2026.

Which node trains a LoRA in ComfyUI?

The Train LoRA node, listed under model/training. It takes a MODEL, a list of latents and positive conditioning, plus settings such as steps, learning_rate and rank, and it outputs the LoRA weights, a loss map and the total step count. It does not read images itself: Make Training Dataset encodes your images and captions first, and Save LoRA Weights writes the result to disk.

Where does ComfyUI save a trained LoRA?

The Save LoRA Weights node writes a .safetensors file into ComfyUI's output folder. Its default prefix is loras/ComfyUI_trained_lora, and when you connect the steps output the step count goes into the file name. To use the file with the standard Load LoRA node or to continue training from it, move it into ComfyUI/models/loras, which is where both of those look.

What settings should I use for a face LoRA in ComfyUI?

ComfyUI documents defaults, not a face recipe: 16 steps, a learning rate of 0.0005, rank 8 and AdamW. Sixteen steps only proves the graph runs. The nearest documented reference is the dedicated trainers, which start a face or character at roughly 1,000 to 2,000 steps. Treat that as a first guess, train in chunks, save each one and compare the outputs.

Is ComfyUI LoRA training as good as Kohya?

We have not benchmarked the two, so we make no quality claim. The documented difference is features. The built-in Train LoRA node has no save-every-N setting, no sample images during training, four optimizers and no learning-rate scheduler. Kohya sd-scripts documents all of those. That is why the built-in graph suits quick tests and a dedicated trainer suits the run you plan to keep.

Can I train a Flux LoRA in ComfyUI?

Yes, through custom nodes. ComfyUI-FluxTrainer wraps kohya's scripts for FLUX.1, and its README calls it experimental. ComfyUI Realtime LoRA Toolkit trains FLUX.1-dev through AI-Toolkit and FLUX Klein 4B and 9B through Musubi Tuner, and lists about 13 GB of VRAM for Klein 4B. The built-in Train LoRA node accepts any MODEL input, but ComfyUI's docs list no tested base models for it.

How many images do I need to train a face LoRA in ComfyUI?

The same as in any trainer: vendor docs put a face at 10 to 20 sharp, varied images and a full character at 20 to 40. Put them in a subfolder of ComfyUI's input directory with one .txt caption per image, named the same as the image. Load Image-Text (from Folder) reads PNG, JPG, JPEG and WEBP files.

All Access · all four programs · $99/mo

The graph trains a face. The program builds the persona around it.

AI Influencers, included in All Access, covers Flux and SDXL setup, creating the persona, LoRA training for consistent faces and ControlNet for body consistency, then video and content, with the other three programs, live coaching and the private community in one subscription.

Start All Access — $99/mo →30-day money-back guarantee
Free

Work out your step total first

Turn images, repeats and epochs into a step total and a time estimate before you queue a long run, and join the free Telegram channel for ComfyUI persona workflows that are working now.