Normalize Comma Prompt
The Two-Second Fix for Your Sloppy Copied Prompt
- prompt
Copying a prompt from CivitAI, a forum post, or an LLM chat usually nets you the same garbage: masterpiece, 1girl , blue hair, smile - stray spaces, double commas, empty entries, and a trailing comma that does nothing but annoy. This is the node that fixes exactly that and nothing else. Feed it the messy string, get back masterpiece, 1girl, blue hair, smile. One input, one output, no settings, no surprises.
How it works
The logic is about as simple as a node can get: it splits the prompt on commas, strips whitespace off each piece, drops anything that's empty after trimming, and rejoins the survivors with , . On top of that it also treats lines starting with // as comments and removes them entirely - handy if you keep notes inside your prompt text for yourself and don't want them encoded.
The prompt input is multiline and has dynamic prompts enabled, so you can paste a multi-line block or drop a wildcard/sequence in and it still passes through cleanly. The output prompt is a plain STRING you wire straight into your text encoder.
When you'd reach for it
It's a cleaning stage, so it slots in wherever text gets assembled. The natural spots:
- After a node that builds prompts from parts (an LLM prompt writer, a wildcard picker, a text-concatenate stack) - catch the formatting noise before it hits the encoder.
- Before a prompt goes into a
CLIP Text Encodewhen you're pasting from an external source and don't trust the spacing. - When you want to guarantee a canonical
,separator across a batch for A/B testing, so formatting isn't a hidden variable between runs.
Install
It ships in Ye0l/ComfyUI-KSTR-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/Ye0l/ComfyUI-KSTR-Nodes
or search "ComfyUI-KSTR-Nodes" in ComfyUI Manager, then restart. It's under Yeol/Prompt, and it needs no dependencies and no models.
The honest caveat
On modern LLM-encoded models - Flux, Z-Image, Anima - punctuation and spacing are far less load-bearing than they were in the CLIP era, because the encoder reads your prompt as an instruction rather than a token bag. So on a 2026 model this node is mostly cosmetic. But "cosmetic" still means one less variable to wonder about when a run looks off, and for anything CLIP-lineage (SDXL, Illustrious, Pony) clean separators genuinely matter. It won't make your prompt better, it just stops formatting from making it worse - which is a reasonable thing for a utility node to do.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |