Visit ComfyUI Online for ready-to-use ComfyUI environment
Randomly rearranges text lines for creative writing and data scrambling.
The ShuffleTextLines
node is designed to randomly rearrange the lines of a given text input. This node is particularly useful when you want to introduce an element of randomness or unpredictability into your text processing tasks. By shuffling the lines, you can create variations in text presentation, which can be beneficial for creative writing, generating unique text outputs, or simply for data scrambling purposes. The node operates by taking a block of text and a specified delimiter to identify line breaks, then it randomly reorders these lines to produce a new sequence. This functionality can be a powerful tool for AI artists looking to experiment with text manipulation and explore new creative possibilities.
The input_text
parameter is the main body of text that you want to shuffle. It accepts a string input and supports multiline text, allowing you to input paragraphs or lists of text. The content of this parameter is split into lines based on the specified delimiter, and these lines are then shuffled. There is no minimum or maximum length for the text, but the default value is an empty string, meaning you need to provide some text for the node to function effectively.
The delimiter
parameter specifies the character or string used to determine where the text should be split into lines. By default, this is set to "分隔符", but you can change it to any character or string that suits your text structure, such as a newline character (\n
) or a comma. The choice of delimiter directly impacts how the text is divided into lines, which in turn affects the shuffling process. If the delimiter is left empty, the node will default to splitting the text by lines.
The output of the ShuffleTextLines
node is a single string that contains the shuffled lines of the input text. This output maintains the same content as the input but in a different order, providing a new arrangement of the text lines. The shuffled text can be used for further processing or as a final output, depending on your needs. The randomness of the output can add a unique twist to text-based projects, making it a valuable tool for creative applications.
ShuffleTextLines
node in combination with other text processing nodes to create complex text manipulation workflows, enhancing the creative potential of your projects.ValueError
might occur if there is an issue with processing the input text or delimiter.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.