Nodes/Raffle/Tag Category Strength (Raffle)
ComfyUI Node

Tag Category Strength (Raffle)

TagCategoryStrength is batch weight-editing for Danbooru prompts

By rainlizard·Created about a year ago·Updated 3 days ago· 40
Tag Category Strength (Raffle)
    • Adjusted tags
    • Debug info
    input_tags
    category_adjustments
    preserve_existing_weightstrue

    Editing prompt weights one tag at a time is fine when it's one tag. It's a drag when you realize all your artist tags are getting lost in the noise, or the meta tags are eating tokens a description could use. TagCategoryStrength lets you adjust whole families at once: give it (artist:1.4) and every artist tag in your prompt gets boosted; (meta:0.5) and the meta tags get halved. Batch weight-editing, in the format the pack already speaks.

    How it works: it splits your input into individual tags, looks each one up in the pack's bundled categorized_tags.txt (tens of thousands of tags mapped into categories like poses, clothes_and_accessories, artist, meta, and the rest), and whenever a tag's category matches one of your adjustments, it rewrites the tag with standard ComfyUI weighted syntax - (poses:1.2), (artist:1.4), and so on.

    The inputs:

    • input_tags - comma-separated tags. It's force-input, so you can wire it straight from another node - in practice, the Raffled output from this same pack.
    • category_adjustments - (category:strength) pairs, comma-separated, e.g. (artist:1.4), (meta:0.5), (poses:1.2).
    • preserve_existing_weights (default true) - if a tag already carries a weight like (tag:1.2), keep it instead of re-weighting. Turn it off if you want the category strength to multiply over existing weights.

    Outputs: Adjusted tags, which wires into a CLIP Text Encode, and Debug info, which tells you what category each tag landed in. That second output is more useful than it looks - it's how you'll discover a tag you thought was a pose is actually filed under clothes_and_accessories.

    Two gotchas:

    • Category names are validated hard. Mistype one in category_adjustments and the node raises an error listing every valid category. The Raffle node's Debug output shows the full list if you need it.
    • Weighted syntax is a CLIP-encoder thing. (tag:1.4) means something on Illustrious, NoobAI and Pony, and nothing on an LLM-encoded model, where weights are just literal punctuation passed through to the encoder. This node is for the SDXL anime family - which is, to be fair, exactly the family the whole pack targets.

    It's a small node with a small job, and it's the natural finishing move after a Raffle pick: roll a taglist, then push the parts you actually care about without hand-editing forty tags. Install is the pack, same as the others:

    cd ComfyUI/custom_nodes
    git clone https://github.com/rainlizard/ComfyUI-Raffle
    

    ...or "Raffle" in ComfyUI Manager. No extra dependencies.

    CategoryRaffle

    Inputs (3)

    NameTypeDefaultDescription
    input_tagsSTRINGInput tags to adjust (comma-separated)
    category_adjustmentsSTRINGCategory adjustments in format: (category_name:strength), e.g., (artist:1.4), (meta:0.5), (poses:1.2)
    preserve_existing_weightsoptBOOLEANtrueIf enabled, tags that already have weights like (tag:1.2) will keep their existing weights instead of being adjusted

    Outputs (2)

    NameTypeDescription
    Adjusted tagsSTRINGTags with category-based strength adjustments applied
    Debug infoSTRINGInformation about which tags were adjusted and their categories