Nodes/ComfyUI-PromptConverter/Prompt Converter with Filter
ComfyUI Node

Prompt Converter with Filter

Strip the Boilerplate and Keep the Tags You Took Out

By vkff5833·Created 2 years ago·Updated 2 years ago· 3
Prompt Converter with Filter
    • novelai3
    • ponyxl
    • animagine3.1
    • illustrious
    • animagine4.0
    • filtered
    text
    ratingsafe
    uniquetrue
    auto_quality_tagstrue
    remove_weightsfalse
    filter_generalfalse
    filter_stylefalse
    filter_genrefalse
    filter_characterfalse
    filter_otherfalse
    filter_unknownfalse
    filter_personfalse
    filter_scorefalse
    filter_qualityfalse
    filter_ratingfalse
    filter_generationfalse

    The base Prompt Converter is great at one thing: turning a tag prompt into five model-specific strings. But sometimes you don't want all the tags. Feed a converted prompt into a negative prompt and the auto-stamped quality tags (masterpiece, best_quality, Pony's score_9 opener) pollute it. Or you want every rating tag stripped because you're handling the NSFW dial yourself. That's what this node adds: eleven category filter toggles and a sixth output that hands you back everything you filtered out.

    What it adds

    Prompt Converter with Filter is the same converter with a surgical extra. You get the identical five outputs - novelai3, ponyxl, animagine3.1, illustrious, animagine4.0 - plus filtered, a STRING containing the tags you removed. And its inputs grow from five booleans to sixteen: the usual text, rating, unique, auto_quality_tags, and remove_weights, then one toggle per tag category.

    It works by subclassing the base node and hijacking the sort step. While it's looking each tag up in the 21 MB tag_dict.json to figure out its category for ordering, it also checks that category against your filter flags. Matches get pulled out of every model output and collected into one list, which comes back in the filtered output - deduped and sorted, comma-separated. When every filter is off it behaves exactly like the plain node, so nothing changes until you flip something.

    The categories map to the Danbooru taxonomy plus a few node-internal groups:

    • filter_general, filter_style, filter_genre, filter_character, filter_other - the standard board categories.
    • filter_unknown - tags the dictionary doesn't recognize. Nice for auditing junk in a scraped prompt.
    • filter_person, filter_score, filter_quality, filter_rating, filter_generation - the converter's own groupings: person/count tags, Pony's score_* family, quality tags like masterpiece and best_quality, rating tags, and era tags (newest / late / mid / early / oldest).

    The one trick worth building a workflow around

    That filtered output is genuinely useful, not just a dumping ground. Two examples:

    • Split SFW/NSFW. Set rating to safe and turn on filter_rating, and the removed general / nsfw / rating_explicit markers land in filtered. Run the safe output through one sampler, wire filtered into a second CLIPTextEncode for an explicit pass. One prompt, both dials.
    • Keep characters separate. Turn on filter_character to strip every character tag from the main prompt and collect them in one string - handy when you want character identity steered by its own LoRA or its own CLIP branch instead of buried in the tag soup.

    Installing it

    Same pack as the base node - one clone installs both, so if you have Prompt Converter, this is already in your node list. If not:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vkff5833/ComfyUI-PromptConverter
    

    Restart ComfyUI and look for "Prompt Converter with Filter". No model downloads. The README mentions pip install -r requirements.txt, but that file doesn't exist in the repo and the node is pure standard-library Python - skip the pip step. Do expect a ~25 MB clone; almost all of it is the tag dictionary the filtering depends on.

    Gotchas

    Same ones as the base node, plus one filter-specific trap: the filtered output is just removed tags joined with commas. It's meant to be read or re-fed as a string, not further structured - don't expect a second set of categorized outputs. And remember the related-tag search in the UI calls Danbooru's public API over the network, so a silent search failure doesn't mean the conversion or filtering broke. Everything local runs offline, happily.

    Categorysd

    Inputs (16)

    NameTypeDefaultDescription
    textSTRING
    ratingCOMBOsafe4 options: safe, sensitive, questionable, explicit
    uniqueBOOLEANtrue
    auto_quality_tagsBOOLEANtrue
    remove_weightsBOOLEANfalse
    filter_generalBOOLEANfalse
    filter_styleBOOLEANfalse
    filter_genreBOOLEANfalse
    filter_characterBOOLEANfalse
    filter_otherBOOLEANfalse
    filter_unknownBOOLEANfalse
    filter_personBOOLEANfalse
    filter_scoreBOOLEANfalse
    filter_qualityBOOLEANfalse
    filter_ratingBOOLEANfalse
    filter_generationBOOLEANfalse

    Outputs (6)

    NameTypeDescription
    novelai3STRING
    ponyxlSTRING
    animagine3.1STRING
    illustriousSTRING
    animagine4.0STRING
    filteredSTRING