Nodes/Autocomplete++/Autocomplete++ Formatting Controller
ComfyUI Node

Autocomplete++ Formatting Controller

Stop your prompt editor from fighting your prompt style

By michikora·Created 10 days ago·Updated 2 days ago· 5
Autocomplete++ Formatting Controller
  • passthrough
  • passthrough
anima_artist_modeDefault (From Settings)
auto_insert_commaDefault (From Settings)
replace_underscoreDefault (From Settings)
escape_parenthesesDefault (From Settings)
auto_close_curly_bracesDefault (From Settings)
auto_format_on_blurDefault (From Settings)
format_space_after_commaDefault (From Settings)
format_trim_prompt_end_commaDefault (From Settings)
format_trim_line_end_commaDefault (From Settings)
format_replace_underscoreDefault (From Settings)
keep_underscores_modeDefault (From Settings)
keep_underscores_list

Different models want different prompt dialects, and your editor will happily wreck all of them. Booru tags are written with underscores on the wiki (long_hair) but comma-separated with spaces in a prompt. Anima wants an @ in front of artist tags. LoRA filenames are full of underscores that must not be converted. Emoticons like ^_^ contain an underscore that absolutely is not a separator.

The formatting rules that handle this are global Autocomplete++ settings. This node puts them in the workflow instead, so a booru-style workflow and a natural-language one can sit side by side on your disk without you re-toggling Settings every time.

What it actually changes

The rules split into two moments. Some act on insertion - you accept a suggestion, and the extension adds a comma and a space, or replaces underscores, or escapes literal parentheses so tag (qualifier) becomes tag \(qualifier\). The rest act on blur - when the text box loses focus, the auto-formatter rewrites what's already there: spacing after commas, collapsing duplicate commas, trimming a trailing comma, and underscore replacement.

Every input here is a three-way enum: Enabled, Disabled, or Default (From Settings), which inherits your global value. Defaults are roughly "most of it on": auto-format on blur, space after comma, trailing-comma-at-prompt-end and underscore replacement are enabled, while trimming commas at line ends is off.

The list, in the order you'll see it:

  • anima_artist_mode - auto-prepends @ to artist tags. Anima is the anime model built on Cosmos-Predict2 with a Qwen3 text encoder, and it reserves a distinct artist syntax; the global setting has Auto mode too, but this node only offers on/off/default.
  • On insertion: auto_insert_comma, replace_underscore, escape_parentheses, auto_close_curly_braces (typing { inserts the closing } and drops the cursor between them; typing { over a selection wraps it).
  • On blur: auto_format_on_blur, plus its individual rules format_space_after_comma, format_trim_prompt_end_comma, format_trim_line_end_comma, format_replace_underscore.
  • keep_underscores_mode and keep_underscores_list - a protection list. Append to Global List adds your entries to the global one, Override Global List replaces it entirely. Type the tags you want left alone, one per line or comma-separated.

Watch the twins, because they're easy to confuse. replace_underscore fires when a suggestion is inserted; format_replace_underscore is the blur-time rule that rewrites the existing text. If you disable one and your underscores keep vanishing the moment you click away, it was the other one doing it. Same story for the trailing comma.

What the formatter deliberately won't touch: <lora:...>, embedding:..., __wildcard__ paths, and emoticons and kaomojis - ^_^, >_<, -_-, ಠ_ಠ. It also formats sub-options inside {a|b|c} without breaking the syntax. The keep-underscore list is for the leftovers it can't guess.

Is it worth a node?

Only sometimes, and that's fine. The honest use case is one workflow where you want the formatter off entirely because you're pasting prompts verbatim from somewhere else. The other is keep_underscores_list per project - you're using a LoRA family whose trigger words are my_style_v2 and you're tired of retyping them after the formatter eats the underscores.

Installing

Manager: search Autocomplete++, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/michikora/ComfyUI-Autocomplete-Plus-Plus.git

Restart ComfyUI, then hard-refresh the browser tab or the new JavaScript won't load. No pip dependencies and no model downloads - the dependency list is empty and the tag CSVs ship in the repo. It sits on ComfyUI's shared multiline text widget, so formatting applies wherever autocomplete does.

No wiring required. There's one optional passthrough socket of type * - ComfyUI's accept-anything type - returned untouched, so you can slot the node into a model or image chain to anchor it visually to the section it configures. The Python side does nothing; the behaviour is all frontend.

When it misbehaves

  • Nothing formats. The controller has to be present and not muted (Ctrl+M) or bypassed (Ctrl+B) - muted means "yield to another controller", by design. Also check auto_format_on_blur isn't Disabled, and remember blur rules only run when the textarea loses focus.
  • Your prompt got mangled. Walk the rules: lost underscores → replace_underscore / format_replace_underscore; comma appeared where you didn't want one → auto_insert_comma; a trailing comma you wanted gone at a line end → format_trim_line_end_comma, which is off by default. Escape the tag in keep_underscores_list if it's a real edge case.
  • Two controllers on one canvas. Last-touched wins, otherwise the newest node. Node 2.0 shows an Active pill; the legacy canvas doesn't render it but still arbitrates.
  • Some third-party text box ignores all of this. The pack hooks ComfyUI's multiline string widget factory, so nodes with their own custom text areas don't participate. Right-click → Autocomplete++Force override this node type is the lever that exists; it doesn't fix every widget.
CategoryAutocomplete++

Inputs (13)

NameTypeDefaultDescription
anima_artist_modeCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
auto_insert_commaCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
replace_underscoreCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
escape_parenthesesCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
auto_close_curly_bracesCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
auto_format_on_blurCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
format_space_after_commaCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
format_trim_prompt_end_commaCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
format_trim_line_end_commaCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
format_replace_underscoreCOMBODefault (From Settings)3 options: Default (From Settings), Enabled, Disabled
keep_underscores_modeCOMBODefault (From Settings)3 options: Default (From Settings), Append to Global List, Override Global List
keep_underscores_listSTRING
passthroughopt*

Outputs (1)

NameTypeDescription
passthrough*