ComfyUI Node

Prompt Weight Scaler

1.2) in one shot, and it won't touch your format

By zisonMyu·Created 4 months ago·Updated 3 months ago· 2
Prompt Weight Scaler
    • scaled_prompt
    prompt
    format
    scale1.00
    clamp_max2.0

    You know the feeling: you've got a prompt with forty tags, three of them are working beautifully, and you want to gently push the whole thing harder. Hand-editing (tag:1.1) into (tag:1.3) forty times is miserable, and it's exactly the kind of thing a node should do for you. PromptWeightScaler is that node - it multiplies every explicit weight in a prompt by a single factor while leaving the format alone.

    The key phrase is "while leaving the format alone." This is the surgical sibling of the pack's main converter: the converter changes dialects, this one changes emphasis within one. It's the node you reach for when you want to test "does everything pop a bit more at +40%?" without rewriting your prompt by hand, or when a workflow came in with weights baked in and you want to dial the whole thing down because the model you're using oversaturates past 1.5 (a real failure mode on CLIP models, per the KB's weight guidance).

    How it works

    You give it a prompt, a format (default Auto-detect, which scans for the dialect the same way the converter does), a scale factor, and a clamp_max cap. It finds every explicit weight and multiplies it by scale, rounding to four decimals, then clamps at clamp_max. scale = 1.5 turns (tag:1.1) into (tag:1.65); scale = 0.8 tames a prompt down to 80%.

    The clever bit is how it handles the non-SD dialects. NAI3 brace syntax has no numeric weights to multiply, so the node round-trips it through SD - parse braces to (tag:weight), scale, write back to braces. Same trick for NewBie: it converts to SD, scales, reconverts to XML. NAI4's 1.2::tag:: gets rewritten in place with a regex. Either way you get back the same dialect you put in.

    Inputs and outputs

    Three inputs to care about:

    • scale - the multiplier, from 0.01 to 5. This is the whole point of the node.
    • clamp_max - the ceiling, default 2.0. Left alone, it keeps runaway values from stacking into distortion; the KB's practical range for CLIP weights is roughly 0.5–1.5, so a cap of 2 is generous.
    • format - only set this if auto-detection is tripping on something unusual.

    Output is a single scaled_prompt string. Wire it wherever your prompt text goes.

    The honest limitations

    It only touches explicit weights. Unweighted tags stay exactly as they are - blue hair doesn't become (blue hair:1.1) when you set scale to 1.1. That's deliberate (the node is "weight scaler," not "emphasis adder"), but it means boosting a mostly-unweighted prompt does almost nothing. If that's what you actually want, convert the prompt to SD first, add weights, and scale. Also worth noting: like the rest of this pack it's dependency-free and offline - install by searching "ComfyUI-Prompt-Format-Converter" in Manager, or git clone https://github.com/zisonMyu/ComfyUI-Prompt-Format-Converter into custom_nodes and restart. Nothing to download, nothing to break.

    CategoryPrompt Tools

    Inputs (4)

    NameTypeDefaultDescription
    promptSTRING
    formatCOMBO6 options: Auto-detect, SD, SD(anima), NAI3, NAI4, NewBie
    scaleFLOAT1.000.01–5
    clamp_maxFLOAT2.00.1–10

    Outputs (1)

    NameTypeDescription
    scaled_promptSTRING