Random Prompt Cyan
Wildcards that re-roll a new prompt on every single run
- STRING
If you've ever sat there hand-editing a prompt, hitting Queue, and crossing your fingers that the composition comes out different this time - this node is for you. Random Prompt Cyan is a wildcard node from the small, Chinese-language pack ComfyUi Random Manage Cyan, built around the author's nai3 (NovelAI) auto-run habit: batch a hundred images, let each run draw a random prompt from a pile of text files, and curate what survives. It's niche, it's rough around the edges, and it does exactly one thing well: turn <>-style wildcard tags into fresh random text every single run.
The name and the metadata undersell it. Despite being categorized under "conditioning" with a description that claims it encodes a prompt with a CLIP model, this node does no encoding at all. It's a pure string transformer. It takes your prompt, substitutes wildcards, and hands you back a STRING - you still need a CLIP Text Encode node downstream to actually turn it into conditioning. The tooltip boilerplate is copy-pasted from a text encoder, so trust the code, not the label.
How it works
You get two prompt boxes, input_prompt_1 and input_prompt_2, which get merged with a comma between them (the second is skipped if empty). Into that text you drop wildcard tags, and there are two flavors:
<随机提示词>- "random prompt" in Chinese. The node picks a random.txtfile from whatever folder you put infolder_pathand uses that file's entire contents as the replacement. Use this for full multi-tag prompt blocks you want to swap in wholesale.<文件名>- a tag like<动作>("action") reads动作.txtfrom the folder infile_pathand swaps in a random single line. One line per wildcard option, and you can chain as many tags as you like.
The mechanism is dead simple: the prompt is split on commas, each tag is matched against a regex for <...>, and whichever wildcard class matches does a random.choice. The detail that matters for batch work is IS_CHANGED returning True - that's the node telling ComfyUI to re-execute unconditionally, so every queue run re-rolls the picks. No stale cached output, no "why did it repeat three times". If you're batching for variety, that's the whole point.
The inputs that matter
input_prompt_1/input_prompt_2- your base prompt plus the randomized part, both multiline. ThedynamicPromptsflag is set on them too, so{a|b|c}bracket syntax works inside if your setup supports it.folder_path- the按文件抽取(by-file) folder for<随机提示词>tags. Default value is the Chinese label "Wildcard按文件抽取路径" - you must point it at a real directory.file_path- the按行抽取(by-line) folder for<文件名>tags.
The single output, STRING, wires straight into a CLIP Text Encode positive input (or any string consumer). The pack ships no wildcard text files - the wildcard/ folder contains only code - so you create your own .txt files and drop them in.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/CyanAutumn/ComfyUi_Random_Manage_Cyan
then restart ComfyUI. Or just search "ComfyUi Random Manage Cyan" in ComfyUI Manager. There is no requirements.txt, no models to download, no heavy dependencies - it's pure Python stdlib (re, os, random), which is refreshing. The catch is the flip side of being a fresh pack: it imports the newer comfy.comfy_types API, so the README warns that older ComfyUI builds won't find the node. If it doesn't appear after restart, update ComfyUI first.
Where people get burned
- The by-line (
<文件名>) feature is Windows-only in practice.wildcard_file.pybuilds its path with a literal backslash separator (f"{path}\{name}.txt"). On Linux or macOS that's a filename that doesn't exist, and you'll get aFileNotFoundErroron any run that draws that tag. The by-folder<随机提示词>feature usesos.path.join, so it's cross-platform - use that on non-Windows, or hand-edit the path join. - Output is STRING, not CONDITIONING. Forget the category and the tooltip; if you plug this directly into a sampler you'll get a type error.
- It splits on commas. A wildcard tag nested inside a larger phrase without comma separation won't be matched. Keep tags as their own comma-separated tokens.
It's a utilitarian node from a single author, not a polished ecosystem player - but for "batch 50, get 50 different prompts, no plugins" it's genuinely one of the simplest tools for the job.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| input_prompt_1 | STRING | The text to be encoded. | |
| input_prompt_2 | STRING | The text to be encoded. | |
| folder_path | STRING | Wildcard按文件抽取路径 | wildcard folder |
| file_path | STRING | Wildcard按行抽取路径 | wildcard file |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | A conditioning containing the embedded text used to guide the diffusion model. |