ComfyDeploy: How comfyui-text-randomizer works in ComfyUI?
What is comfyui-text-randomizer?
A simple text randomizer for ComfyUI that can generate random and surprising results
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
comfyui-text-randomizer
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI Text Randomizer 1.0.0
<sub>About | Custom nodes | Workflows | Tips</sub>
A simple text randomizer for ComfyUI that can generate random and surprising results.
Custom nodes
<sub>About | Custom nodes | Workflows | Tips</sub>
-
Text randomizer
The Text Randomizer node randomizes text placed between brackets. Options should be separated by
|
, and any text outside the brackets remains unchanged.Example: Input text:
[man|girl], sitting on a [bench|grass]
. Possible outcomes:- man, sitting on a bench
- girl, sitting on a bench
- man, sitting on a grass
- girl, sitting on a grass
Note: You can nest brackets to create more varied outcomes.
-
Text randomizer with check
Similar to
Text Randomizer
, but it displays a warning if brackets or parentheses are mismatched. This check happens in real time, so you don’t need to run the workflow to see the errors.Note: The check works separately for brackets and parentheses. For example, input like
[ ( ] )
will pass the check. -
Get one text or another at random
Returns one of two text options at random.
-
Concatenate text
Joins two pieces of text, adding
,
between them. -
Show text
Displays the final text you’ve generated. This is useful for debugging your prompts and checking what is fed into the TextEncoder.
Workflows
<sub>About | Custom nodes | Workflows | Tips</sub>
You can find example workflows in the /workflows
folder.
workflow.json
Demonstrates how to achieve similar text outputs in different ways, either by grouping separate topics and concatenating texts or putting everything into one node.
workflow2.json
Shows how to randomize two text nodes and return text from either one node or another.
Tips
<sub>About | Custom nodes | Workflows | Tips</sub>
-
You can use
Text Randomizer with Check
as a simple tool to check brackets without connecting it to anything. Just paste your text inside to see if your brackets or parentheses match. -
By adding
|
at the end of the expression, you can create an empty option. For example (spaces added for clarity):[ apple | banana | grapefruit | orange | ]
gives an equal chance to select "apple," "banana," "grapefruit," "orange," or nothing.
Other examples:- [apple|] gives a 50% chance of getting "apple" and 50% chance of getting nothing.
- [apple||] gives a 33.3% chance of getting "apple" and a 66.6% chance of getting nothing.