Nodes/ComfyUI-Miaoshouai-Tagger/🐾MiaoshouAI Caption Analyzer (Beta)
ComfyUI Node

🐾MiaoshouAI Caption Analyzer (Beta)

Pick the fields you want out of a wall of caption

By miaoshouai·Created 2 years ago·Updated about a year ago· 525
🐾MiaoshouAI Caption Analyzer (Beta)
    • selected analyze
    analyze
    subject_index0
    camera_anglefalse
    art_stylefalse
    locationfalse
    textfalse
    distance_to_camerafalse
    backgroundfalse
    position_in_imagefalse
    genderfalse
    agefalse
    hair_stylefalse
    hair_colorfalse
    facial_expressionfalse
    eye_directionfalse
    facing_directionfalse
    racefalse
    earfalse
    expressionfalse
    bodyfalse
    accessoryfalse
    pantsfalse
    clothingfalse
    shoesfalse
    actionfalse

    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.

    CategoryMiaoshouAI Tagger

    Inputs (25)

    NameTypeDefaultDescription
    analyzeSTRING
    subject_indexINT00–2
    camera_angleBOOLEANfalse
    art_styleBOOLEANfalse
    locationBOOLEANfalse
    textBOOLEANfalse
    distance_to_cameraBOOLEANfalse
    backgroundBOOLEANfalse
    position_in_imageBOOLEANfalse
    genderBOOLEANfalse
    ageBOOLEANfalse
    hair_styleBOOLEANfalse
    hair_colorBOOLEANfalse
    facial_expressionBOOLEANfalse
    eye_directionBOOLEANfalse
    facing_directionBOOLEANfalse
    raceBOOLEANfalse
    earBOOLEANfalse
    expressionBOOLEANfalse
    bodyBOOLEANfalse
    accessoryBOOLEANfalse
    pantsBOOLEANfalse
    clothingBOOLEANfalse
    shoesBOOLEANfalse
    actionBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    selected analyzeSTRING