Nodes/ComfyUI Seed Wildcard Pack/Danbooru Text Categorizer (Anima)
ComfyUI Node

Danbooru Text Categorizer (Anima)

Turn one messy prompt into Anima's three blocks

By sinanzoo2nd·Created 8 months ago·Updated 3 months ago· 0
Danbooru Text Categorizer (Anima)
    • ARTIST_PROMPT
    • CHARACTER_PROMPT
    • BACKGROUND_PROMPT
    • ALL_RAW_TAGS
    text(1girl:1.2), red eyes, touhou \(project\)
    artisttrue
    charactertrue
    copyrighttrue
    persontrue
    species_traitstrue
    bodytrue
    facetrue
    hairtrue
    appearancetrue
    clothingtrue
    accessorytrue
    state_emotiontrue
    posetrue
    actiontrue
    camera_compositiontrue
    backgroundtrue
    environmenttrue
    uncategorizedfalse

    Anima is the rare anime model that rewards organized prompts - the model card gives a specific tag order - and if you've ever pasted a 200-tag Danbooru prompt into it, you know "organization" is not what you had. DanbooruTextCategorizer (Anima) is the cleanup crew: it takes one blob of comma-separated booru tags, sorts each tag into a category, and reassembles them into the three prompt blocks Anima actually likes to read.

    Why you'd reach for it

    This is an Anima-specific node from the ComfyUI Seed Wildcard Pack, and it only makes sense in that context. Anima's own card recommends structuring a prompt as [character] [series] [artist] [general tags], and the community has found that keeping artist, character, and background material in their own sections behaves better than a shuffled soup. In practice, most people just say "give me something by X" with artist tags, and - per the whole Anima ecosystem vibe - artist tags are one of the most powerful levers the model has.

    This node automates the split. Paste your jumbled tag list, get out:

    • ARTIST_PROMPT - just the artist tags
    • CHARACTER_PROMPT - character, copyright/series, species, body, face, hair, appearance, clothing, accessories, emotion, pose, action - everything that describes the subject
    • BACKGROUND_PROMPT - camera & composition, background, environment
    • ALL_RAW_TAGS - the full original set, in case you want the unorganized version too

    How it works

    The node ships with a tag_category.json mapping roughly 37,000 tags to categories - that's the lookup table, no API, no network, all local. Execution is three steps.

    First, a smart splitter breaks the text into tags while respecting parentheses: commas inside (1girl:1.2), (touhou (project)) don't split the tag. Escaped \( parens are left alone. Second, each tag is normalized and looked up in the category file. Tags like long_hair land in "hair", looking_at_viewer in "pose", 1girl in "person". Anything unknown falls into "uncategorized" - which is off by default, so unknown tags silently drop out of the organized outputs unless you flip that toggle.

    Third, the outputs are built in a fixed category order per block, keeping your original tag text (weights, parens, all) intact. The block structure mirrors Anima's recommended ordering, which is the whole point: you feed CHARACTER_PROMPT and ARTIST_PROMPT into your positive prompt in the order that matches the model's training.

    The inputs that matter

    • text - your multiline blob of tags. The default sample ((1girl:1.2), red eyes, touhou \(project\)) shows off the parser handling weights and escaped parens
    • The eighteen category toggles, all defaulting to on - artist, character, copyright, person, species_traits, body, face, hair, appearance, clothing, accessory, state_emotion, pose, action, camera_composition, background, environment, and uncategorized (the only one off by default)

    Flip off the categories you don't want in the output - say, drop clothing and accessory if you're doing character studies - and the node rebuilds the blocks without them.

    The honest caveat

    The categorizer is only as good as its 37k-tag table, and it's a snapshot - newer or niche tags will fall into "uncategorized" and vanish from the organized outputs unless you turn that toggle on. Also, this splits your prompt; it doesn't invent better tags. If your source text is already well-formed, this mostly rearranges furniture. Where it genuinely shines is taming prompts you pulled from a generation site or an LLM that emits one giant comma line.

    Install

    Part of the ComfyUI Seed Wildcard Pack - ComfyUI Manager (search Seed Wildcard) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sinanzoo2nd/ComfyUI-Seed-Wildcard-Pack
    

    then restart. The pack has no requirements.txt and no model downloads; the 37k-tag table ships inside the repo. You will, however, want the Anima checkpoint itself on disk, because the outputs only make sense feeding a prompt to Anima. And if you're not using Anima, this node is solving a problem you don't have.

    CategoryAnima/Text

    Inputs (19)

    NameTypeDefaultDescription
    textSTRING(1girl:1.2), red eyes, touhou \(project\)
    artistBOOLEANtrue
    characterBOOLEANtrue
    copyrightBOOLEANtrue
    personBOOLEANtrue
    species_traitsBOOLEANtrue
    bodyBOOLEANtrue
    faceBOOLEANtrue
    hairBOOLEANtrue
    appearanceBOOLEANtrue
    clothingBOOLEANtrue
    accessoryBOOLEANtrue
    state_emotionBOOLEANtrue
    poseBOOLEANtrue
    actionBOOLEANtrue
    camera_compositionBOOLEANtrue
    backgroundBOOLEANtrue
    environmentBOOLEANtrue
    uncategorizedBOOLEANfalse

    Outputs (4)

    NameTypeDescription
    ARTIST_PROMPTSTRING
    CHARACTER_PROMPTSTRING
    BACKGROUND_PROMPTSTRING
    ALL_RAW_TAGSSTRING