Captioning

Pruning and blacklisting tags: what to keep and what to cut

The short answer

Prune three kinds of tags: tags that describe the concept you are training (your trigger word should absorb those), tags that are misleading for your goal, and one-off errors. Implied parent tags such as long_hair next to very_long_hair are optional: cutting them shortens captions, while keeping them matches how anime models were trained. In ImgTagger, the blacklist stops known-unwanted tags during auto-tagging, and the Remove Tags panel or the Filter panel's trash button cleans up afterwards.

A WD14 tagger at its default settings writes down everything it is reasonably sure it can see. That is exactly what you want from a tagger, but not everything it sees belongs in a training caption. Pruning is where you decide which of those claims help your goal and which work against it.

This guide covers what to cut, what to keep, and how to do both in ImgTagger. If you are new to captioning, start with how to caption a LoRA dataset, which explains the "caption what should vary" rule this page builds on.

Blacklist vs. removing tags afterwards

The ImgTagger tag editor gives you two ways to get rid of a tag, and they behave differently.

BlacklistRemove Tags panel and Filter trash
When it actsWhile Auto Tag runsAny time, on tags already in place
What it affectsNew model output onlyAny tag, including ones loaded from .txt files or typed by hand
Which imagesThe images being tagged (all or selected)Remove Tags: selected or all. Trash button: every image in the batch
MatchingWhole tag, ignoring case and underscoresRemove Tags: whole tag, ignoring case and underscores. Trash button: the exact entry you click
RememberedYes, in your browserNo

A few consequences are worth knowing before you rely on either one:

  • Spelling is forgiving. The blacklist and Remove Tags treat simple_background, Simple Background and simple background as the same tag, so type whichever form you like.
  • The blacklist leaves existing tags alone. Tags loaded from a .txt file, added by an earlier run or listed in Tags to Prepend are not filtered.
  • Changing the blacklist doesn't undo a run. To apply a new blacklist, clear the tags and run Auto Tag again. ImgTagger keeps each image's raw scores in memory for every model it has run, so the second run skips the model and finishes quickly. Clearing also wipes hand edits, so settle the blacklist before you start editing.
  • Re-running Auto Tag brings pruned tags back. It keeps what is there and adds any missing model tags. Anything you removed by hand returns unless it is blacklisted.
  • The trash button is literal. If a batch contains both long hair and long_hair, the Filter panel lists them as two entries, and each trash button removes only its own spelling. Remove Tags clears both at once. Our guide to caption .txt files covers keeping one spelling style.

A good rhythm: blacklist what you know you will never want, auto-tag, then prune what you discover in the Filter panel.

Redundant parent and child tags

Danbooru uses tag implications: some specific tags automatically add a more general one. Every post tagged very_long_hair also gets long_hair. WD14 taggers learned from those posts, so they tend to output both tags of a pair together.

Specific tagImpliesPosts in the tag list (specific / general)
very_long_hairlong_hair622,920 / 2,982,517
cat_earsanimal_ears189,097 / 722,334
2girlsmultiple_girls729,721 / 1,120,328
haircliphair_ornament224,901 / 939,495
red_scarfscarf19,940 / 149,539

The post counts come from the tag list of ImgTagger's default model, and they show how much broader the parent is. Only about one in five long_hair posts was also very_long_hair, and only about a quarter of animal_ears posts were cat_ears. The parent stands for a whole family of looks, and the base model has seen it many more times than any one child.

Whether to keep both is a trade-off, not a rule:

  • Keep both when you train on an anime model that learned from booru-style captions. That is the pairing it saw in training, and you can prompt with either tag later.
  • Cut the parent when captions are getting long, or when the base model wasn't trained on booru tags. The specific tag carries the more useful information.

Don't use the blacklist for this. Blacklisting long hair removes it from every image, including the ones with long hair that isn't very long. Remove the parent only where the child is present. In the Filter panel, check very long hair in Any mode, click Select All to select the visible images, then remove long hair from the selected ones.

Cut tags that describe your concept

The most important cuts are the tags for whatever you are training. In a character LoRA, that means the features the character always has, such as hair color, eye color and a signature accessory. In a style LoRA, it means the tags for the look itself, such as traditional_media, sketch or limited_palette. Leave them in, and the model has somewhere other than your trigger word to put the concept.

To find them, sort the Filter panel by count, high to low. A tag on nearly every image is either part of your concept or a coincidence of your dataset. If it is part of the concept, cut it. If it is a coincidence (say, almost every image happens to be outdoors), keep it, so the LoRA doesn't learn "outdoors" as part of the concept.

Low-value and misleading tags

Some tags are accurate but unhelpful, or helpful only for some goals. The right call depends on what you want the model to learn.

TagsCut whenKeep when
Ratings: general, sensitive, questionable, explicitYou won't prompt with ratings. ImgTagger lets general through at just 0.1 confidence, so it appears readily.Your base model uses rating tags and you want to steer them.
simple_background, white_background, grey_backgroundPlain backgrounds are part of the style you are training.Your images just happen to be on plain backgrounds, as reference sheets often are. The tags stop the LoRA from putting every scene on white.
signature, watermark, artist_name, dated, twitter_usernameYou have cropped or cleaned the mark out of the image.The mark is still in the pixels. The tag gives it somewhere to go other than your trigger, and lets you push it away with a negative prompt.
monochrome, greyscale, sketchThey describe your style on every image.They mark the exceptions in a mostly colored set.
border, letterboxedYou crop the border off, which is the better fix.You can't crop, and want the border tied to the tag.

The watermark row is the one people most often get backwards. Blacklisting watermark doesn't remove a watermark from the image. It only hides it from the trainer, which then has to explain the mark some other way, usually with your trigger word.

ImgTagger already holds a few of these to a stricter standard: monochrome, greyscale, sketch and blurry need 0.9 confidence, and the three background tags need 0.5. When they do appear, they are usually right. The confidence threshold guide explains these overrides.

Audit for one-off noise

Most tagger mistakes are rare tags on one or two images. They are hard to see in a single caption and easy to see across the batch:

  1. Open the Filter panel and set Sort tags by to Count (low → high).
  2. Click the first tag to show only the images that have it (Any mode), and look at them.
  3. If the tag is wrong, click its trash button. For a tag on one image, that removes it from just that image.
  4. If it is right, leave it. A rare but correct tag is exactly the kind of variable detail a caption should record. If you aren't sure what a tag means, the booru tag glossary explains the common ones.
  5. Uncheck it and move on to the next tag.

The search box helps with families of tags. Search ears to see animal ears, cat ears and fox ears together, or background to see every background tag at once. Hand-typed tags benefit too: a typo shows up as a count-of-one entry right next to the correct spelling.

Sample blacklists to start from

These are starting points, not finished lists. Paste one into Never add these tags box in the Auto-tag panel, then adjust it after your first look at the results. They use spaces to match ImgTagger's output, but underscores work too.

Any project: no rating tags

general, sensitive, questionable, explicit

Character LoRA

For a character who always has grey hair, green eyes and a hairclip. Swap in your own character's fixed features, and leave outfit, pose and background tags alone.

general, sensitive, questionable, explicit, grey hair, green eyes, hairclip, hair ornament

Style LoRA

For a traditional ink-and-watercolor look. List only tags that describe the style on every image.

general, sensitive, questionable, explicit, traditional media, watercolor (medium), limited palette

Images already cleaned of marks

Only once signatures and watermarks are really gone from the pixels. This stops stray guesses on clean images.

signature, watermark, artist name, dated, twitter username
The blacklist is remembered

ImgTagger saves the blacklist in your browser, so it is still there on your next visit. That is handy within a project and a trap between projects: a character blacklist left in place will quietly strip grey hair from your next, unrelated dataset.

Put this into practice

Run WD14 tagger models on a whole folder, then search, filter and bulk-edit the tags before exporting .txt caption files. It runs in your browser. Open the Batch WD14 Tagger & Editor.

Frequently asked questions

Can I blacklist every tag that contains a word, like "background"?

No. The blacklist only matches whole tags, with no wildcards. Either list each tag you want blocked, or run the tagger, search the Filter panel for background and use the trash button on the ones you don't want.

Is there an undo for removing tags?

No. Before a big cleanup, save a checkpoint: click Download and export the .txt tag files only. To roll back, unzip it, use Clear All Tags from All, then drop the saved .txt files back onto the tagger. ImgTagger matches them to the loaded images by name. It can't read the ZIP itself, so unzip it first.

Should I keep character name tags the tagger finds?

The ConvNeXt V2 and Swin V2 models can output 2,132 character tags; the ViT model outputs none. If you are training a LoRA for a known character, the name tag and your trigger compete for the same meaning, so most people pick one: use the name as the trigger, or remove the name tag. Taggers can also mistake an original character for a famous one with a similar design. Remove those.

How long should a caption be after pruning?

There is no ideal tag count, but there is a ceiling. The text encoders in Stable Diffusion 1.x and SDXL read 75 tokens at a time, and kohya-ss sd-scripts uses 75 unless you set --max_token_length to 150 or 225. A tag is often two to four tokens once you count the comma, so a caption of twenty-odd tags can reach the default limit. Cutting redundant parents is the easiest way to get under it.