comfyui-text-randomizer

comfyui-text-randomizer
★ 1

文本随机化提示增强数据增强ComfyUI节点
对方括号内选项按“|”随机选取,支持嵌套,生成多样化提示文本,便于创意与数据增强。
💡 为提示词生成随机变体,提升创意与多样性。
🍴 1 Forks💻 JavaScript🔄 2025-03-03
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/6862a2001521
image
Zrzut ekranu 2025-03-02 200221
Zrzut ekranu 2025-03-02 203735
📄 README

ComfyUI Text Randomizer 1.0.0

About | Custom nodes | Workflows | Tips

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

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.

    workflow2.json

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

    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.