ComfyUI Node

TagEnhance

Set or strip emphasis on matching tags — including the de-emphasize trick

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

    TagEnhance is the pack's emphasis editor. You hand it a tag string, tell it which tags to act on, and it rewrites the (tag:1.2)-style weights on just those tags - or strips the emphasis entirely. It's the tool you reach for when a WD14-tagged prompt has a few tags you want to push harder without rebuilding the whole string by hand.

    The mechanism is straightforward but worth understanding, because the pack's parser is doing real work here. ComfyUI's tag syntax allows both (tag:1.2) explicit weights and the older ((tag)) stacking shorthand, and this pack's parse_tags handles both - each becomes an internal weight. TagEnhance matches each incoming tag against your enhance_tags list and, for the ones that hit:

    • add_strength = False (default): sets the weight to strength, replacing whatever was there.
    • add_strength = True: adds strength to the existing weight, so a (tag:1.1) with strength 0.2 becomes 1.3.

    strength runs 0.0 to 5.0 in 0.05 steps, with 1.2 as the default - the canonical "boost this" value in anime prompting.

    The trick the README hides in plain sight

    Because the node sets weight when add_strength is off, you can use it as an emphasis-stripper. Feed the same string into both tags and enhance_tags, set strength to 1.0, leave add_strength off. Every tag now gets weight exactly 1.0, and since the pack only writes (tag:weight) when the weight isn't 1.0, the entire string comes out clean - no parentheses, no weights, no ((double)) shorthand. One node does what would otherwise be a fiddly regex cleanup.

    That's a genuinely handy trick if you're reusing someone else's heavily-weighted prompt and want to re-weight it from scratch, or normalizing tag output before feeding it to a model where you want raw tag presence and nothing else.

    What bites people

    Matching is exact and normalized - lowercase, spaces to underscores. enhance_tags: long hair won't match long_hair in your string. And it matches whole tags, not substrings: hair in enhance_tags matches the tag hair, not long_hair.

    The bigger trap: add_strength accumulates without a ceiling check in practice - the input widget clamps strength to 5.0, but adding 5.0 to an already-weighted tag can push it past the UI's max. ComfyUI handles out-of-range weights fine, but you can produce (tag:6.7) monsters without meaning to. If a tag suddenly dominates, that's usually why.

    Install

    Same as every node in this pack: ComfyUI Manager search "comfyui_tag_filter", or clone it:

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

    Restart. No dependencies, no model downloads - the only "data" is the category JSON files, which TagEnhance doesn't even need. If you want to hit a whole category of tags instead of a hand-typed list, that's what TagCategoryEnhance is for.

    Categorytext

    Inputs (4)

    NameTypeDefaultDescription
    tagsSTRING
    enhance_tagsSTRING
    strengthFLOAT1.200–5
    add_strengthBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    resultSTRING