SD Prompt Attention Weight Calculator

Calculate compounding attention weights for nested SD parentheses

Ad placeholder (leaderboard)

SD prompt attention weight calculator

In Stable Diffusion’s WebUI convention, you emphasise a token by wrapping it in parentheses and de-emphasise it with square brackets — and the effect compounds when you nest them. This calculator turns “how many brackets did I stack?” into an exact multiplier, and gives you the cleaner explicit syntax to use instead.

How it works

Each pair of round parentheses multiplies a token’s attention weight by 1.1; each pair of square brackets multiplies it by 0.9. Nesting multiplies again:

(token)      → 1.1
((token))    → 1.1 × 1.1 ≈ 1.21
(((token)))  → 1.1³       ≈ 1.331
[token]      → 0.9
[[token]]    → 0.9 × 0.9 = 0.81

So the effective weight for depth n is 1.1ⁿ for emphasis or 0.9ⁿ for de-emphasis. The calculator computes that and shows the equivalent (token:weight) form, which is far easier to read than a pile of brackets.

Tips and notes

  • Prefer the explicit form. (detailed face:1.3) is clearer and less error-prone than ((detailed face)).
  • Stay in a sane range. Emphasis above ~1.4 tends to distort; below ~0.6 the token may vanish. Adjust in small steps.
  • Weights are relative. Pushing one token up effectively pushes the rest down, so re-balance the whole prompt rather than only inflating one word.
  • UI matters. This is the AUTOMATIC1111 / SD WebUI standard. ComfyUI and other tools mostly follow it, but Midjourney and DALL·E do not — check your tool.
Ad placeholder (rectangle)