Nodes/SDXL Prompt Styler/SDXL Prompt Styler Advanced
ComfyUI Node Runs on cloud

SDXL Prompt Styler Advanced

One prompt is never enough — style SDXL's two text encoders separately

By twri·Created 3 years ago·Updated 2 years ago· 921
SDXL Prompt Styler Advanced
    • text_positive_g
    • text_positive_l
    • text_positive
    • text_negative_g
    • text_negative_l
    • text_negative
    text_positive_g
    text_positive_l
    text_negative
    style
    negative_prompt_toBoth
    copy_to_lfalse
    log_promptfalse

    Same pack, same 107 style templates - but where the plain SDXL Prompt Styler treats your prompt as one blob, the Advanced version lets you feed SDXL's two text encoders independently. SDXL conditions on a pair of encoders - the smaller OpenAI CLIP-L and the bigger OpenCLIP-G - and ComfyUI will happily encode them with different text. This node exists to exploit that split, and it's the one you want when a single styled string isn't giving you enough control.

    What it does differently

    Each style template is split into two halves on the separator " . " (space-dot-space). The part before it becomes the G half of the prompt, the part after becomes the L half - mirroring how SDXL prompts are conventionally split so different terms land on different encoders. The author describes it as built for "linguistic and supportive terms": put the subject and structure in G, push detail and mood onto L, and the two encoders each get text they're good at rather than a 200-token run-on pasted everywhere.

    You get two separate positive inputs - text_positive_g and text_positive_l - and the node outputs three positive variants (text_positive_g, text_positive_l, and a combined text_positive) plus three negatives (text_negative_g, text_negative_l, text_negative). If you just want to style and not think about encoders, feed only the G box, wire the combined text_positive and text_negative outputs into a normal CLIPTextEncode, and it behaves like the base node.

    The knobs that are actually worth knowing

    • negative_prompt_to - routes the negative to Both, G only, or L only. This is the "split behavior of the negative prompt" the changelog mentions, and it's how you keep a negative off the encoder that's carrying your important subject terms.
    • copy_to_l - added January 2024: copies the styled G tokens over to L, removing duplicates so you don't pay the token cost twice. Turn it on when you're feeding a combined positive and L is otherwise empty.
    • log_prompt - same console dump as the base node, but defaults to off here. Slightly nicer than its sibling.
    • text_positive_l - if the template has no " . " split, the whole styled prompt goes to G and L just gets whatever you typed raw, so it's safe to leave blank.

    One subtlety worth internalizing: the 77-token ceiling applies per encoder, so splitting your prompt across G and L genuinely stretches your effective prompt length. That's the whole trick - two text boxes that each get a full budget instead of one truncated string.

    Install and gotchas

    Same pack, same install - it's one clone that registers both nodes. ComfyUI Manager search for "SDXL Prompt Styler", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/twri/sdxl_prompt_styler.git
    # restart ComfyUI
    

    No dependencies, no models. Custom styles go in a .json file in the pack folder (the code loads every JSON sitting next to the node .py), and they need a " . " split in the prompt field to get the G/L treatment. Nearly every included template already has one - all 89 of the hand-written twri styles and 16 of the 17 sai-* ones - so the split is the rule here, not an edge case.

    Honest take: if you can't say what CLIP-L versus OpenCLIP-G is doing in your graph, the base node will do 95% of the job with half the outputs cluttering your canvas. The Advanced node shines for people tuning dual-encoder workflows where one encoder carries structure and the other carries polish. For that crowd it's the better half of an underrated little pack.

    Categoryutils

    Inputs (7)

    NameTypeDefaultDescription
    text_positive_gSTRING
    text_positive_lSTRING
    text_negativeSTRING
    styleCOMBO107 options: ads-advertising, ads-automotive, ads-corporate, ads-fashion editorial, ads-food photography, ads-gourmet food photography, +101
    negative_prompt_toCOMBOBoth3 options: Both, G only, L only
    copy_to_lBOOLEANfalse
    log_promptBOOLEANfalse

    Outputs (6)

    NameTypeDescription
    text_positive_gSTRING
    text_positive_lSTRING
    text_positiveSTRING
    text_negative_gSTRING
    text_negative_lSTRING
    text_negativeSTRING