Skip to content

nosiu/comfyui-text-randomizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI Text Randomizer 1.0.0

About | Custom nodes | Workflows | Tips

A simple text randomizer for ComfyUI that can generate random and surprising results.

image

Custom nodes

About | Custom nodes | Workflows | Tips

  • 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

About | Custom nodes | Workflows | Tips

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.

Zrzut ekranu 2025-03-02 200221

workflow2.json

Shows how to randomize two text nodes and return text from either one node or another.

Zrzut ekranu 2025-03-02 203735

Tips

About | Custom nodes | Workflows | Tips

  • 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.

About

A simple text randomizer for ComfyUI that can generate random and surprising results

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published