LoRA Training Steps Calculator
Work out steps per epoch, total steps and optimizer updates for a LoRA run the way kohya sd-scripts counts them, then estimate how long it takes and what the GPU time costs. It's an estimate: bucketing and regularization images can change the real count.
Dataset folders
One row per kohya folder, such as 10_mychar (10 repeats).
Training settings
1 means off.
Time and cost (optional)
Read it from kohya's progress bar.
Your cloud GPU rate, or 0 for local.
Steps
optimizer steps, the total kohya's progress bar shows
- Images seen per epoch
- 200
- Steps per epoch
- 100
- Total batch steps
- 1,000 (100 × 10 epochs)
- Estimated training time
- 25 min
- Estimated GPU cost
- $0.21
Regularization images double the steps per epoch. Time leaves out model loading, sample images and saving.
Train a character that stays consistent
Step counts are the easy part. The AI Influencers course covers building the dataset, training face LoRAs and testing checkpoints so your character looks the same in every image.
Explore AI InfluencersHow the calculator works
Steps per epoch = Sum over folders of ceil(Images × Repeats ÷ Batch size) Total batch steps = Steps per epoch × Epochs Optimizer steps = Epochs × ceil(Steps per epoch ÷ Gradient accumulation) Training time = Optimizer steps × Seconds per step GPU cost = Training time in hours × Price per hour
In plain terms: every epoch shows each image as many times as its folder's repeats. Those images are grouped into batches, and a part-filled last batch still counts as a step, which is why the division rounds up. With gradient accumulation, kohya waits for several batches before each weight update and counts the updates, so that is the number on its progress bar.
Sources: kohya's explanation of steps per epoch in sd-scripts discussion #182, the gradient accumulation question in issue #366, and the step calculation in train_network.py. Checked October 2026.
- Bucketing adds a little. With aspect-ratio buckets kohya rounds up per bucket, not per folder, so a mixed-size dataset can come out a few steps higher.
- Regularization images double steps. kohya pairs every training image with a regularization image, so steps per epoch roughly double.
- Several GPUs divide steps. Each GPU takes its share of batches, so steps fall by about the number of GPUs.
- max_train_steps wins if set without max_train_epochs. kohya then stops at that step count instead of your epochs.
FAQ
How are LoRA training steps calculated in kohya?
For each dataset folder, kohya multiplies images by repeats and divides by batch size, rounding up. Those numbers are added to get steps per epoch, then multiplied by epochs. 20 images with 10 repeats at batch size 2 is 100 steps per epoch, so 10 epochs is 1,000 steps.
How many steps should a LoRA train for?
There is no single right number; it depends on the base model, learning rate, dataset and how strong you want the effect. A common approach is to save a checkpoint every epoch, test each one with the same prompts and keep the best, rather than aiming for a fixed step count.
Does a bigger batch size mean less training?
Not in images seen: each epoch still shows every image × repeats once, but in fewer, larger steps. Fewer optimizer updates at the same learning rate can mean a weaker result, which is why people often raise the learning rate or epochs when they raise batch size.
What does gradient accumulation do to the step count?
It adds up gradients over several batches before each optimizer update, acting like a bigger batch without the extra VRAM. kohya counts and shows optimizer updates, so with an accumulation of 4 the progress bar total is about a quarter of the batch steps.
Why does kohya show a different number than this calculator?
Three common reasons: aspect-ratio bucketing rounds up per bucket, which adds a few steps; regularization images double the steps per epoch; and training on several GPUs divides steps by the GPU count. A max_train_steps setting can also override epochs.
How do I estimate training time and cost?
Start a run, wait for the speed to settle and read the seconds per iteration (s/it) from kohya's progress bar, then enter it with your GPU's hourly price. Add a few minutes for model loading, sample images and saving checkpoints, which the estimate leaves out.