Nodes/FiL_Design_ImageMind/📚 LoRA Dataset Forge
ComfyUI Node

📚 LoRA Dataset Forge

📚 FiL LoRA Dataset Forge — turns an image batch into a training-ready dataset: aspect-ratio buckets at the chosen resolution, one LLM caption per image, and a kohya_ss/sd-scripts (or flat) folder written to disk with a manifest.

By FiL-Design-Ai·Created 2 months ago·Updated 16 days ago· 3
📚 LoRA Dataset Forge
  • image
  • config
  • preview
  • report
  • dataset_path
  • manifest
dataset_namemy_lora
trigger_word
class_token
base_resolution1024
layoutkohya
repeats10
caption_modenatural
crop_modecenter
dry_runfalse
write_modeappend
caption_max_words60
caption_languageen
bucket_step64
caption_extension.txt
image_formatpng
jpg_quality95
seed-1
captions
dont_caption
caption_instruction
Category🎨 FiL Design/Dataset

Inputs (22)

NameTypeDefaultDescription
imageIMAGEImages to turn into a dataset. The whole batch is processed, one file per frame.
dataset_nameSTRINGmy_loraDataset folder name under ComfyUI/output/datasets. Sanitized to a safe path segment.
trigger_wordSTRINGUnique token that activates the LoRA, prepended to every caption (e.g. 'ohwx'). Leave empty for a style LoRA.
class_tokenSTRINGClass the subject belongs to (e.g. 'woman', 'car'). Follows the trigger word in captions and in the kohya folder name.
base_resolutionCOMBO1024Training resolution. Buckets are built around this area — 1024 for SDXL/Flux, 512-768 for SD 1.5.
layoutCOMBOkohyakohya: <name>/img/<repeats>_<trigger> <class>/ plus dataset.toml. flat: images and captions directly in <name>/.
repeatsINT101–1000Repeats per image per epoch — encoded in the kohya folder name and dataset.toml. Fewer images means more repeats.
caption_modeCOMBOnaturalnatural: prose for Flux/SDXL. tags: comma tags for SD 1.5/Pony. hybrid: short comma phrases. none: trigger word only, no LLM call.
crop_modeCOMBOcenterHow the frame is cropped into its bucket. entropy keeps the most detailed region instead of the middle.
dry_runBOOLEANfalseCompute buckets, captions and file names but write nothing. Read the report to check the plan first.
write_modeCOMBOappendappend: keep existing files and continue numbering. overwrite: delete this node's image/caption pairs in the folder first (other files are left alone).
caption_max_wordsINT604–400Hard word limit per caption. Captions longer than this are truncated.
caption_languageCOMBOenCaption language. Trainers expect English unless the base model was trained otherwise.
bucket_stepINT648–256Bucket side divisor. 64 is the kohya default and fits SD/SDXL/Flux latents.
caption_extensionCOMBO.txtExtension of the caption sidecar files. kohya defaults to .txt.
image_formatCOMBOpngpng keeps the crop lossless; jpg saves disk space on large sets.
jpg_qualityINT9550–100JPEG quality when image_format is jpg. Below ~90 the artifacts start training too.
seedINT-1-1–999999999999Provider-side caption seed. -1 lets the provider pick one; a fixed value makes captions reproducible.
configoptFIL_PROVIDER_CONFIGProvider Loader config. Required for LLM captioning — leave unconnected when captions come from the captions input or caption_mode is 'none'.
captionsoptSTRINGManual captions, one per image, separated by a line containing only '---'. Accepts Optic Scanner output as-is. When filled, no LLM call is made.
dont_captionoptSTRINGInvariants the captions must never mention (e.g. 'her face, red hair'). These belong to the trigger word — describing them stops the LoRA from learning them.
caption_instructionoptSTRINGExtra instruction appended to every caption request.

Outputs (4)

NameTypeDescription
previewIMAGEBucketed frames letterboxed onto a square canvas so the batch can be previewed. The files on disk keep their real bucket size.
reportSTRINGHuman-readable summary: buckets, captions, warnings, target path.
dataset_pathSTRINGAbsolute path of the dataset folder that was written.
manifestDICTFull manifest dict — per-image bucket, crop, caption and hash.