Nodes/ComfyUI-Miaoshouai-Tagger/🐾MiaoshouAI Tagger
ComfyUI Node

🐾MiaoshouAI Tagger

A Florence-2 captioner tuned for SD/Flux prompts, not museum placards

By miaoshouai·Created 2 years ago·Updated about a year ago· 525
🐾MiaoshouAI Tagger
  • images
  • images
  • filenames
  • captions
  • folder_path
  • batch_size
modelpromptgen_base_v2.0
folder_pathPath to your image folder
caption_methodextra_mixed
max_new_tokens1024
num_beams4
random_promptnever
filenames
captions
prefix_caption
suffix_caption
replace_tagsreplace_tags eg:search1:replace1;search2:replace2

If you've ever run Microsoft's stock Florence-2 on a folder of training images and gotten back polite, encyclopedic descriptions - "the image shows a woman standing in a room" - this node is the fix. MiaoshouAI Tagger wraps PromptGen, a Florence-2 fine-tune the pack's author trained specifically on curated Civitai images and their prompts, so the captions it produces read like something you'd actually type into a prompt box instead of an alt-text generator. It's the captioning half of a LoRA dataset pipeline: point it at a folder, get back tags or descriptions, wire those into a save node, done.

Why this exists instead of stock Florence-2 or WD14

WD14 is the old standby for anime tagging, but it's tag-only and needs manual cleanup. Stock Florence-2 is a good general vision model, but it wasn't trained to think like Stable Diffusion - its captions describe the image, not prompt it. PromptGen splits the difference: same Florence-2 architecture (so it's small, ~1GB, and fast), but fine-tuned on the exact kind of data an SD/Flux prompt is made of. The tradeoff is real, though, and worth knowing before you commit a 10,000-image dataset to it: the author's own release threads show community feedback about PromptGen repeating certain flowery phrasing when a small training set overfits (one long-time tester singled out its habit of describing hair as "cascading down her back like a waterfall" far too often), and for pure tag-level precision on NSFW content people still reach for WD14-style taggers first. Our knowledge base's read matches that: Florence-2 "works well combined with a WD14 tagger" rather than as a total replacement for one.

The inputs and outputs that matter

You'll mostly touch three things: model (pick between promptgen_base and promptgen_large, each in v1.5 or v2.0 - base is faster and lighter, large is more accurate; v2.0 is the newer, better-trained release), folder_path (point it at your image folder, or wire an images batch into the optional images input instead), and caption_method, which is the real lever - options run from tags (short, comma-separated) through simple, detailed, extra, mixed, extra_mixed (the default, combining tag-style and descriptive output) up to analyze, which produces Florence-2's structured multi-subject breakdown for the Caption Analyzer node to filter. num_beams and max_new_tokens control beam-search width and caption length if you need to tune quality vs. speed; random_prompt (never/always) makes repeat runs on the same image vary the output if you want dataset diversity from one source image.

The optional prefix_caption and suffix_caption fields glue fixed text onto every caption - the natural place to drop a trigger word - and replace_tags does bulk find-and-replace (search1:replace1;search2:replace2) if PromptGen keeps calling your character something you don't want baked into the LoRA. Outputs pass everything downstream in one bundle: images, filenames, and captions (all lists, one per processed image), plus folder_path and batch_size so a save node further down the chain doesn't need its own file listing. That passthrough design is deliberate - it's built to feed straight into Miaoshouai SaveTags without you wiring a second folder read.

How to install it

Easiest path: ComfyUI Manager, search "ComfyUI-Miaoshouai-Tagger", install, restart. Manually, it's the standard pattern -

cd ComfyUI/custom_nodes
git clone https://github.com/miaoshouai/ComfyUI-Miaoshouai-Tagger
pip install -r ComfyUI-Miaoshouai-Tagger/requirements.txt
  • with one real version floor: transformers 4.38.0 minimum, called out explicitly in the README because Florence-2 needs it. The PromptGen model itself isn't bundled; it downloads automatically from Hugging Face the first time you run the node and lands in ComfyUI/LLM. If a download stalls or you want a newer version, delete that model's folder and relaunch - it re-downloads fresh rather than trying to patch in place.

Common issues & troubleshooting

Missing-node error right after install. This is common enough that the author answers it directly on his own release threads: install ComfyUI Manager if you haven't, then use "Install Missing Custom Nodes" from the manager rather than chasing individual dependency errors by hand - it resolved the exact "which package do I even need" confusion for at least one user in the wild.

Captions feel repetitive or overtrained. That's a known PromptGen limitation on smaller/derivative datasets, not something you're doing wrong - try large over base, switch caption_method to something less structured, or fall back to replace_tags to break up the phrases it leans on too hard.

Model won't update to a newer PromptGen release. Delete the existing folder under ComfyUI/LLM and rerun the workflow; it auto-fetches the current version rather than upgrading in place.

CategoryMiaoshouAI Tagger

Inputs (12)

NameTypeDefaultDescription
modelCOMBOpromptgen_base_v2.04 options: promptgen_base_v1.5, promptgen_large_v1.5, promptgen_base_v2.0, promptgen_large_v2.0
folder_pathSTRINGPath to your image folder
caption_methodCOMBOextra_mixed7 options: tags, simple, detailed, extra, mixed, extra_mixed, +1
max_new_tokensINT10241–4096
num_beamsINT41–64
random_promptCOMBOnever2 options: never, always
imagesoptIMAGE
filenamesoptSTRING
captionsoptSTRING
prefix_captionoptSTRING
suffix_captionoptSTRING
replace_tagsoptSTRINGreplace_tags eg:search1:replace1;search2:replace2

Outputs (5)

NameTypeDescription
imagesIMAGE
filenamesSTRING
captionsSTRING
folder_pathSTRING
batch_sizeINT