Nodes/ComfyUI-Prompt-Preview/SDXL Prompt Styler (Preview)
ComfyUI Node

SDXL Prompt Styler (Preview)

The SDXL Styler That Shows Its Work Before You Generate

By Chan-0312·Created 2 years ago·Updated 2 years ago· 39
SDXL Prompt Styler (Preview)
    • text_positive
    • text_negative
    text_positive
    text_negative
    style
    log_prompttrue
    style_positivetrue
    style_negativetrue

    The classic problem with the sdxl_prompt_styler family: you pick artstyle-watercolor from a list of 107 names and hope. This node keeps the exact same styling logic but shows you a hover thumbnail of each style as you browse - preview images generated with SDXL 1.0 - and organizes everything into a category submenu. It's the plain, one-prompt version of the pack; the Advanced variant adds SDXL's G/L encoder split if you need it.

    How it works

    It's a thin wrapper around twri's SDXLPromptStyler, which is why the mechanics are boring in the best way. You type a prompt, pick a style, and the node substitutes your text into the style's template - {prompt} gets replaced, and the style's own negative prompt (things like noisy, blurry, amateurish) gets prepended to yours. No model involved, no API, just string manipulation, then the result flows out as plain text.

    The preview layer is where this pack earns its name. Each of the 107 styles has a matching PNG shipped in the repo, served through a /preview route the pack registers on ComfyUI's server. A bundled JS extension - a fork of pythongosssss's ComfyUI-Custom-Scripts - patches the dropdown so hovering a style shows its thumbnail and styles are grouped into categories like ads, photo, and papercraft. On modern ComfyUI the extension loads automatically from the pack's web directory.

    Inputs that matter

    Only two are worth touching at first:

    • text_positive and text_negative - your prompt and negative, exactly as you'd type them into a CLIP Text Encode node.
    • style - the 107-style dropdown. Note the naming: ads /ads-advertising means category / actual style name.
    • style_positive and style_negative - toggles that bypass the style's template for the positive or negative side, in case the style's built-in negative isn't to your taste.

    One quirk: log_prompt defaults to on here. Every run, the node prints the style, your prompts, and the styled results to your console. That's actually a nice way to learn what each style does to your text - but if you see log spam you didn't ask for, this is what's causing it, so flip it off.

    Outputs

    Two strings: text_positive and text_negative, the fully styled versions of what you put in. Wire text_positive into a standard CLIP Text Encode node's positive input and text_negative into its negative input. For SDXL that single encode handles both text encoders fine - the Advanced node exists only for when you specifically want to feed OpenCLIP-G and CLIP-L different text.

    Install

    ComfyUI Manager, search ComfyUI-Prompt-Preview, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Chan-0312/ComfyUI-Prompt-Preview
    

    Restart ComfyUI. No requirements.txt, no model files to fetch - the preview images are already in the repo, and the only Python it needs (numpy, PIL) is what ComfyUI already ships.

    Gotchas

    The previews are a flavor guide, not a promise: they were generated with SDXL 1.0 on one fixed prompt, so a thumbnail that looks great can still do nothing for your specific subject. And remember the styling is literal text substitution - if your prompt is already long, some style templates will balloon it, and the template's negative gets concatenated onto yours rather than replacing it.

    Categoryutils

    Inputs (6)

    NameTypeDefaultDescription
    text_positiveSTRING
    text_negativeSTRING
    styleCOMBO107 options: [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], +101
    log_promptBOOLEANtrue
    style_positiveBOOLEANtrue
    style_negativeBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    text_positiveSTRING
    text_negativeSTRING