Captioning

Booru tags vs natural-language captions: which should you use?

The short answer

Caption your images the way your base model was trained: anime-focused SDXL models such as Animagine XL and Illustrious XL learned from Danbooru tags, while newer models with a language-model text encoder, such as Stable Diffusion 3 and FLUX.1, are built to read full sentences. Tags are consistent and easy to bulk-edit, but only sentences can say who is doing what to whom. If you need both, a short sentence followed by tags is a practical middle ground. ImgTagger's auto-tagger writes the tags and its caption generator writes the sentences.

There are two main ways to caption a training image. The first is a comma-separated list of booru tags, the output of WD14 taggers like the one in ImgTagger's auto-tagger. The second is one or more plain English sentences, the output of captioning models such as BLIP or Florence-2. Both work, but they are good at different things, and the right choice depends more on the model you are training than on taste. This guide compares them on one example image and ends with a decision table.

The same image, captioned three ways

Imagine an illustration of two girls on a park bench under cherry blossoms. The girl on the left has short black hair and a red jacket and is reading a book. The girl on the right has long blonde hair and a blue dress and is eating ice cream. The captions below were written by hand to show the typical shape of each format. They are not the output of a particular model.

Booru tags, in the comma-separated format ImgTagger exports:

2girls, multiple girls, sitting, bench, short hair, black hair, red jacket, long hair, blonde hair, blue dress, book, reading, ice cream, holding, cherry blossoms, tree, outdoors, day

A short caption, typical of BLIP, whose captioning models were fine-tuned on the one-sentence captions of the COCO dataset:

two girls sitting on a bench in a park

A detailed caption, the kind you get from a model with a "detailed caption" mode, such as Florence-2's <MORE_DETAILED_CAPTION> task:

Two girls sit side by side on a wooden park bench under cherry blossom trees. The girl on the left has short black hair and a red jacket and is reading a book. The girl on the right has long blonde hair, wears a blue dress and is eating an ice cream cone.

Read the tag list again and try to work out who is wearing the red jacket. You can't. The tags record every ingredient but not how they fit together. The short caption has the opposite problem: it is accurate but leaves out almost everything. The detailed caption has both the ingredients and the structure, at the cost of length.

Where booru tags are stronger

Consistency

A WD14 tagger can only choose from a fixed list. The default model in ImgTagger has 10,861 possible labels. A red jacket is always red_jacket, never "crimson coat" in one file and "red outerwear" in the next. Caption models write freely, so the same thing can be described several ways across a dataset. A consistent vocabulary makes it easier for a model to tie one word to one visual idea.

Counting

Booru tags have dedicated count labels: 1girl, 2girls, solo, no_humans and so on. They are among the most common tags in the whole vocabulary. In the default model's tag list, 2girls appears on 860,944 posts and 1girl on 5,113,288, so anime models have seen them constantly. A sentence can say "two girls" just as well, but caption models sometimes miscount, and nothing flags the error.

Editability

Tags are separate items, so you can edit a whole dataset at once. You can remove blurry_background from 400 files, add a trigger word to the front of every caption, or filter to all images tagged outdoors. ImgTagger's tag editor does all of this in bulk. Fixing the same mistake in 400 hand-written sentences means editing each one. The tag pruning guide shows how far bulk cleanup can go.

Per-tag control

A tagger gives every tag its own confidence score, so you can tune what makes it into the caption. Raise the confidence threshold and weak guesses drop out. A caption model gives you finished prose with no score for each claim. If it invents a detail, the mistake reads just as confidently as the true parts.

Training tricks

Many trainers shuffle tag order each epoch so the model doesn't learn that the first tag always matters most. In kohya-ss sd-scripts, --shuffle_caption shuffles the comma-separated parts of a caption and --keep_tokens holds the first few in place. That only works when each part makes sense on its own, which is true of tags but not of clauses in a sentence.

Where sentences are stronger

Attribute binding

"Attribute binding" means attaching each property to the right object: the red jacket to the girl on the left, the blue dress to the girl on the right. Tags can't do this when two subjects share an image. They work best when there is only one character, where every attribute obviously belongs to the same person.

Relationships and layout

Danbooru does have some relationship tags, such as holding_hands, looking_at_another and hand_on_another's_shoulder. They record that something is happening, but not who is doing it. Left and right, in front of and behind, and "the cat on the girl's lap" are all easy in a sentence and mostly impossible in tags.

Things outside the vocabulary

The booru vocabulary grew up around anime illustration. It has very detailed coverage of hairstyles and outfits, but nothing for many everyday ideas. A caption model can name a specific object or describe a mood. A tagger can only use the labels on its list. If your dataset is photos of products, buildings or food, sentences usually describe it better.

Sentences only help if the text encoder can read them

The CLIP text encoders in Stable Diffusion 1.x and SDXL handle sentence structure poorly. Both model cards list compositional prompts, such as a red cube on top of a blue sphere, as a known weakness. Research has also found that vision-language models often treat a caption roughly like a bag of words. Sentences are still clearer for people, but older models may get less benefit from them.

Token length: what fits in 75 tokens

CLIP text encoders read at most 77 tokens, two of which are start and end markers. That leaves 75 for your caption. Trainers such as sd-scripts can extend this to 150 or 225 with --max_token_length by encoding the caption in chunks. We counted the example captions above with the original CLIP tokenizer:

CaptionCLIP tokensFits in 75?
18 booru tags45Yes
Short BLIP-style sentence9Yes
Detailed three-sentence caption57Yes
Hybrid (one sentence + 13 tags)63Yes, just

Two details are worth knowing. First, every comma is a token, so 17 of the 45 tokens in the tag caption are commas. Second, underscores are tokens too. looking_at_viewer costs 5 tokens and looking at viewer costs 3. That is a point in favor of writing tags with spaces, as ImgTagger does. The caption .txt file guide covers that choice in more detail.

Tags are not automatically shorter than sentences. A sentence spends tokens on words like "the", "is" and "on the left", which carry its structure. Models with a T5 encoder have far more room. The diffusers FLUX pipeline, for example, uses a default maximum of 512 T5 tokens.

Trainers follow the same split. In kohya-ss sd-scripts, --max_token_length belongs to the CLIP-based Stable Diffusion models, and the FLUX.1 guide says it is not used there. FLUX.1 training takes --t5xxl_max_token_length instead, which the source defaults to 256 tokens for FLUX.1 schnell and 512 for dev, and the SD3 guide gives 256 as its default. T5 splits words differently from CLIP, so our CLIP counts above don't carry over exactly, but a three-sentence caption sits well inside either limit.

Match the captions to the text encoder

A LoRA or fine-tune trains on top of a base model and reuses what it already knows. If your captions use the same "language" as the base model's original training captions, the new concept attaches to words the model already understands. If they don't, part of your training is spent teaching the model a new caption style.

Base model familyText encoder(s)What it was trained onCaption style that fits
Stable Diffusion 1.xCLIP ViT-L/14LAION web images with their alt textShort phrases or tags. Anime-focused 1.x checkpoints usually expect tags.
SDXL baseOpenCLIP ViT-bigG + CLIP ViT-LNot published in detailShort natural phrases
Anime SDXL fine-tunes (Animagine XL, Illustrious XL and their derivatives)Same as SDXLAnime images captioned with Danbooru-style tagsBooru tags
Stable Diffusion 3 / 3.5CLIP-L + CLIP-G + T5-XXLPer the SD3 paper: 50% original captions, 50% synthetic captions from the CogVLM vision-language modelNatural-language sentences
FLUX.1CLIP-L + T5-XXLNot published in detailNatural-language sentences, by common practice

The Animagine XL 3.1 model card is explicit: it says the model is optimized for Danbooru-style tags rather than natural-language prompts. Illustrious XL was fine-tuned on the Danbooru2023 dataset. On the other side, the Stable Diffusion 3 paper explains that it mixed in synthetic captions because human-written captions focus on the main subject and leave out the background and composition. OpenAI's DALL·E 3 paper found that training on highly descriptive generated captions substantially improved prompt following. That is why newer general-purpose models lean toward sentences.

Model cards change between versions, and some newer anime releases also claim better natural-language understanding. Before you caption a large dataset, check the model card for the exact checkpoint you are training on.

Writing sentence captions that train well

Sentence captions lose the main strength of tags, a fixed vocabulary, unless you bring one yourself. Most of the work is making 50 or 500 captions read as if one careful person wrote them all.

  • Keep one order. Subject first, then what varies about them (clothing, expression, pose), then the setting, then the kind of picture if your set mixes kinds. A predictable order makes missing details easy to spot when you skim the files.
  • Choose one name for each thing. If the first caption says "jacket", don't let later ones drift to "coat" or "blazer" for the same garment. A short list of house words, kept in a text file beside the dataset, does the job a tag vocabulary does for free.
  • Leave out what the trigger should learn. The caption rule is the same as for tags: describe what should stay changeable and skip the fixed features. "miraoc, a girl with grey hair and green eyes" teaches the grey hair to the words "grey hair" instead of to miraoc. The full reasoning is in how to caption a LoRA dataset.
  • Describe what is there. Moods, guesses about the story, and praise ("a beautiful scene") don't match anything in the pixels the model can learn from.

Here is the character example from the captioning guide written as a sentence, with the fixed features left out:

miraoc, a girl in a school uniform and a dark jacket, smiling at the viewer as she stands under a blossoming cherry tree on a sunny day.

It costs 32 CLIP tokens, against 21 for the pruned tag version of the same caption (miraoc, 1girl, solo, smile, school uniform, jacket, upper body, outdoors, tree), and it says a little more: what she is doing under the tree, and the weather.

Hybrid captions: a sentence plus tags

A hybrid caption puts a short sentence first, for the relationships, and then the tags, for coverage and consistency:

Two girls sit on a park bench under cherry blossoms; the one on the left reads a book, the one on the right eats ice cream. 2girls, sitting, bench, short hair, black hair, red jacket, long hair, blonde hair, blue dress, book, ice cream, cherry blossoms, outdoors

Most of the caption stays easy to edit, and the sentence records what tags can't. This suits models that understand both styles, and multi-character images in an otherwise tag-captioned dataset.

Watch out for caption shuffling. --shuffle_caption splits on commas, so a sentence that contains commas gets cut into pieces and scrambled. sd-scripts solves this with --keep_tokens_separator. Everything before the separator stays fixed, and only the part after it is shuffled:

Two girls sit on a park bench, one reading and one eating ice cream ||| 2girls, sitting, bench, book, ice cream, cherry blossoms

Set keep_tokens_separator to |||, or whatever marker you chose, in your training config. The sd-scripts dataset config documentation shows more examples.

Several captions for one image

You don't always have to choose. sd-scripts can hold more than one caption per image and pick one each time the image is used, so the model sees both styles for the same picture. The dataset config guide documents two ways, both set per subset in the config file.

One caption per line, with enable_wildcard

Normally only the first line of a caption file is read. With enable_wildcard = true, each non-empty line is a separate caption, and one line is chosen at random for each step:

miraoc, 1girl, solo, smile, school uniform, jacket, upper body, outdoors, tree
miraoc, a girl in a school uniform and a dark jacket, smiling under a cherry tree. |||

Shuffling and tag dropout still apply to whichever line is picked. That suits the tag line and would scramble the sentence, which splits at its commas. The ||| at the end of the sentence line handles it: with keep_tokens_separator = "|||" set, everything before the marker is held fixed, so the whole sentence survives. The tag line has no marker, so keep_tokens = 1 applies there and holds the trigger in front. The same option also turns on wildcards inside a line: {simple|white} background becomes one or the other at random.

Multi-line candidates, with enable_multiline_caption

enable_multiline_caption = true keeps line breaks inside a caption and separates whole candidates with a line that starts ---===---. It was added for models whose text encoder is a language model, which read line breaks as meaning; the guide says CLIP and T5 treat them as spaces, so for SD 1.5, SDXL and FLUX.1 the one-line-per-caption form above does the same job more simply. Shuffling and tag dropout only touch a candidate that has no line breaks.

Cached text encoder outputs turn this off

With --cache_text_encoder_outputs, each caption is encoded once before training, so the random choice of line and the wildcards stop working, and sd-scripts prints a warning. Fixed additions such as caption_prefix are still applied.

ImgTagger's tag editor reads a caption file as comma-separated tags and has no idea about lines, so do the tag work first and assemble multi-line files at the end, as in the last section of this page.

Decision table

Your situationUseWhy
LoRA on an anime SDXL or SD 1.5 checkpointBooru tagsMatches how the base model was trained
LoRA on FLUX.1 or SD3SentencesT5 text encoder built for sentences
Mostly single-character imagesBooru tagsNothing needs binding, and tags are easy to edit
Several characters with different outfitsSentences or hybridTags can't say who wears what
You plan to shuffle or drop tags during trainingTags, or hybrid with a separatorShuffling breaks sentences
Photos, products, architectureSentencesThe booru vocabulary is thin outside anime art
Organizing and searching a collectionBooru tagsA fixed vocabulary is filterable
Alt text on a websiteA sentenceWritten for people, not models

The last row is a different job entirely, covered in image keywords for SEO.

Making sentence and hybrid captions with ImgTagger

The two styles come from two of our tools. The auto-tagger runs WD14 models and writes booru tags. The image caption generator runs Florence-2, a captioning model from Microsoft, and writes sentences at three lengths from one pass over each picture: Short, Detailed and Very detailed.

Sentence captions

  1. Add the batch to the caption generator and choose a length. Detailed is a reasonable default for training captions; Short is close to the one-sentence COCO style shown at the top of this page.
  2. Type your trigger with a trailing comma, such as miraoc,, into Start every caption with. A prefix ending in a comma lowers the caption's first letter, so it reads as one sentence.
  3. Leave Leave out openings like "The image shows" on (it is on by default). It strips those words from the start of each caption, which saves tokens and keeps captions uniform.
  4. Read every caption against its picture and edit in place. Edits are kept for each length.
  5. Click Download .txt files for captions.zip, one <image name>.txt per picture. Two pictures with the same base name get (2) added to the second file's name, so give every image a unique name first.

Step 4 is not optional. When we checked the caption generator on eight test pictures, Short named the main subject in all eight, but Detailed added something that wasn't in the picture in four of them: cheese on a plain burger, text on a picture with no text, a fence instead of bare branches. A training caption with an invented detail teaches the model a false link, the same way a wrong tag does.

Hybrid captions

For the sentence-plus-tags format, run both tools on the same images. Put the trigger in the caption generator's start box and leave it out of the tagger, so it appears once, at the front. Tag and prune in the tagger as usual, export the .txt tag files, and unzip the two sets into folders named captions and tags. This loop for macOS, Linux, Git Bash or WSL joins each pair with the ||| separator from the hybrid section:

mkdir -p merged
for f in captions/*.txt; do
  n=$(basename "$f")
  [ -f "tags/$n" ] || { echo "no tags for $n"; continue; }
  printf '%s ||| %s' "$(cat "$f")" "$(cat "tags/$n")" > "merged/$n"
done

Each file in merged then reads like miraoc, a girl smiles under a cherry tree. ||| 1girl, solo, smile, outdoors, tree. Set keep_tokens_separator = "|||" and shuffle_caption = true, and the sentence stays whole while the tags shuffle. To build the two-line files of the wildcard section instead, put the trigger in both tools so each line starts with it, and change the printf format to '%s |||\n%s'.

Tagging first helps even when the final captions are sentences, because the tag list is a checklist of what is visible. For the full tag-based workflow, see captioning a LoRA dataset.

Put this into practice

Drop in one picture and get its anime tags in seconds, ready to copy into an art prompt or a caption. It runs in your browser. Open the Anime Tagger.

Frequently asked questions

Can I turn a tag list into a sentence automatically?

You can, with a template or a language model, but the result can only be as good as the tags. A language model reading 2girls, red jacket, blue dress has no way of knowing who wears which, so it will guess. To get a sentence that is actually right about relationships, caption from the image itself.

Do booru tags work as prompts on FLUX.1 or Stable Diffusion 3?

Partly. Many tags are ordinary English words, so a T5 or CLIP encoder can read them. Booru-specific tags such as 1girl or absurdres carry much less meaning for a model that wasn't trained on them, and results tend to be less predictable than with plain sentences.

How long should a natural-language caption be?

Long enough to cover what is visible and nothing more. For CLIP-only models, stay under 75 tokens unless your trainer extends the limit. For T5-based models, two to four sentences is common. Skip filler such as "This image shows", which spends tokens without adding information.

Where should a trigger word go in a sentence caption?

At the very start, just as with tags. In a hybrid caption, put it before the sentence so it stays fixed when the tags are shuffled. In ImgTagger, the "Always add these tags first" box puts a trigger word at the front of every image's tags when you run the auto-tagger.