🐾MiaoshouAI Caption Analyzer (Beta)
Pick the fields you want out of a wall of caption
- selected analyze
Set the Tagger node's caption_method to analyze and you don't get a tidy sentence back - you get Florence-2's structured breakdown, a dense block that tries to cover every subject in the image across dozens of attributes at once: hair, clothing, camera angle, background, what they're doing, where they're standing. That's genuinely useful information, but it's not something you want to dump wholesale into a training caption or a prompt. Caption Analyzer is the filter step: it takes that structured text and lets you cherry-pick exactly the fields you care about, subject by subject.
How it works
This node doesn't caption anything itself - it parses. Feed it the structured analyze-mode text (from the Tagger node's analyze output, or the analyze output on the Flux Clip Text Encode node if that's earlier in your chain), and it pulls out only the attributes you've flipped on, for one specific detected subject. Florence-2's structured mode can identify multiple subjects in a single image, which is why subject_index exists - 0, 1, or 2, selecting which detected person or object you're filtering data for. Run the same analyze text through this node twice with different subject indices if you need separate captions per subject in a multi-person image.
Everything else is a straightforward on/off checklist. Toggle the ones relevant to what you're building:
- Physical description:
hair_style,hair_color,facial_expression,eye_direction,facing_direction,race,ear,expression,body,gender,age - Clothing and accessories:
clothing,accessory,pants,shoes - Scene and framing:
camera_angle,distance_to_camera,position_in_image,background,location,art_style,text - Behavior:
action
Every one of them defaults to false, so an untouched node produces basically nothing - you have to deliberately opt in to each field you want, which is the point. It keeps you from accidentally training on the entire structured dump when you only meant to isolate, say, hairstyle and clothing.
The output
One string: selected analyze, containing only the attributes you enabled for the chosen subject_index. Wire it wherever a caption string is expected - into Miaoshouai SaveTags to write it out as a training caption, or downstream into a prompt-building chain if you're using it to extract structured facts from a reference image rather than for dataset captioning.
How to install it
It ships in the same pack as the Tagger and the Flux encode node - install once, get all four. ComfyUI Manager: search "ComfyUI-Miaoshouai-Tagger", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/miaoshouai/ComfyUI-Miaoshouai-Tagger
pip install -r ComfyUI-Miaoshouai-Tagger/requirements.txt
transformers 4.38.0 or newer is required across the pack.
Common issues & troubleshooting
Empty or nonsense output. The single most likely cause: the upstream analyze text didn't actually come from caption_method: analyze. This node expects Florence-2's structured multi-field format specifically - feed it a simple or tags-mode caption and there's nothing for it to parse against, so you'll get little or nothing back. Check the caption method on whatever node produced that string.
Nothing changes when you flip an attribute on. Confirm subject_index actually points at a subject Florence-2 detected in that image - if the structured caption only found one person and you're filtering subject_index: 1 or 2, there's no data at that index to pull from.
It's marked Beta for a reason. This is the newest node in the pack and the least battle-tested of the four - treat its output as a starting point to spot-check rather than something to pipe straight into a large unattended captioning batch without sampling the results first.
Inputs (25)
| Name | Type | Default | Description |
|---|---|---|---|
| analyze | STRING | — | |
| subject_index | INT | 00–2 | — |
| camera_angle | BOOLEAN | false | — |
| art_style | BOOLEAN | false | — |
| location | BOOLEAN | false | — |
| text | BOOLEAN | false | — |
| distance_to_camera | BOOLEAN | false | — |
| background | BOOLEAN | false | — |
| position_in_image | BOOLEAN | false | — |
| gender | BOOLEAN | false | — |
| age | BOOLEAN | false | — |
| hair_style | BOOLEAN | false | — |
| hair_color | BOOLEAN | false | — |
| facial_expression | BOOLEAN | false | — |
| eye_direction | BOOLEAN | false | — |
| facing_direction | BOOLEAN | false | — |
| race | BOOLEAN | false | — |
| ear | BOOLEAN | false | — |
| expression | BOOLEAN | false | — |
| body | BOOLEAN | false | — |
| accessory | BOOLEAN | false | — |
| pants | BOOLEAN | false | — |
| clothing | BOOLEAN | false | — |
| shoes | BOOLEAN | false | — |
| action | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| selected analyze | STRING | — |