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.

AspectBlacklistRemove 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_hair783,428 / 3,645,082
cat_earsanimal_ears232,052 / 950,191
2girlsmultiple_girls860,944 / 1,309,199
haircliphair_ornament280,648 / 1,175,185
red_scarfscarf26,363 / 180,052

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.

What to prune for each kind of LoRA

The same tag can be a cut in one project and a keeper in the next. hand_on_own_hip is noise in a character set, and it is the whole point of a pose LoRA. This table is a common starting point for six common kinds of LoRA, built on the rule above: cut what the trigger should carry, keep what should stay under your control at prompt time.

You are trainingUsually cutUsually keep
A characterFixed hair and eye color, hairstyle, fixed accessories, the character's name tag if the tagger finds oneOutfits, expression, pose, framing, background, other people
An outfitThe garment's fixed parts: for a sailor-style uniform, sailor_collar, pleated_skirt, neckerchiefThe wearer's hair, eyes and body framing, so the outfit isn't welded to one person
An art styleMedium and palette tags that hold on every image (traditional_media, watercolor_(medium), limited_palette)Every subject, setting and composition tag
An object or propTags for the object's own fixed parts and colorsWho holds it, where it is, the camera angle
A pose or compositionThe pose tags themselves (hand_on_own_hip, from_behind, looking_back)Character features and outfits, which should change from image to image
A place or backgroundFixed features of the placeTime of day, weather, people in the scene

The outfit row is the easiest to get wrong. If every image of the uniform shows the same grey-haired character and you cut nothing but the uniform tags, the LoRA has two constant things to absorb. Keep grey_hair and green_eyes tagged, and better still, gather the outfit on several different wearers. The tags tell the trainer the hair belongs to the person, and the trigger gets only the clothes.

A pose LoRA has the mirror problem. The pose is constant and everything else should vary, so the pose tags go and the people stay. If the tagger misses part of the pose (WD14 has no tag for many specific gestures), that part goes to the trigger anyway, which is what you want here.

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.

Contradictions worth checking

The tagger scores every tag on its own, so nothing stops it from writing two tags that can't both be true of one person. The fastest way to catch them is the Filter panel's All mode, described in step 4 of the captioning workflow: check both tags, and every image left on screen carries the pair. These are the pairs worth running on almost any character dataset, with how to settle each one.

PairWhen both can be rightHow to decide
solo + multiple_girlsNever on Danbooru's termsCount the people. Keep one tag, and fix 1girl or 2girls to match.
no_humans + 1girlNeverUsually a mascot, doll or animal the model half-read as a person. Look and keep one.
long_hair + short_hairTwo people with different hairOn a solo image, keep the one that matches. If the hair is tied up, judge by the length of the ponytail or bun.
open_mouth + closed_mouthTwo peopleOn a solo image, keep the one you see.
indoors + outdoorsRarely: a view through a large window, a covered balconyKeep the one that describes where the subject stands.
day + nightAlmost neverAt sunset or dusk neither may fit well. Keep one, or neither.
full_body + upper_body or portraitAlmost never: framing tags each describe a cropKeep the single framing tag that fits. These matter more than most, because they teach the model how much of the figure to draw.

For a pair you settle the same way every time, the quickest bulk fix is to filter to the pair in All mode, click Select All, and remove the wrong tag from the selected images only. Images that carry just one of the two are untouched.

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.

Merging captions from different taggers

Datasets grow over time, and the old half was often tagged by a different model. When you load both halves into one batch, the Filter panel shows the seams as pairs of tags that mean the same thing:

  • Renamed tags. The 2023 WD14 models and the 2024 v3 models learned from different snapshots of Danbooru. Between the two lists, 107 tags were renamed, such as hand_on_hip, which v3 writes as hand_on_own_hip. A mixed batch can hold both names for one pose.
  • Retired tags. 64 tags in the 2023 list were deprecated on Danbooru and dropped from v3, bangs among them. Old captions carry bangs while new ones never will, so the tag ends up on exactly the images that came from the old run, which is a pattern the trainer can learn.
  • Spelling style. Older captions from scripts often keep underscores, while ImgTagger writes spaces.

Settle each pair on one name before training. Pick the v3 name when you can, since it matches the current default model and today's Danbooru. Our WD14 tag list guide lists the renamed and retired tags, and the caption file guide has the four-step rename in ImgTagger and the fix for mixed underscores. A retired tag with no successor, like bangs, is simplest to delete from the whole batch with the Filter panel's trash button.

If you tag with the sd-scripts script instead

kohya-ss sd-scripts ships its own WD14 tagger, finetune/tag_images_by_wd14_tagger.py, and some people prune there before the captions ever reach an editor. Its options map onto ImgTagger's, with a few differences that change how you write your lists. We checked these against the script's source and its tagger documentation.

JobImgTaggersd-scripts tagger
Block tagsBlacklist; ignores case and treats underscores as spaces--undesired_tags; exact match, so with --remove_underscore on you must type the spaced form
Rename tags as they are writtenNo; rename afterwards in the editor--tag_replacement "old,new;old2,new2" (escape a literal comma or semicolon with a backslash)
Rating tagsEach rating tested against the threshold like any tagLeft out unless you add --use_rating_tags or --use_rating_tags_as_last_tag, and then only the single highest rating
Character namesWritten like other tags--character_tags_first moves them to the front; --character_tag_expand splits name_(series) into two tags
Existing captionsKept; new tags added after themOverwritten, unless --append_tags, which adds only tags not already there

The rating row explains a common surprise. Captions from the script usually have no rating tag at all, while ImgTagger's carry one, so a dataset tagged half in each place has ratings on half its images. Blacklist the four ratings in ImgTagger, or turn them on in the script, so both halves agree. The script's default model, when you don't pass --repo_id, is the older wd-v1-4-convnext-tagger-v2, which is one more reason to expect the naming seams above.

Signs you have pruned too far

Pruning removes information on purpose, and it is easy to keep going past the point where captions still tell images apart. Two quick checks on an exported set of .txt files, for macOS, Linux, Git Bash or WSL, run inside the folder:

# captions shared by more than one image, most common first
for f in *.txt; do cat "$f"; echo; done | sort | uniq -c | sort -rn | head

# average number of tags per caption
for f in *.txt; do cat "$f"; echo; done | awk -F', ' 'NF {n += NF; c++} END {printf "%.1f tags per caption\n", n / c}'

The echo is there because ImgTagger writes each caption without a final line break. Read the results like this:

  • Several images share one caption. Run grep -lx 'the caption text' *.txt to list them and look at the pictures side by side. If they really differ in pose, framing or setting, the tags for those differences are gone, and the trigger will absorb them. Put the differences back.
  • A count of three or four tags. Captions like miraoc, 1girl, solo leave almost everything to the trigger, which can push the LoRA toward reproducing your training images instead of following prompts.
  • Only the most confident tags are left. If you trimmed the last few tags from each caption by hand, those were its least confident ones, and you have rebuilt a high threshold. The threshold guide shows what that costs in missed tags.

Sample blacklists to start from

Treat these as starting points to adjust. Paste one into the 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 default model (ViT v3) can output 2,751 character tags, and the 2023 models 2,132. 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.

My character is alone in every image. Should I cut 1girl and solo too?

Usually not. They are on every image, but they describe the composition rather than the character, so they fall on the "coincidence" side of the rule above. Anime base models know them better than almost any other tag (1girl sits on 5,113,288 posts in the default model's tag list), and keeping them leaves "one girl, alone" attached to those tags instead of to your trigger. That makes it easier to prompt the character into a scene with other people later.