🐾MiaoshouAI Tagger
A Florence-2 captioner tuned for SD/Flux prompts, not museum placards
- images
- images
- filenames
- captions
- folder_path
- batch_size
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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | promptgen_base_v2.0 | 4 options: promptgen_base_v1.5, promptgen_large_v1.5, promptgen_base_v2.0, promptgen_large_v2.0 |
| folder_path | STRING | Path to your image folder | — |
| caption_method | COMBO | extra_mixed | 7 options: tags, simple, detailed, extra, mixed, extra_mixed, +1 |
| max_new_tokens | INT | 10241–4096 | — |
| num_beams | INT | 41–64 | — |
| random_prompt | COMBO | never | 2 options: never, always |
| imagesopt | IMAGE | — | |
| filenamesopt | STRING | — | |
| captionsopt | STRING | — | |
| prefix_captionopt | STRING | — | |
| suffix_captionopt | STRING | — | |
| replace_tagsopt | STRING | replace_tags eg:search1:replace1;search2:replace2 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| filenames | STRING | — |
| captions | STRING | — |
| folder_path | STRING | — |
| batch_size | INT | — |