Nodes/ComfyUI Prompt Formatter/Prompt Formatter (Only Text)
ComfyUI Node

Prompt Formatter (Only Text)

A Text Pass-Through With the Good Buttons, Before Anything Gets Encoded

By younyokel·Created about a year ago·Updated about a year ago· 6
Prompt Formatter (Only Text)
    • STRING
    text

    "Prompt Formatter (Only Text)" is the same magic-button idea as the pack's CLIP node, minus the CLIP. It takes your prompt, does nothing to it on its own, and returns it as a plain STRING - but parked on its face are the three buttons this pack is actually known for: 💫 Format Prompt, ✒️ Convert Tags, and ⏪ Undo Last Change.

    That "does nothing on its own" part is the whole reason to pick it. Because this node outputs text instead of CONDITIONING, you can run the formatter, inspect the cleaned result in the widget, and then decide whether it's what you actually want to feed the encoder. With the CLIP node you're committed - the formatting happens and immediately gets encoded. Here you can eyeball ((1girl)), long_hair turning into (1girl:1.21), long hair, before it touches your sampler.

    How it works

    passthrough(text) literally returns what you typed. The buttons are a front-end trick: a JS extension POSTs the widget text to the pack's /prompt_formatter/format_prompt and /prompt_formatter/convert_tags HTTP routes, which run the same cleanup functions as the CLIP node - bracket alignment, tag dedupe, whitespace collapse, and bracket-to-weight conversion - then write the result back into the widget. Same settings.json, same blacklist, same behavior. The only difference between this node and its CLIP sibling is the output type.

    The one input, the one output

    • text (multiline) - your raw prompt. It's a dynamicPrompts field, so {a|b} wildcards work before you even hit the button.
    • Output: STRING, which wires into any text input - a stock CLIP Text Encode's text field, TextAppendFormatter, or whatever prompt tool you're chaining.

    A natural little pattern: TextOnlyFormatter → TextAppendFormatter → CLIPTextEncode. Format and dedupe in one pass, append your fixed quality tags or trigger words in the next, encode last. It's also the least risky node in the pack to experiment with, because there's no conditioning to accidentally break.

    Gotchas

    Same honest caveats as the pack's CLIP node: formatting is only when you click, Undo reverts only the last action on that node, and the bracket-to-weight conversion only means something on CLIP-based models (SDXL, Illustrious, NoobAI). On LLM-encoded models the button still edits your text, but (word:1.21) weights are ignored downstream - harmless, just pointless.

    Install

    Install it with the rest of the pack - there are no separate steps:

    cd ComfyUI/custom_nodes
    git clone https://github.com/younyokel/comfyui_prompt_formatter.git
    

    Then restart ComfyUI. No dependencies, no model files, pure Python plus a tiny JS extension. ComfyUI Manager users: search the registry for ComfyUI Prompt Formatter.

    One last thing worth knowing: this is a very small utility in a very small pack, with basically no community discussion to fall back on. If the buttons ever stop working, the cause is almost always that the pack didn't load (restart, check Manager) or you edited settings.json and didn't restart - it's read once at startup.

    Categoryprompt_formatter

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGThe raw text prompt to pass through or format.

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGReturns the raw text input for use in further processing.