Nodes/SAX Bridge/SAX Wildcard Editor
ComfyUI Node

SAX Wildcard Editor

A Real Wildcard Editor Inside ComfyUI, With Save Protection

By so16tm·Created 7 months ago·Updated a day ago· 2
SAX Wildcard Editor

      Wildcards are the cheapest variety machine in this hobby: one prompt, __clothing/dresses__, and every queue gives you a different dress. What they've never had is a decent editor. Usually it's Notepad, a folder you half-remember, and a browser reload to find out whether the file saved where ComfyUI is actually looking. This node is a UI for exactly that problem, and it's the most immediately useful thing in the pack.

      What it is

      SAX_Bridge_Wildcard_Editor opens an editing screen for the .txt wildcard files that Autocomplete++ reads. It has no inputs, no outputs, and doesn't need to be executed - you add it, press the button, and work in the dialog. It's independent of the Text Catalog V2 machinery; nothing about it requires the catalog nodes.

      Why keep wildcards around at all when catalog V2 exists? A .txt file is still the most portable way to say "pick one of these forty things", it works in a plain prompt with no extra node, and the {a|b|c} bracket trick is a habit people carried over from A1111 and never dropped. Wildcards are alive and getting more use, not less - our own Reddit corpus shows wildcard discussion climbing through the first half of 2026, north of a thousand mentions across 2024–2026. For years their default home in ComfyUI was Impact Pack, which meant installing a whole detailer pipeline because you wanted a text file expander. SAX_Bridge deliberately doesn't depend on it.

      How it works

      The editor is a front end over a small set of server routes (/sax/wildcards, GET/PUT/DELETE on file), so all reading and writing happens on the ComfyUI machine, not in your browser's storage.

      It only writes into folders Autocomplete++ actually scans: ComfyUI/wildcards/, any custom_nodes/*/wildcards/, and Autocomplete++'s own tags/wildcards/. Arbitrary absolute paths are refused, which is the right call - it's a prompt editor, not a file manager with a shell. Within those roots you pick the path and filename freely, and .txt is appended for you.

      The format is one candidate per line:

      # outfits
      red dress
      blue dress
      {3::white dress | 1::black dress}
      __style/casual__
      

      # comment lines and blank lines are excluded from the draw but preserved when you save, which matters when you're maintaining a 300-line file and need section headers. Weighted brackets work as you'd hope - {3::white dress | 1::black dress} picks white three times as often. Save a file as clothing/dresses.txt and you call it with __clothing/dresses__.

      The details that show someone actually used their own tool: files cap at 2 MiB and the tree at 10,000 files; only UTF-8 is accepted; concurrent external edits are detected by hash and the save refuses rather than clobbering; save-as never silently overwrites an existing alias; folders sort naturally (dir2 before dir10); and long lists are virtualized so a 2,000-line file doesn't freeze the dialog.

      Using it

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

      Restart, then add SAX/Bridge/Utility → SAX Wildcard Editor and press the edit button. Manager's Install via Git URL with https://github.com/so16tm/SAX_Bridge works too. Nothing downloads; no Python dependencies are involved.

      For the tokens to actually do anything, you need Autocomplete++ installed with Enable Prompt Expansion Engine turned on. SAX's own docs are blunt about this: expansion happens in the browser before queue submission. Without Autocomplete++, dynamic syntax "remains unexpanded" - your prompt literally arrives with __clothing/dresses__ in it. Coming from Impact Pack? Move your wildcard files across to Autocomplete++'s wildcards folder and check their syntax, because the two engines don't agree on everything.

      After a save the editor pokes Autocomplete++ to refresh its list and expansion data, so you usually don't need to reload the browser. If that refresh fails, the file is still saved and the last good expansion data is kept.

      Common issues

      File saved, token does nothing. Usual suspects, in order: Prompt Expansion Engine is off in Autocomplete++, the wildcard filename doesn't match the reference, or you saved outside the three scanned roots. The dialog shows the exact __folder/name__ string under the filename field - copy that.

      Two files with the same name. Roots are searched in priority order, so a dresses.txt sitting in ComfyUI/wildcards/ shadows one in a custom node's folder. The editor warns about this on save and keeps the warning per root. It's the single most confusing wildcard bug there is, and it's invisible without a warning like this.

      Save rejected mid-edit. Something else changed the file since you opened it. Reopen and reapply rather than forcing it - the hash check exists so a text-generation script and your editor don't eat each other's work.

      Same output every time. Autocomplete++'s "lock previous selection" mode keeps picks stable for the same seed. Change the seed, or you'll swear the file isn't being read.

      UTF-8 only, and 2 MiB. A Shift-JIS file full of Japanese candidates will fail to load. Re-save it as UTF-8 before bringing it in.

      One caveat that applies to everything UI-shaped in this pack: these dialogs are custom front-end code, and ComfyUI's front-end has been through a rewrite that broke plenty of third-party node UIs. If the button does nothing after a ComfyUI update, check for a pack update before assuming you broke something.

      CategorySAX/Bridge/Utility

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs