Nodes/ComfyUI-Desert-Pixel-Nodes/DP Add Weight To String SDXL
ComfyUI Node

DP Add Weight To String SDXL

Wrap text in (prompt:weight) syntax automatically

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Add Weight To String SDXL
    • STRING
    weight1.0
    text

    On SDXL and SD 1.5, you emphasize part of a prompt by wrapping it in weight syntax: (red dress:1.3) tells the sampler to pay 30% more attention to that phrase. Typing those parentheses and colons by hand around a dynamically-generated string is a pain. This node does it for you - feed it text and a weight number, and it hands back the text already wrapped in SDXL-style (text:weight) formatting.

    It's from DesertPixelAi's Desert-Pixel-Nodes, a big quality-of-life pack. Nothing here generates an image; it's a text formatter. Its whole reason to exist is that you often don't know the text ahead of time - it's coming from a switch, a wildcard, a subject list - so you can't just type the parentheses in. This node applies the weight to whatever flows through.

    How it works

    Simple transform: string in, weight in, weighted string out. If you pass "ancient stone temple" with a weight of 1.2, you get (ancient stone temple:1.2). Wire that into your CLIP Text Encode (or concatenate it into a larger prompt) and SDXL reads the emphasis.

    The important caveat, and it's a big one in 2026: this only works on CLIP-based models. SD 1.5, SDXL, and the whole Illustrious / Pony / NoobAI / WAI lineage honor (text:weight). LLM-encoded models - Flux 2, Z-Image, Qwen-based checkpoints, Anima - do not. Their encoders discard weight syntax, and worse, the parentheses and colon get read as literal punctuation inside your instruction, which is slightly worse than adding nothing. The "SDXL" in the name is the honest boundary: use it on CLIP models, don't bother on LLM ones.

    The inputs and outputs that matter

    • weight - a float. This is the emphasis multiplier that goes after the colon. The node accepts a wide range, but the useful band on real models is roughly 0.5 to 1.5; above about 1.5 you get oversaturation and mush, so ignore the fact that the slider goes to 10.
    • text - the optional multiline string to wrap.

    Output is STRING - your text in (text:weight) form. Feed it to a text encoder or splice it into a bigger prompt.

    How to install it

    • ComfyUI Manager: search "Desert Pixel", install, restart. Nothing to download.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes, pip install -r requirements.txt if present, restart.

    Under the DP category.

    Common issues

    The most common disappointment is weighting doing nothing - and nine times out of ten that's because you're on an LLM-encoded model where the syntax is inert. Check what your checkpoint is built on before assuming the node is broken.

    The second is cranking the weight too high because the input allows it. A weight of 3, 4, or beyond doesn't make the concept "really strong," it makes it fry - blown-out color, deformed shapes. Stay near 1.1-1.4 for a nudge. If you want a choice between numeric weights and the bracket style, or a saner capped range, the sibling DP_Advanced_Weight_String_Sdxl is the more considered version of this node.

    CategoryDP/String

    Inputs (2)

    NameTypeDefaultDescription
    weightFLOAT1.00–10
    textoptSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING