Nodes/comfyui_tag_filter/TagCategoryEnhance
ComfyUI Node

TagCategoryEnhance

Boost every tag in a category at once, without listing them

By sugarkwork·Created 2 years ago·Updated 6 months ago· 87
TagCategoryEnhance
    • result
    tags
    enhance_category
    strength1.20
    add_strengthfalse

    TagCategoryEnhance is TagEnhance's lazier, broader cousin. TagEnhance makes you type the exact tags you want to weight; this one lets you name a category and it boosts every tag in that category. Want to push all your expression tags harder without typing each one? enhance_category: expression. Want everything about hair to count double? enhance_category: hair.

    Same underlying idea as the whole pack: tags get looked up in the bundled tag_category*.json files, and the category list attached to each tag decides what "counts." So smile (category expression), grin (also expression), and angry all get hit by one field. You're writing one word where TagEnhance would need a comma list of twenty.

    The inputs

    • tags - your tag string, comma-separated, emphasis allowed.
    • enhance_category - comma-separated category names. Multiple categories work; a tag that belongs to any of them gets boosted.
    • strength - here's the interesting bit: this node's range is -5.0 to 5.0, unlike TagEnhance's 0.0 to 5.0. The negative side is the whole point of using this node over its sibling - you can push a whole category down toward irrelevance, which reads as a (tag:0.7)-style de-emphasis in the output.
    • add_strength - False replaces each tag's weight with strength; True adds strength to whatever weight was already there.

    So strength: 0.6, add_strength: false rewrites every matching tag to (tag:0.6), and strength: -0.4, add_strength: true shaves 0.4 off everything in the category while leaving others untouched.

    The one real gotcha

    It's only as good as the category file's bucketing, and the category files are AI-sorted and imperfect - the author says so in the README. A tag that should be in your category but got misclassified will dodge the boost, and there's no error to tell you. Also, "everything in this category" is a blunt instrument: with add_strength on, a tag that already carries a heavy weight like (smile:1.8) gets piled onto, which can overshoot in a way you'll spot in the output before you notice the node settings.

    Match those expectations: category names are case-insensitive and spaces become underscores (hair stylehair_style). If you're not sure a category name is real, open tag_category_v3.json and grep.

    Install

    Identical to the rest of the pack - no model downloads, no dependencies, requirements.txt is empty. Via ComfyUI Manager search "comfyui_tag_filter", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sugarkwork/comfyui_tag_fillter
    

    Restart, find it under text, wire result into your prompt builder. If you instead need to weight one specific tag - or strip all emphasis cleanly - that's the job TagEnhance was built for; the two sit side by side in the menu for a reason.

    Categorytext

    Inputs (4)

    NameTypeDefaultDescription
    tagsSTRING
    enhance_categorySTRING
    strengthFLOAT1.20-5–5
    add_strengthBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    resultSTRING