Nodes/🍖FetchMe/🍖Fetch Filter
ComfyUI Node

🍖Fetch Filter

Strip 'anime' and 'cartoon' out of a live prompt before it hits the sampler

By vladgohn·Created 5 months ago·Updated 5 months ago· 0
🍖Fetch Filter
  • codex_1
  • codex_2
  • codex_3
  • codex_4
  • codex_5
  • text
text

The workflow it exists for

If you've been around r/comfyui for a week, you've seen it: a vision model describes your image, that description gets reused as the prompt for a generation, and the result comes out "anime"-flavored when you wanted photographic. 🍖Fetch Filter is the valve between the two. Feed it text plus one or more codex dictionaries, and it rewrites the text on the fly before it ever reaches the text encoder.

It's genuinely useful and a little addictive once it's set up: the captioning model keeps churning out "digital art, soft shading", and the filter keeps turning that into "photography, natural skin texture" without you touching anything.

How it works

fetch_filter.py does two things, in order:

  1. Merges up to five codex dictionaries into one - later codexes win if two define the same key.
  2. For every key, does a case-insensitive replacement of that key with its value in the input text.

The replacement uses re.IGNORECASE, so matching is forgiving: anime catches ANIME and Anime, and multi-word keys like digital art work as a phrase. But it's substring-based, which cuts both ways. It's permissive - anime will also hit inside animecore or anime style - so keep keys short and specific rather than broad.

One ordering trap worth knowing: replacements apply sequentially. If you map cartoon → photo and also map photo → photograph, the output is photograph, because the first replacement's result gets re-replaced by the later rule. Keep your replacement values free of anything you're also replacing and you'll never feel it.

Inputs and output

  • text - required, and here's the gotcha: it's marked forceInput, meaning you can't type in it. You have to wire text in from upstream - the output of your vision/LLM node, or a text node from another pack if you want a typeable box.
  • codex_1codex_5 - the dictionaries from Fetch Codex. Leave unused ones disconnected; empty inputs are skipped.
  • Output: text (STRING), which you wire straight into a CLIP Text Encode positive or wherever your prompt string goes.

The pack's JS relabels the five codex inputs as codex_I through codex_V and paints both FetchMe nodes its trademark purple - small touches, but they make a busy graph readable.

Installing it

The FetchMe pack is pure Python with no requirements.txt and no model downloads. Install once via ComfyUI Manager (search "FetchMe"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/vladgohn/ComfyUI-FetchMe.git

Restart ComfyUI, then Add Node → FetchMe/Text🍖Fetch Filter. If you're here you also want 🍖Fetch Codex - the filter is only as useful as the dictionaries you feed it, and the two are designed as a pair.

Troubleshooting

  • Nothing changes. Check that text is actually wired (it's forceInput - an empty field isn't a bug, it's the UI telling you to plug something in), and that at least one codex_X is connected.
  • A word you expect to be replaced isn't. Matching is substring + case-insensitive, so it's hard to miss with. Re-check the exact spelling of the codex key - spaces and punctuation count, and a trailing space in a key means a miss.
  • Matching too much. Substring replacement means short keys over-match. A key of art will replace the middle of party and starter as easily as digital art. Use longer, specific keys.

That last one is the real takeaway: FetchMe is a text filter, not a tokenizer. For quick, opinionated prompt cleanup between a captioning model and the sampler, it's the smallest thing that works - and it needs nothing installed but itself.

CategoryFetchMe/Text

Inputs (6)

NameTypeDefaultDescription
textSTRING
codex_1optDICT
codex_2optDICT
codex_3optDICT
codex_4optDICT
codex_5optDICT

Outputs (1)

NameTypeDescription
textSTRING