Prompt Format (Cyberdelia)
The node that turns pasted tag soup into a prompt your model can actually read
- prompt
You know the drill: you copied a tag list off a model page, pasted it into ComfyUI, and got a girl with blurry hair and duplicate gloves. The tags were fine - the text wasn't. long_hair is a word CLIP barely knows, gloves appears twice and splits its attention, and stray spaces around your (weight:1.3) brackets are quietly weakening them. This node fixes all of that on the fly. It's the ComfyUI port of the sd-webui-prompt-format cleanup that Forge users have been taking for granted, and it's basically the only prompt formatter here that runs as a real node instead of a button you forget to click.
What it does
Prompt Format (Cyberdelia) is a string-in, string-out node: you drop it between whatever produces your prompt (a text widget, a wildcards node, an LLM prompt writer) and your text encoder. When the workflow executes it:
- Deduplicates tags. If
glovesshows up twice, the second one disappears. - Replaces underscores with spaces -
long_hair→long hair- except for embedding filenames in yourembeddings/folder, which it detects and protects automatically. - Fixes spacing around
(),[],{},|and:, so(1girl:1.2)doesn't get its weight mangled by a stray space. - Appends trailing commas to multi-line prompts, so you can break a prompt across lines without breaking it.
- Strips
<lora:...>syntax outright. ComfyUI loads LoRAs through loader nodes, so inline LoRA tags from an A1111 prompt are dead weight - this node drops them so they don't leak into the conditioning as literal text.
Formatting runs automatically when the workflow executes - there's no button to click, which is exactly what you want if you're baking a reproducible pipeline. It isn't realtime, so don't expect the widget to update as you type.
The inputs that matter
The four required inputs are mostly set-and-forget booleans: text (the prompt, multiline), dedupe, remove_underscores, and append_comma, all defaulting to on. Two optional inputs are where the real control lives:
exclusions- comma-separated tags to protect from underscore removal. This is the one that will bite you: paste a Pony prompt full ofscore_9and leave exclusions empty, and it becomesscore 9, which is not a quality tag anyone trained in. Setscore_9, score_8_up, score_7_up, or usescore_*to protect the whole family.aliases- regex rules that merge variants into one tag, Forge-style:1girl: girl, woman, ladycollapses all four into1girland treats the rest as duplicates.
The single output, prompt, wires straight into CLIPTextEncode (or the SDXL/Flux/BNK variants - the cleaned string is model-agnostic).
Install
ComfyUI Manager, search "Cyberdelia Prompt Format", install. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/cyberdeliaAI/comfyui-cyberdelia-prompt-format
Restart ComfyUI. That's it - pyproject.toml declares zero dependencies and there are no model downloads, which in the custom-node world is practically a luxury (the ecosystem's normal state is dependency hell, per the KB's ComfyUI ecosystem doc).
Gotchas
First: this pack used to be called ComfyUI-PromptFormat and was renamed. Node names and display names are unchanged, so old workflows keep loading - but if you're reinstalling, use the new repo name.
Second, don't confuse it with Haoming02's comfyui-prompt-format, an older, unrelated pack with the same idea. Same niche, different codebase, install the one whose author you trust.
Third, the underscore rule cuts both ways. The community consensus is that underscores genuinely hurt on tag-based models ("replace underscores with spaces or you'll definitely get worse results"), but the quality-tag exceptions are real - which is exactly why exclusions exist. If a prompt you ran before the node looks different now, check whether a score_* tag got space-ified.
And yes, that's a small frustration: it strips <lora:...> silently, so a migrated A1111 prompt can lose a LoRA with no error. Load those through a LoRA node - which is correct ComfyUI practice anyway.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| dedupe | BOOLEAN | true | — |
| remove_underscores | BOOLEAN | true | — |
| append_comma | BOOLEAN | true | — |
| exclusionsopt | STRING | — | |
| aliasesopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |