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.
📚 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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Images to turn into a dataset. The whole batch is processed, one file per frame. | |
| dataset_name | STRING | my_lora | Dataset folder name under ComfyUI/output/datasets. Sanitized to a safe path segment. |
| trigger_word | STRING | Unique token that activates the LoRA, prepended to every caption (e.g. 'ohwx'). Leave empty for a style LoRA. | |
| class_token | STRING | Class the subject belongs to (e.g. 'woman', 'car'). Follows the trigger word in captions and in the kohya folder name. | |
| base_resolution | COMBO | 1024 | Training resolution. Buckets are built around this area — 1024 for SDXL/Flux, 512-768 for SD 1.5. |
| layout | COMBO | kohya | kohya: <name>/img/<repeats>_<trigger> <class>/ plus dataset.toml. flat: images and captions directly in <name>/. |
| repeats | INT | 101–1000 | Repeats per image per epoch — encoded in the kohya folder name and dataset.toml. Fewer images means more repeats. |
| caption_mode | COMBO | natural | natural: prose for Flux/SDXL. tags: comma tags for SD 1.5/Pony. hybrid: short comma phrases. none: trigger word only, no LLM call. |
| crop_mode | COMBO | center | How the frame is cropped into its bucket. entropy keeps the most detailed region instead of the middle. |
| dry_run | BOOLEAN | false | Compute buckets, captions and file names but write nothing. Read the report to check the plan first. |
| write_mode | COMBO | append | append: 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_words | INT | 604–400 | Hard word limit per caption. Captions longer than this are truncated. |
| caption_language | COMBO | en | Caption language. Trainers expect English unless the base model was trained otherwise. |
| bucket_step | INT | 648–256 | Bucket side divisor. 64 is the kohya default and fits SD/SDXL/Flux latents. |
| caption_extension | COMBO | .txt | Extension of the caption sidecar files. kohya defaults to .txt. |
| image_format | COMBO | png | png keeps the crop lossless; jpg saves disk space on large sets. |
| jpg_quality | INT | 9550–100 | JPEG quality when image_format is jpg. Below ~90 the artifacts start training too. |
| seed | INT | -1-1–999999999999 | Provider-side caption seed. -1 lets the provider pick one; a fixed value makes captions reproducible. |
| configopt | FIL_PROVIDER_CONFIG | Provider Loader config. Required for LLM captioning — leave unconnected when captions come from the captions input or caption_mode is 'none'. | |
| captionsopt | STRING | Manual captions, one per image, separated by a line containing only '---'. Accepts Optic Scanner output as-is. When filled, no LLM call is made. | |
| dont_captionopt | STRING | Invariants 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_instructionopt | STRING | Extra instruction appended to every caption request. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| preview | IMAGE | Bucketed frames letterboxed onto a square canvas so the batch can be previewed. The files on disk keep their real bucket size. |
| report | STRING | Human-readable summary: buckets, captions, warnings, target path. |
| dataset_path | STRING | Absolute path of the dataset folder that was written. |
| manifest | DICT | Full manifest dict — per-image bucket, crop, caption and hash. |