Prompt Weight (WLSH)
Prompt Weight (WLSH)
- prompt
If you've hand-written prompts before, you already know the (word:1.25) syntax - parentheses and a colon-separated number to tell the model "pay more attention to this bit." ComfyUI's CLIPTextEncode understands that syntax natively when you type it directly into a text box. This node exists for the case where you can't type it directly, because the text you want to weight isn't a literal string you're writing - it's coming from somewhere else in your graph.
Think of a scenario where a trigger word, a tag, or a chunk of prompt text is being generated or selected dynamically upstream (a random-from-list node, a LoRA trigger word output, a string built from other inputs) and you want to boost or reduce its influence without hardcoding it into a static prompt box. You can't just type parentheses around a variable. This node does that wrapping programmatically: give it a string and a weight, and it hands back the same string wrapped in the emphasis syntax, ready to get concatenated into a larger prompt or fed straight to a text encoder that understands the notation.
Inputs: prompt is a multiline STRING - the text you want weighted, literal or piped in from elsewhere. weight is a FLOAT, 0.1 to 5, default 1, in steps of 0.1. Output: a single STRING - the input text wrapped in the standard emphasis format. The pack's own README spells out the exact transform: "foo" at weight 1.25 becomes (foo:1.25).
A couple of things worth knowing about how that syntax actually behaves once it hits a sampler: a weight of 1 is neutral (which is why the default sits there - it's a no-op until you change it), values above 1 push emphasis up, values below 1 push it down. This isn't a WLSH-specific convention - it's the same parenthetical weighting syntax A1111 popularized and ComfyUI's CLIPTextEncode carries forward, so whatever intuition you've built for "how far can I push a weight before it breaks" from other tools transfers directly here. Stacking multiple weighted phrases together in one prompt is fine; just remember each (text:weight) block is parsed independently, so wrapping an already-wrapped string a second time will nest the syntax rather than combine the weights.
Installing it: search "wlsh_nodes" in ComfyUI Manager, or clone it directly:
cd ComfyUI/custom_nodes
git clone https://github.com/wallish77/wlsh_nodes
Restart ComfyUI afterward. It's a string-formatting node with no model dependencies, so nothing else to set up.
Troubleshooting: if the weighting doesn't seem to be having any visible effect, the most likely explanation isn't this node - it's that the output isn't actually reaching a text encoder that parses the syntax, or it's landing inside a metadata/filename field instead of your actual prompt string. Also worth checking: extreme weights (pushing toward the 5 ceiling, or down near 0.1) tend to destabilize output on most models well before you hit the numeric limits - if a heavily weighted phrase is dominating or wrecking the whole image, that's the syntax doing exactly what it's supposed to, and the fix is dialing the number back down, not the node misbehaving.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| weight | FLOAT | 1.00.1–5 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |