๐ผ> Text Random Weights
Text Random Weights (YANC) โ ComfyUI Node Guide
- text
If you've ever hand-tuned a prompt like (forest:1.2), (ruins:0.9), (fog:1.4) by nudging numbers and re-rolling the seed to see what sticks, this node automates exactly that grind. Feed it a list of words or phrases, one per line, and it slaps a random weight on each one and hands you back a single comma-joined string ready to drop into a CLIP Text Encode node. Instead of you guessing which tag deserves more emphasis, the seed decides, and you just look at the batch of outputs to see what won.
It's part of ComfyUI_yanc - "Yet Another Node Collection" - a grab-bag of small utility nodes from a hobbyist ComfyUI YouTuber (A Latent Place) who built them for his own workflows and put them out publicly. Nothing fancy going on under the hood here, no external API, no model weights - it's a text-manipulation node doing string formatting with a random number generator behind it.
Inputs and outputs
- text - your multiline list. One concept per line:
forest,ruins,fog,dramatic lighting, whatever you're deciding whether to lean into. - min / max - the range the random weight is pulled from, per line. This is the one to actually pay attention to: both default to
1.0, which means out of the box every line gets weight 1.0 and nothing looks random at all. Widen it - something like min0.7, max1.4- before you conclude the node is broken. - seed - controls the randomization. Leave it on random/increment to get a fresh weight distribution every run, or pin it to a fixed value once you land on a combination you like, so you can iterate on other parts of the prompt without the weights shifting under you.
- text (output) - the assembled, comma-delimited, weighted string. Wire it straight into a CLIP Text Encode's text field, or into another Text Combine node if you want to prepend a style block first.
The catch worth knowing before you use it
Attention-weight syntax like (word:1.3) is a CLIP-era trick. It works on SD 1.5, SDXL, and the SDXL-lineage anime checkpoints (Illustrious, NoobAI, WAI, Pony). It does nothing - and I mean nothing, not "weaker" - on LLM-encoded models like Flux, Chroma, or Z-Image. Those encoders don't parse the parentheses as emphasis; they just see literal punctuation as part of the text, which is worse than not having it there at all. So if you're running this node into a Flux or Z-Image workflow expecting it to shift emphasis, it won't - the fix isn't a setting, it's swapping this node out for plain instructive phrasing in the CLIP Text Encode text instead. This node's entire reason to exist is CLIP-family checkpoints; keep that in mind before you go looking for a bug that isn't there.
Installing it
Easiest path: open ComfyUI Manager, search for ComfyUI_yanc (or "YANC"), install, restart. Manual route works just as well - cd ComfyUI/custom_nodes && git clone https://github.com/ALatentPlace/ComfyUI_yanc, then restart ComfyUI. The README doesn't call out any extra pip dependencies or model downloads for the pack, and Text Random Weights specifically is pure string manipulation, so there's nothing else to fetch. If the node doesn't show up after install, the usual suspects apply: confirm the clone actually landed inside custom_nodes/ (not a subfolder of it) and check the console log on startup for an import error - with no external dependencies to break, a missing node here is almost always an installation-path issue rather than a runtime one.
One more thing worth flagging: the pack's changelog stops at August 2024, so this has been stable and unmaintained-but-working for a while rather than actively growing. That's fine for a utility node this simple - there isn't much left to break - but don't go looking for recent updates or an active issue tracker if something's off; there just isn't much traffic there.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| min | FLOAT | 1.00โ10 | โ |
| max | FLOAT | 1.00โ10 | โ |
| seed | INT | 00โ18446744073709550000 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | โ |