Prompt Weight
Build (tag:1.2) syntax without fat-fingering parentheses
- prompt
If you've ever typed (masterpiece:1.3), (detailed background:0.8) by hand and lost track of a closing parenthesis three tags deep, this node is for you. Prompt Weight takes up to four separate prompt fragments and their weights and hands you back one clean, correctly-formatted weighted string - no manual bracket-counting.
How it works
This is a wrapper around ComfyUI's own attention syntax, (keyword:1.3), which bumps a term's influence up or down by re-scaling how strongly the CLIP encoder attends to it - 1.3 is roughly +30%, 0.7 is roughly -30%. Prompt Weight just automates writing that string: each promptN / weightN pair becomes (promptN:weightN), and the node concatenates whichever pairs you've filled in. Leave a slot empty and it's skipped rather than emitting a stray (:1).
There's also an optional prompt_weight string input, shaped exactly like the node's own output. The obvious read is that it's there for chaining - run one Prompt Weight node's output into the next one's prompt_weight input when four pairs isn't enough - though the README doesn't spell out the exact merge behavior, so test it on a short string before trusting it in a big batch.
Inputs and outputs that matter
- prompt1 / weight1 - required. Weight defaults to
1(no change), ranges -100 to 100 in steps of 0.1. - prompt2–4 / weight2–4 - optional, same shape, for building up longer weighted strings in one node instead of four.
- prompt_weight - optional string, likely for chaining onto an upstream Prompt Weight output.
Output is a single prompt string - wire it straight into a CLIP Text Encode, or into Join String List / Format String if you're assembling it alongside other text.
Installing it
Search ComfyUI-PromptUtilities in ComfyUI Manager, or:
cd ComfyUI/custom_nodes && git clone https://github.com/nkchocoai/ComfyUI-PromptUtilities
Restart ComfyUI. It's pure Python string manipulation - no models, no extra pip packages, nothing to download. The node shows up under the PromptUtilities category. Worth knowing: the same author, nkchocoai, also maintains ComfyUI-SaveImageWithMetaData, a well-regarded metadata node that shows up regularly in r/comfyui troubleshooting threads - this isn't a one-off toy pack from someone who vanished after one commit.
Where people get burned
The one that actually matters: attention weighting is CLIP-only. It does nothing on the current wave of LLM-encoded models - Flux.2, Z-Image, Qwen-Image. On those the tokenizer sees your parentheses and colons as literal punctuation fed straight into the instruction, which is worse than not weighting at all. If you're on SDXL, SD1.5, or another CLIP-family checkpoint, Prompt Weight is genuinely useful. If you're on anything newer, skip it and just say what you want in plain words.
The other trap is the weight range itself: the slider goes to ±100, but nobody sane uses anything past ~1.4–1.5. Weights compound fast, and by the time you're at 2 or 3 you're usually looking at a fried, over-saturated mess rather than "more of the thing." Nudge in small steps and check the result before stacking another weighted term on top.
If you end up with ugly long decimals after chaining a few of these (or after randomizing weights elsewhere in the pack), this pack also ships Round Prompt Weight, built to sit right after this node and clean the numbers up.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt1 | STRING | — | |
| weight1 | FLOAT | 1.0-100–100 | — |
| prompt2opt | STRING | — | |
| weight2opt | FLOAT | 1.0-100–100 | — |
| prompt3opt | STRING | — | |
| weight3opt | FLOAT | 1.0-100–100 | — |
| prompt4opt | STRING | — | |
| weight4opt | FLOAT | 1.0-100–100 | — |
| prompt_weightopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |