ComfyUI  >  Nodes  >  ymc-node-suite-comfyui >  shuffle prompt

ComfyUI Node: shuffle prompt

Class Name

text-util-prompt-shuffle

Category
Ymc Suite/text-util
Author
YMC (Account age: 2735 days)
Extension
ymc-node-suite-comfyui
Latest Updated
5/22/2024
Github Stars
0.0K

How to Install ymc-node-suite-comfyui

Install this extension via the ComfyUI Manager by searching for  ymc-node-suite-comfyui
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ymc-node-suite-comfyui in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

shuffle prompt Description

Randomly shuffle text prompts for diverse AI-generated outputs with controlled token order and reproducibility.

shuffle prompt:

The text-util-prompt-shuffle node is designed to randomly shuffle the words or tokens in a given text prompt, providing a unique and varied output each time it is executed. This can be particularly useful for AI artists looking to generate diverse and creative text inputs for their projects. By shuffling the tokens, the node helps in breaking the monotony and introducing randomness, which can lead to unexpected and innovative results. The node also allows you to keep a specified number of tokens in their original order, adding a layer of control to the randomness. Additionally, you can set a seed value to ensure reproducibility of the shuffle, making it easier to experiment with different configurations and achieve consistent results.

shuffle prompt Input Parameters:

text

This parameter takes a string input that represents the text prompt you want to shuffle. The text can be a single line or multiple lines, and it will be processed to shuffle the tokens within it. The default value is an empty string.

keep_n_token

This parameter specifies the number of tokens to keep in their original order at the beginning of the text. It allows you to maintain some structure in the shuffled output. The value should be a string representing an integer, with the default value being "0". This means that by default, no tokens are kept in their original order.

seed

This parameter is an integer that sets the seed for the random number generator used in the shuffling process. By setting a specific seed value, you can ensure that the shuffle operation produces the same result each time it is executed with the same input text and seed. The seed value can range from 0 to 0xffffffffffffffff, with the default value being 0.

shuffle prompt Output Parameters:

STRING

The output is a single string that contains the shuffled text. The tokens in the input text are rearranged randomly, except for the specified number of tokens that are kept in their original order. This shuffled text can then be used as a new prompt for further processing or creative projects.

shuffle prompt Usage Tips:

  • To achieve a completely random shuffle, set the keep_n_token parameter to "0".
  • Use the seed parameter to reproduce the same shuffle result for consistency in experiments.
  • Experiment with different keep_n_token values to find the right balance between randomness and structure in your text prompts.

shuffle prompt Common Errors and Solutions:

Invalid seed value

  • Explanation: The seed value provided is not within the acceptable range.
  • Solution: Ensure that the seed value is an integer between 0 and 0xffffffffffffffff.

Non-integer keep_n_token

  • Explanation: The keep_n_token parameter is not a valid integer string.
  • Solution: Provide a valid integer string for the keep_n_token parameter, such as "0", "1", "2", etc.

Empty text input

  • Explanation: The text input is empty, resulting in no tokens to shuffle.
  • Solution: Provide a non-empty string for the text input to enable the shuffling process.

shuffle prompt Related Nodes

Go back to the extension to check out more related nodes.
ymc-node-suite-comfyui
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.