Nodes/🍖FetchMe/🍖Fetch Codex
ComfyUI Node

🍖Fetch Codex

The lookup table that cleans up LLM prompts

By vladgohn·Created 6 months ago·Updated 5 months ago· 0
🍖Fetch Codex
    • codex
    â—„valueâ–ş
    â—„key_1â–ş
    â—„key_2â–ş
    â—„key_3â–ş
    â—„key_4â–ş
    â—„key_5â–ş
    â—„key_6â–ş
    â—„key_7â–ş
    â—„key_8â–ş
    â—„key_9â–ş
    â—„key_10â–ş
    â—„key_11â–ş
    â—„key_12â–ş
    â—„key_13â–ş
    â—„key_14â–ş
    â—„key_15â–ş
    â—„key_16â–ş
    â—„key_17â–ş
    â—„key_18â–ş
    â—„key_19â–ş
    â—„key_20â–ş
    â—„key_21â–ş
    â—„key_22â–ş
    â—„key_23â–ş
    â—„key_24â–ş
    â—„key_25â–ş
    â—„key_26â–ş
    â—„key_27â–ş
    â—„key_28â–ş
    â—„key_29â–ş
    â—„key_30â–ş
    â—„key_31â–ş
    â—„key_32â–ş
    â—„key_33â–ş
    â—„key_34â–ş
    â—„key_35â–ş
    â—„key_36â–ş
    â—„key_37â–ş
    â—„key_38â–ş
    â—„key_39â–ş
    â—„key_40â–ş
    â—„key_41â–ş
    â—„key_42â–ş
    â—„key_43â–ş
    â—„key_44â–ş
    â—„key_45â–ş
    â—„key_46â–ş
    â—„key_47â–ş
    â—„key_48â–ş
    â—„key_49â–ş
    â—„key_50â–ş
    â—„key_51â–ş
    â—„key_52â–ş
    â—„key_53â–ş
    â—„key_54â–ş
    â—„key_55â–ş
    â—„key_56â–ş
    â—„key_57â–ş
    â—„key_58â–ş
    â—„key_59â–ş
    â—„key_60â–ş
    â—„key_61â–ş
    â—„key_62â–ş
    â—„key_63â–ş
    â—„key_64â–ş

    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 codex output is a custom DICT type, so it only plugs into inputs that accept a DICT - in practice, the codex_X inputs 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_1 through key_64 - the tokens to catch. Only key_1 and key_2 are 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's codex_1…codex_5 inputs. 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.
    CategoryFetchMe/Text

    Inputs (65)

    NameTypeDefaultDescription
    valueSTRING—
    key_1STRING—
    key_2STRING—
    key_3optSTRING—
    key_4optSTRING—
    key_5optSTRING—
    key_6optSTRING—
    key_7optSTRING—
    key_8optSTRING—
    key_9optSTRING—
    key_10optSTRING—
    key_11optSTRING—
    key_12optSTRING—
    key_13optSTRING—
    key_14optSTRING—
    key_15optSTRING—
    key_16optSTRING—
    key_17optSTRING—
    key_18optSTRING—
    key_19optSTRING—
    key_20optSTRING—
    key_21optSTRING—
    key_22optSTRING—
    key_23optSTRING—
    key_24optSTRING—
    key_25optSTRING—
    key_26optSTRING—
    key_27optSTRING—
    key_28optSTRING—
    key_29optSTRING—
    key_30optSTRING—
    key_31optSTRING—
    key_32optSTRING—
    key_33optSTRING—
    key_34optSTRING—
    key_35optSTRING—
    key_36optSTRING—
    key_37optSTRING—
    key_38optSTRING—
    key_39optSTRING—
    key_40optSTRING—
    key_41optSTRING—
    key_42optSTRING—
    key_43optSTRING—
    key_44optSTRING—
    key_45optSTRING—
    key_46optSTRING—
    key_47optSTRING—
    key_48optSTRING—
    key_49optSTRING—
    key_50optSTRING—
    key_51optSTRING—
    key_52optSTRING—
    key_53optSTRING—
    key_54optSTRING—
    key_55optSTRING—
    key_56optSTRING—
    key_57optSTRING—
    key_58optSTRING—
    key_59optSTRING—
    key_60optSTRING—
    key_61optSTRING—
    key_62optSTRING—
    key_63optSTRING—
    key_64optSTRING—

    Outputs (1)

    NameTypeDescription
    codexDICT—