Nodes/SAX Bridge/SAX Text Catalog V2
ComfyUI Node

SAX Text Catalog V2

What SAX Text Catalog V2 Actually Stores

By so16tm·Created 7 months ago·Updated a day ago· 2
SAX Text Catalog V2
    • text
    • selection_json
    ◄seed0►
    ◄config_json{"version":3,"catalog_id":"","rows":[]}►

    Everyone builds the same bad prompt system eventually: six text files, four half-finished CLIP Text Encode nodes, and one negative block you keep pasting from a notepad because you can never remember where you put it. SAX Text Catalog V2 is the ambitious fix - a prompt library that lives on the server, shared by every workflow you own, emitting finished text into a single socket.

    What it is

    SAX_Bridge_Text_Catalog_V2 is the second generation of SAX_Bridge's prompt catalog. V1 kept its items inside the node, which is great for one workflow and useless for five. V2 keeps items, components and text sets in a catalog file on the ComfyUI server's system user directory, and the workflow only stores a reference to it.

    The model has three pieces worth knowing:

    • An item is a name, some text, and tags. Quality, high quality, absurdres. Tags organize items; they don't do anything at run time.
    • A component picks candidates from a list of items - all of them, or a random N - or picks from child components if it's a nested component.
    • A text set is an ordered stack of components. The node runs as many sets as you enable, in row order.

    Because a component can select randomly from a set of items, one row can emit "a hair colour" from twelve options, seeded and reproducible. That's the old {a|b|c} wildcard trick from A1111, except the alternatives are named items you can organise, tag and reuse.

    How it works

    At queue time the node resolves each enabled set: walk its components in order, draw according to each component's mode, and append the text. Everything gets trimmed, blanks are dropped, and the survivors are joined with newlines. Empty rows emit nothing.

    seed is the selection seed and it's the only thing you'll actually touch. Each draw depends on the seed plus the set ID plus the component ID, so reordering rows or components won't change what a given component picks. Editing the catalog will, though - same seed, different library, different output. That asymmetry is the one thing to understand about reproducibility here.

    One more mechanic worth internalising: when you hit Queue in the browser, the catalog is snapshotted and dynamic syntax is expanded through Autocomplete++ before the job goes out, so later edits don't rewrite a job already in flight. Post to /prompt from a script instead and the snapshot never happens - send expanded text yourself, or the wildcard tokens arrive literal.

    Inputs and outputs

    The two widgets are not peers. seed is a normal INT you set (0 to 9007199254740991, with the usual control-after-generate dropdown). config_json is a hidden STRING holding the catalog ID and your ordered set rows, written by the node UI - the default {"version": 3, "catalog_id": "", "rows": []} is just "nothing selected yet". Don't hand-author it.

    Two outputs, both strings. text is the goods: wire it into SAX Prompt's text input, or into a CLIP Text Encode. selection_json is a record of what the run actually drew - catalog ID and revision, seed, rows, item names and text. It's for reproducing a result and for reviewing a run in the UI. It is not a prompt; don't wire it into an encoder.

    Adding sets never adds sockets, which is the quiet win. Ten prompt variants, one wire.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/so16tm/SAX_Bridge
    

    Or in Manager: Install via Git URL → https://github.com/so16tm/SAX_Bridge. Restart. It's under SAX/Bridge/Utility. The pack has no pip dependencies at all (empty dependencies in its pyproject.toml, no root requirements file) - sam3 and Autocomplete++ are both optional and only relevant to their own features. For V2 you want Autocomplete++, because it's what expands wildcard syntax inside your catalog text at queue time.

    Limits and traps

    The caps are generous enough that you'll hit workflow problems before you hit them: 10,000 items, 1,024 sets, 256 components per set, 8 tags per item, 8 levels of nesting, 32 MiB per catalog.

    Shared means shared. Editing an item's text changes it for every workflow using that catalog, and cloned nodes are not independent copies. Duplicate the catalog (in SAX Text Catalog Manager) before an ambitious rewrite.

    Two tabs, one catalog. Concurrent edits produce a conflict rather than a silent overwrite, and your unsaved work is kept. Reapply it onto the latest revision.

    Too few candidates is an execution error. A random component with count above its enabled positive-weight candidate count fails rather than quietly giving you fewer. Weight 0 excludes a candidate, so a weight of 0 plus count 2 out of 2 left is a wall.

    The seed trap, amplified. The control-after-generate widget sets the seed for the next run by default. Find a draw you like, and the number in the box may already be the wrong one. Switch ComfyUI's global widget control mode to Before, and you'll never lose a good combination again.

    Honest verdict

    This is the most opinionated node in the pack and the one with the steepest ramp - a dozen controls before you've written a single prompt. If you have four prompts and one workflow, V1 is not embarrassing. If you're the person with the notepad, the shared catalog is the first thing in a long time that actually beats it.

    CategorySAX/Bridge/Utility

    Inputs (2)

    NameTypeDefaultDescription
    seedINT00–9007199254740991—
    config_jsonoptSTRING{"version":3,"catalog_id":"","rows":[]}—

    Outputs (2)

    NameTypeDescription
    textSTRING—
    selection_jsonSTRING—