Simple Wildcards:
SimpleWildcards adds variation to text by replacing choices written inside curly braces with one randomly selected option. For example, a `{red|blue}` sky can become a red sky or a blue sky. It is useful for trying prompt variations without writing a separate prompt for every combination. Each matching set of choices is selected independently, while text outside those sets remains unchanged.
Simple Wildcards Input Parameters:
text
The required, multiline STRING containing the text to process. Write alternatives inside curly braces and separate them with vertical bars, such as a portrait in {watercolor|oil paint|charcoal}. The node randomly selects one alternative from each matching set and removes surrounding spaces from the selected alternative; any text outside matching sets stays as written. The source specifies no default value, minimum or maximum length, or preset options.
Simple Wildcards Output Parameters:
string
The STRING containing the processed text. Each recognized set of alternatives is replaced by one randomly selected choice, so the result may differ between executions. If the text contains no matching set, the output is the same as the input. This is the text you can pass to the next node in a prompt workflow.
Simple Wildcards Usage Tips:
- Use
{choice one|choice two|choice three}to vary a specific part of a prompt while keeping the rest consistent. For example,a `{fox|owl}` in a {forest|garden}makes a separate random selection for each set. - Keep every alternative meaningful. An extra separator, as in
{red|}, creates an empty option that can remove that part of the prompt when selected. - Use complete, compatible phrases when alternatives have different grammar. For example,
{a fox|an owl}avoids producing an awkward article. - Do not rely on this node to provide a fixed or repeatable selection. Its source makes random choices and provides no seed setting.
Simple Wildcards Common Errors and Solutions:
No replacement appears
- Explanation: The text may not contain a matching pair of curly braces with content inside. For example,
{}is not replaced. The node source does not define a specific error message for this situation. - Solution: Add content between the braces, such as
{red|blue}, and check that the closing brace is present.
Part of the prompt is sometimes missing
- Explanation: An empty alternative, such as the one after the separator in
{red|}, can be randomly selected. This is a possible result, not a reported error. - Solution: Remove the extra separator or replace the empty alternative with a word or phrase.
A vertical bar is treated as a choice separator
- Explanation: Inside a matching set of braces, the node splits the content at every
|. It has no special handling for a vertical bar intended as literal text. - Solution: Keep literal vertical bars outside wildcard braces, or reword the alternatives so they do not need one.
Results differ between executions
- Explanation: The node selects alternatives randomly, and its source provides no seed or fixed-choice option. It also signals that its result may change between evaluations.
- Solution: Use only one alternative when you need fixed wording, or use the resulting text elsewhere in your workflow when you need to retain a particular selection.
