Kohya vs Civitai trainer: how to format a LoRA dataset
Kohya sd-scripts reads a local folder of images with matching caption files, configured either through a folder-name convention or a TOML file. The Civitai on-site trainer takes a zip upload of the same images and captions and runs training in the cloud. One captioned dataset serves both; only the packaging differs.
Published 5 September 2026 · 3 min read
What do both trainers have in common?
Both expect images paired with plain-text captions that share a basename, and both apply the caption as the text conditioning for that image during training. Both bucket images by aspect ratio, so you do not need square crops. Everything below is about how you hand that pair of files to each tool.
How does the Kohya folder convention work?
The classic DreamBooth-style layout uses a parent folder with one subfolder per concept, named repeats_name, for example img/10_bunn woman. The leading number is how many times each image in that folder is shown per epoch; the rest is the concept name and class. Captions live next to the images as .txt files (or .caption), selected with the caption_extension option. Regularisation images go in a sibling reg folder with the same naming rule.
When should you use a Kohya TOML config instead?
For anything beyond one folder, use a dataset config file passed with dataset_config. It lets you set resolution, enable bucketing, and declare each subset with image_dir, num_repeats, caption_extension, and class_tokens explicitly, which is clearer than encoding repeats in folder names. The structure looks like this:
[general]
enable_bucket = true
caption_extension = ".txt"
[[datasets]]
resolution = 1024
[[datasets.subsets]]
image_dir = "C:/datasets/bunn/img"
num_repeats = 10
class_tokens = "bunn woman"How does the Civitai on-site trainer take a dataset?
Civitai trains in the cloud from a zip you upload. Put the images and their .txt captions at the top level of the zip with matching basenames. If captions are missing, the trainer can auto-caption, but its captions will not follow your trigger-word rules. You then choose the base model, set repeats and epochs in the web form, and pay for the run with Civitai credits. Sample images per epoch let you pick the best checkpoint. Check the Civitai Education hub for the current list of supported base models.
How do they compare side by side?
| Kohya sd-scripts | Civitai trainer | |
|---|---|---|
| Where it runs | Your GPU, or a machine you rent | Civitai cloud |
| Input | Local folder, optional TOML | Zip upload |
| Repeats | Folder name or num_repeats | Form field |
| Captions | .txt next to each image | .txt next to each image inside the zip |
| Regularisation images | Supported via a reg folder | Not exposed in the basic form |
| Cost | Hardware and electricity | Per-run credits |
| Control | Every hyperparameter | A curated subset |
How do you export from LoRA Dataset for either tool?
The dataset export is a zip containing each PNG and a caption text file with the same basename. Upload that zip to Civitai as-is. For Kohya, unzip it into a folder named with your repeats and concept, for example 10_bunn woman, or point a TOML subset at the unzipped directory.
Frequently asked questions
- Do I need square images for Kohya?
- No. Enable bucketing and the trainer groups images by aspect ratio and resizes within each bucket. Keep the original framing.
- Can I move a dataset from Civitai to Kohya later?
- Yes. The image and caption pairs are identical; only the wrapper changes. Keep the original zip and you can train locally any time.
- What should the class token be for a character?
- The broad category the character belongs to, such as woman or man, following the trigger word. It gives the model a starting point for what the trigger refers to.