Filter String - klinter
A safeword switch for anything
- STRING
Filter String - klinter is a weird little logic node with a very specific purpose: it checks whether one string appears in a list of words, and if it does, it swaps in a different word. Think of it as a "safeword" gate for strings. Feed it the output of some node, and if that output matches a word on your list, the node quietly substitutes your replacement before the value flows downstream.
The three inputs are in_question (the string being tested), wordlist (a space-separated list of words, one per line or space - it splits on whitespace), and safeword (what gets returned if there's a match). If in_question is found in the wordlist, the output is safeword; otherwise it passes in_question through unchanged. One STRING out, and that's all there is to it.
Where this actually shows up in the wild: filtering model outputs that might contain something you don't want to send to the sampler, or normalizing API responses. The pack's author built the JSON/string family around LLM-enhanced prompts, and this node slots into that pattern - you get a raw string from somewhere, and you want to neutralize specific tokens before they hit your prompt.
The traps are real, so read them once: matching is exact and case-sensitive against the whole token. The wordlist is split on whitespace, so wordlist = "sunset, ocean" is treated as the single token sunset, with a comma - put one word per line and no punctuation if you want matches. And it's a membership test, not a substring search: sun won't match sunset. If you need fuzzy or case-insensitive filtering, this isn't the tool.
Install follows the pack standard: search "Klinter_nodes" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/klinter007/klinter_nodes then restart. No requirements.txt, no dependencies beyond what ComfyUI already ships, and no model files. As with the rest of the pack, it uses the newer node API, so an up-to-date ComfyUI core is the one requirement that actually matters.
It's a one-trick node, but it's a genuinely useful trick for string-routing workflows - and it's dead simple to reason about, which counts for a lot when you're debugging at 2am.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| in_question | STRING | — | |
| wordlist | STRING | — | |
| safeword | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |