Drop caption .txt files here

Batch edits

Rename a tag

Add caption .txt files to edit them all at once, then download the result as a .zip.

"Add a trigger word to the whole dataset." "Strip `lowres` and `watermark` from every caption." "Rename `1 girl` to `1girl` everywhere." — fixing LoRA or fine-tuning captions one file at a time isn't realistic. This tool loads hundreds of .txt files at once, applies the same edits across the entire dataset, and re-saves them as a single .zip that keeps the original filenames. You can prepend trigger words to the front (skipped on captions that already have them, so it never doubles up), append shared tags to the end, bulk-remove specific tags, rename a tag across every file, trim and tidy whitespace inside each tag, remove duplicate tags within a caption, and sort alphabetically. Removal, renaming, and dedupe use a forgiving match that folds `long_hair` and `long hair` together and ignores letter case, so datasets that mix booru-style and prompt-style tags are handled correctly. A live preview shows the edited caption for each file with an "edited" badge on the ones that changed, so you can confirm the effect before committing to the whole set. If you only need to reformat a single block of tags (normalize separators, escape parentheses, sort) reach for the sister tool tag-format, and to measure how tags are distributed across the dataset use tag-counter. Your training data is your work, so this tool touches no external dictionary or API and does the loading, editing, and zipping entirely in your browser. It never modifies your original files — it just writes out a fresh .zip you can review.

How to use

  1. Load your caption .txt files via "Drop caption .txt files here" or "Choose .txt files" (selecting every txt in a dataset folder is fine).
  2. In "Batch edits" on the right, enter trigger words to add to the front, tags to append, tags to remove, and a rename (old → new); use the options on top for trim / dedupe / sort / space style. Check the live preview.
  3. Click "Download .zip" to save every edited caption back into one .zip with the original filenames (your original files are left untouched).

FAQ

Are my caption files sent to a server?

No. Both the contents of the .txt files you load and the edited results are handled entirely in your browser as plain string processing, with no external tag dictionary or API. Nothing is uploaded, stored, or sent — even building the zip happens only on your device.

Does it overwrite my original files?

No. A browser can't write directly to your folder. The tool edits the loaded contents and writes out a new .zip; your original .txt files are never touched. Review the result, then unzip and replace as you like.

How do I add a trigger word to the front of every caption?

Put the tag(s) in "Add to front (trigger words)" (comma-separate multiple). They are prepended to each caption. Captions that already contain the tag are not given a second copy, so applying it repeatedly is safe.

Can I remove or rename long hair and long_hair together?

Yes. Removal, renaming, and dedupe use a forgiving match that treats `_` and spaces as the same and ignores letter case. So entering `long hair` under "Remove tags" also clears `long_hair` and `Long Hair`. The output spelling is controlled by the "Spaces" option (Keep / Underscores / Spaces).

Will it handle hundreds of files? The preview doesn't show them all.

The edits and the zip apply to every file. To keep the page responsive the preview shows the first 100 and notes "+ N more," but the downloaded .zip contains all files. Use "Changed only" to narrow the preview to the captions that were actually edited.

What if I only want to sort tags or normalize separators?

Reformatting a single block of tags (normalize separators, escape parentheses, sort) is what the sister tool tag-format is for. To count how tags are distributed across the dataset (how many images carry each tag), use tag-counter. caption-edit focuses on applying the same edit to many files and re-saving them.