随机文本
Pick your prompt with RandomTextNode
- text
You've got three solid prompts and you can't pick. Or you're seed-farming and want each queue run to grab a different style without you editing the graph between runs. RandomTextNode is the tiny helper from the Mango Random pack that takes up to five text inputs, picks one, and hands it out as a plain string. It's prompt roulette, and it's the most useful node in this pack for the two seconds it takes to set up.
The name is slightly misleading in one way: it's not pure chaos. The node ships with two modes, both labeled in Chinese because the whole pack is a Chinese-language project. 完全随机 is "fully random," 顺序循环 is "sequential cycle." In random mode it reseeds Python's RNG with your seed value and picks one of the connected texts. In cycle mode it ignores the seed entirely and just walks through the list in order, wrapping around - handy when you want guaranteed variety across a batch of runs instead of occasional repeats.
Inputs and outputs that matter
Two required, five optional, one output. You'll touch most of them:
- seed - an INT, default 0, goes up to the full uint64 range. This is the one to understand: with a fixed seed, random mode picks the same text every run. That's deterministic, not broken. To actually roll the dice you have to advance the seed between runs.
- text1 through text5 - multiline STRING inputs. Only non-empty ones count; leave slots disconnected and they're skipped. You can wire in prompt fragments from other text nodes instead of typing.
- text (STRING output) - wire this into the
textinput of a CLIPTextEncode (prompt or negative), or into a filename-prefix field if you're doing batch roulette.
One nice behavior in the source: if you only connect a single text, the node just passes it through - no pointless RNG call.
How to install
Install it like any custom node - via ComfyUI Manager, search "Mango Random Nodes" and hit Install, then restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/mango-rgb/ComfyUI-Mango-Random-node
then restart ComfyUI. No model downloads, no heavy deps. The pack's requirements.txt lists opencv-python and imageio-ffmpeg, but those only matter for the video node - the text node runs on pure Python stdlib. Startup prints a cheerful mango-colored banner; ignore it.
Common issues and gotchas
The one that trips people up is the seed-vs-random misunderstanding above. Fix the seed and you fix the pick; bump the seed and the pick changes. If you want a new random choice on every single run, wire the seed from a node that randomizes per run.
Second: the mode dropdown and node display name are in Chinese (the node shows as 随机文本 in the menu). Non-Chinese speakers just learn the two strings - 完全随机 = random, 顺序循环 = cycle.
Third, if you queue with no text connected at all, the node throws a ValueError about needing at least one text input. That's ComfyUI's normal "node errored" red glow, not a crash.
A genuinely thin node, but it beats hand-editing prompt strings for the tenth time. If you only install one thing from the Mango pack, make it this.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| sort_mode | COMBO | 2 options: 完全随机, 顺序循环 | |
| seed | INT | 00–18446744073709550000 | — |
| text1opt | STRING | — | |
| text2opt | STRING | — | |
| text3opt | STRING | — | |
| text4opt | STRING | — | |
| text5opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |