Nodes/Frog Node Pack/🐸 Tag Filter
ComfyUI Node

🐸 Tag Filter

Combine Florence2 captions and WD14 tags, then strip the stuff you don't want in the prompt

By RabbitThatIsPinkΒ·Created 3 months agoΒ·Updated 24 days agoΒ· 1
🐸 Tag Filter
  • toggle_pack
  • filtered
  • removed
  • removed_count
β—„excludeβ–Ί
β—„florence2β€”β–Ί
β—„wd14β€”β–Ί

Automatic captioning is a gift that keeps on giving unwanted words. If you feed a Florence2 caption or a WD14 tagger output straight into your prompt, you get exactly what the tagger saw - including the watermark text, the artist handle, the "dark elf" descriptor that fights your character, and the expression you don't want. 🐸 Tag Filter is the pack's answer: it takes a Florence2 natural-language caption and/or a WD14 tag string, strips what you tell it to strip, and outputs a clean merged prompt.

The design is deliberately dual-input because that matches how captioning actually works in these workflows. WD14 gives you dense, comma-separated Gelbooru-style tags - precise, but noisy. Florence2 gives you a natural-language sentence - readable, but it tends to describe everything including visible text, signs, and character traits. The filter handles each in its own way and merges them: the WD14 tag string is placed after the Florence2 caption, and the Florence2 sentence gets character-trait and clothing phrases stripped from within it while scene/environment content survives.

Both inputs are optional - wire whichever taggers you actually run, or both. florence2 and wd14 feed in, filtered comes out, and there are two bonus outputs: removed (the exact list of what got cut) and removed_count (an integer). Those two are genuinely useful for debugging - when a prompt looks gutted, removed shows you everything the filter ate, and you can see whether it over-matched.

The manual exclude input (required, multiline) is the star control, and its syntax is worth learning because it's more powerful than a plain word list:

  • rating:* removes every tag starting with rating:
  • *background* removes any tag containing "background"
  • nude removes only the exact tag nude

Matching is case-insensitive and treats underscores as spaces. One entry per line, or comma-separated. That wildcard syntax is the difference between "I remove one tag" and "I remove every tag in a family," which is what you want when WD14 emits rating:safe, rating:explicit, and a dozen variants.

Then there's the optional toggle_pack input, typed TAG_FILTER_TOGGLES, which unlocks category-level filtering. The pack's 🐸 Frog Exclude Toggle bundles switches for character_traits (hair/eye colour, skin tone, body descriptors), expressions, clothes, fantasy_traits (ears, tails, horns, wings), furry, and overlay_text (Florence2's descriptions of visible text). The natural-language stripper uses these to prune character-describing phrases out of Florence2 sentences while leaving the scene intact - a different job from the exact-tag exclude list, and the two stack.

Where this fits in the pack: it's the cleanup stage between your taggers and the prompt assembler (🐸 Prompt Processor or the older Merge chain). The pack also ships 🐸 Vocab Extender to grow the built-in word lists persistently, so words you always want gone don't have to be re-typed into every workflow's exclude box.

Installing it

Part of Frog Node Pack:

  • ComfyUI Manager: search Frog Node Pack, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/RabbitThatIsPink/FrogNodePack, restart, hard-refresh (Ctrl+Shift+R).

No pip dependencies - requirements.txt is empty; Pillow ships with ComfyUI. Find 🐸 Tag Filter under 🐸 Node Pack/Utility.

Common issues

The most common mistake is thinking the toggle categories work like the exclude list - they don't. exclude is exact/wildcard matching on tags; the toggle categories drive the Florence2 natural-language stripper. If you wired a Toggle Pack but set your filter words in exclude, you're running two different filtering modes and they don't share vocab. Second: over-filtering - check removed/removed_count when output looks empty; a wildcard like *light* will eat lighting, highlights, and streetlight in one go. And remember the filter only cleans what reaches it: if Florence2 text is coming through unfiltered, check the florence2 input is actually wired here and not straight to the encoder.

Category🐸 Node Pack/Utility

Inputs (4)

NameTypeDefaultDescription
excludeSTRINGTags / phrases to remove before the string reaches the prompt. One entry per line β€” or comma-separated on one line. Wildcards supported: rating:* removes every tag starting with 'rating:' *background* removes any tag containing 'background' nude removes only the exact tag 'nude' Matching is case-insensitive; underscores == spaces.
florence2optSTRINGNatural-language caption from Florence2. Character-trait and clothing phrases are stripped from within the sentence before it is passed through.
wd14optSTRINGGelbooru-style comma-separated tags from WD14. Placed after Florence2.
toggle_packoptTAG_FILTER_TOGGLESOptional 🐸 Filter Toggle Pack β€” enables category-level filtering.

Outputs (3)

NameTypeDescription
filteredSTRINGβ€”
removedSTRINGβ€”
removed_countINTβ€”