Color Filter
Strip 'black and white' out of your auto-generated captions
- filtered_text
Specific little problem, and if you've hit it you'll know exactly why this node exists: run an image through Florence-2 or WD14 Tagger to get an auto-caption, and every so often the model describes a perfectly normal color photo as "black and white" or "monochrome" - because the lighting was moody, or the subject wore grayscale clothing, or the captioner just misread the scene. Feed that caption straight into a text-to-image prompt and you've just told your sampler to desaturate the whole output, which is not what you wanted and is genuinely annoying to debug the first time it happens because nothing about your workflow looks broken.
Color Filter is a plain text-cleanup node that solves exactly that: pass it a caption string and it strips out color-related wording before the text goes anywhere near your prompt assembly. Nothing in it touches images - it's regex-based text filtering, full stop.
Two inputs. text is the multiline string you pipe in - typically straight from a captioning node's output. exclude_words is an optional single-line field where you list any extra words or phrases you want stripped, separated by commas or newlines; it starts empty, and whatever you put there gets matched and removed before the built-in patterns run, so custom terms take priority. Matching is case-insensitive and word-boundary aware for the common English terms (so it won't accidentally chew through a word that happens to contain "grayscale" as a substring), and your custom exclude words get their special regex characters escaped automatically so a stray parenthesis in your word list won't blow up the match. The single output is filtered_text - same string, minus the matched wording, with runs of whitespace (including any newlines the removal left behind) collapsed down to single spaces so you don't end up with double-spaced gaps in your prompt.
Where it goes in a graph: right after your captioning node (Florence-2, WD14 Tagger, whatever you're using) and before whatever assembles or displays the final prompt string. It lives under Text/Filter in the node menu, so if you're hunting for it that's where to look rather than under LoRA or FLUX.
Installing it: bundled with the whole pack, nothing extra to set up - through ComfyUI Manager, search "ComfyUI-NunchakuFluxLoraStacker," or:
cd ComfyUI/custom_nodes
git clone https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker.git
Restart ComfyUI.
A few honest caveats rather than invented failure modes: this node only catches what its pattern list and your exclude_words actually cover, so a captioner that phrases the same idea unusually ("desaturated," "no color present," "sepia-toned") will sail straight through untouched - if you're seeing washed-out results after using this node, check the raw caption text first rather than assuming the filter is broken; it's very likely just a phrasing the pattern set doesn't know about, and that's exactly what exclude_words is for. It's also a one-way strip, not a smart rewrite - removing "black and white photo of" from the front of a caption can leave an awkward leading fragment, which is harmless for prompt purposes but can look odd if you're displaying the filtered text somewhere a human reads it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| exclude_words | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| filtered_text | STRING | — |