🍖Fetch Codex
The lookup table that cleans up LLM prompts
- codex
The two-word version
Your vision model just described your input image, and the caption is full of words you don't want in the final render - "anime", "cartoon", "digital art", "3d render". You want a photo. 🍖Fetch Codex is the node that maps all of those unwanted words to one good phrase so a node downstream can swap them out live. It's the lookup-table half of the FetchMe pair; its sibling Fetch Filter does the actual replacing.
What it does
Fetch Codex builds a dictionary where every filled key points to the same value. You type one replacement text into value, list the tokens you want caught in key_1 through key_64, and out comes a codex object ready to feed a filter. So value = "photo, realistic, detailed skin" with key_1 = "anime" and key_2 = "cartoon" produces a dictionary mapping both anime and cartoon to that one photo phrase.
The "one value for every key" shape is the point, not a limitation. It covers 90% of prompt-cleanup cases, where a pile of style markers all deserve the same replacement. Need different replacements for different words? Make two Codex nodes and merge them downstream - the filter accepts up to five dictionaries.
How it works
Open fetch_codex.py and it's twenty lines of stdlib. Each key gets stripped of whitespace, skipped if empty, then assigned the replacement value. No dependencies, no model files, no hidden behavior. This pack is pure Python with no requirements.txt - genuinely rare in the ComfyUI ecosystem, where half your installs these days are dependency-juggling.
Two things the UI does that the schema doesn't advertise:
- The
codexoutput is a customDICTtype, so it only plugs into inputs that accept aDICT- in practice, thecodex_Xinputs on Fetch Filter. You can't wire it into a plain STRING slot. - The pack's JS (
js/fetch_theme.js) makes the key fields dynamic: empty key boxes hide themselves as you work, so the node never looks like the 64-input monster it technically is. Type a key, and another blank appears below it.
The inputs that matter
value- the replacement text. The only field that actually holds content; it gets applied to every key.key_1throughkey_64- the tokens to catch. Onlykey_1andkey_2are technically required; the other 62 are optional and can stay empty.
That's the whole thing. One output: codex.
Installing it
The FetchMe pack downloads nothing and needs nothing, which makes it one of the fastest installs you'll do. Through ComfyUI Manager, search "FetchMe", or:
cd ComfyUI/custom_nodes
git clone https://github.com/vladgohn/ComfyUI-FetchMe.git
Restart ComfyUI, then right-click → Add Node → FetchMe/Text → 🍖Fetch Codex. The author, vladgohn, keeps things small - his other pack MurMur is a one-purpose node-coloring tool - and FetchMe follows the pattern: two nodes, no bloat.
Gotchas
- Because the output is
DICT, the codex only goes into Fetch Filter'scodex_1…codex_5inputs. If you're not using Filter, this node is pointless on its own. - Case-insensitive matching happens at the filter stage, not here - here you're just building data.
- Keys are stored exactly as typed, so watch trailing spaces; the filter matches substring, and a stray space is a miss you'll chase for a while.
Inputs (65)
| Name | Type | Default | Description |
|---|---|---|---|
| value | STRING | — | |
| key_1 | STRING | — | |
| key_2 | STRING | — | |
| key_3opt | STRING | — | |
| key_4opt | STRING | — | |
| key_5opt | STRING | — | |
| key_6opt | STRING | — | |
| key_7opt | STRING | — | |
| key_8opt | STRING | — | |
| key_9opt | STRING | — | |
| key_10opt | STRING | — | |
| key_11opt | STRING | — | |
| key_12opt | STRING | — | |
| key_13opt | STRING | — | |
| key_14opt | STRING | — | |
| key_15opt | STRING | — | |
| key_16opt | STRING | — | |
| key_17opt | STRING | — | |
| key_18opt | STRING | — | |
| key_19opt | STRING | — | |
| key_20opt | STRING | — | |
| key_21opt | STRING | — | |
| key_22opt | STRING | — | |
| key_23opt | STRING | — | |
| key_24opt | STRING | — | |
| key_25opt | STRING | — | |
| key_26opt | STRING | — | |
| key_27opt | STRING | — | |
| key_28opt | STRING | — | |
| key_29opt | STRING | — | |
| key_30opt | STRING | — | |
| key_31opt | STRING | — | |
| key_32opt | STRING | — | |
| key_33opt | STRING | — | |
| key_34opt | STRING | — | |
| key_35opt | STRING | — | |
| key_36opt | STRING | — | |
| key_37opt | STRING | — | |
| key_38opt | STRING | — | |
| key_39opt | STRING | — | |
| key_40opt | STRING | — | |
| key_41opt | STRING | — | |
| key_42opt | STRING | — | |
| key_43opt | STRING | — | |
| key_44opt | STRING | — | |
| key_45opt | STRING | — | |
| key_46opt | STRING | — | |
| key_47opt | STRING | — | |
| key_48opt | STRING | — | |
| key_49opt | STRING | — | |
| key_50opt | STRING | — | |
| key_51opt | STRING | — | |
| key_52opt | STRING | — | |
| key_53opt | STRING | — | |
| key_54opt | STRING | — | |
| key_55opt | STRING | — | |
| key_56opt | STRING | — | |
| key_57opt | STRING | — | |
| key_58opt | STRING | — | |
| key_59opt | STRING | — | |
| key_60opt | STRING | — | |
| key_61opt | STRING | — | |
| key_62opt | STRING | — | |
| key_63opt | STRING | — | |
| key_64opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| codex | DICT | — |