Nodes/🍖FetchMe/🍖Fetch Codex
ComfyUI Node

🍖Fetch Codex

The lookup table that cleans up LLM prompts

By vladgohn·Created 5 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_1codex_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