Nodes/Sage Utils/Text Weight
ComfyUI Node

Text Weight

Wrap your text in parentheses, with a knob for the weight

By arcum42·Created 2 years ago·Updated 28 days ago· 33
Text Weight
    • weighted_text
    text
    weight1.00
    separator,

    This one is for the CLIP era, and it knows it. Text Weight takes a string and outputs it wrapped in weighting syntax - (text:1.2) - plus a separator, so you can emphasize or de-emphasize a phrase the old-school way. If you're running SDXL, Pony, Illustrious, or any CLIP-encoded model, this is a clean way to build a weighted prompt from a variable string instead of typing the parentheses by hand. If you're on an LLM-encoded model, read the caveats below before you bother.

    How it works

    Three inputs: text (the phrase to weight), weight (a float from -10 to 10, default 1.0), and separator (default ", "). The output, weighted_text, is (text:weight) followed by the separator. So text = masterpiece, weight = 1.2 gives you (masterpiece:1.2), ready to chain into a prompt. Negative weights come out as (text:-0.5), which is the syntax for de-emphasis, and the float formatting is compact (:.2g), so you get 1.2 not 1.200000.

    The useful part is that text is a real input, so you can wire a dynamic string - from a wildcard node, a batch loop, a Set Text - and the weighting wraps whatever you get. That turns "emphasize this" into a repeatable operation rather than manual typing.

    The honest version of the caveats

    The prompt-engineering reality in 2026 is that (word:1.3) weighting is discarded on LLM-encoded models - Z-Image, Flux 2 Klein, Qwen-Image, Krea 2 - because their text encoders read your prompt as an instruction, not a token bag. On those models this node just adds literal punctuation that gets read as part of your sentence. So: this node is genuinely useful on CLIP models (SDXL, Pony, Illustrious, SD 1.5), and on LLM models it's the wrong tool - say what you mean in words instead. The practical weight range on models where it does work is roughly 0.5–1.5; below ~0.5 a concept barely registers, above ~1.5 you get oversaturation and distortion.

    Installing it

    Part of the Sage Utils pack - ComfyUI Manager (search Sage Utils) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/arcum42/ComfyUI_SageUtils
    cd ComfyUI_SageUtils
    pip install -r requirements.txt
    

    Restart ComfyUI. Only pip dependency is dynamicprompts; no model downloads.

    Watch out for

    The separator is after the weighted text - that's a deliberate design (the weighted phrase is designed to be followed by a comma so you can chain it), but if you're using this to wrap the last phrase in a prompt you'll get a trailing , that you may need to trim downstream. And don't crank weights past the practical band just because the slider goes to 10; on models where weighting works, the useful range is narrow and the extremes are how you get artifacts.

    CategorySage Utils/text/helper

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGThe text to apply a weight to.
    weightFLOAT1.00-10–10Weight value to add to the text.
    separatorSTRING, Separator to use after the weighted text.

    Outputs (1)

    NameTypeDescription
    weighted_textSTRINGOutput value for weighted_text.