Visit ComfyUI Online for ready-to-use ComfyUI environment
Versatile prompt string manipulation node for ComfyUI, enabling trimming and retention based on probabilistic and deterministic strategies.
The PromptSplitter is a versatile node designed for ComfyUI that allows you to manipulate prompt strings by trimming or retaining specific sections based on various probabilistic and deterministic strategies. This node is particularly useful for AI artists who want to experiment with different parts of a prompt to see how it affects the output of their AI models. By using this node, you can control which parts of a prompt are kept or removed, providing a powerful tool for refining and optimizing your creative process. The PromptSplitter can handle prompts in a flexible manner, allowing you to protect certain sections from being trimmed and to apply different strategies for section removal, such as random or position-based trimming. This makes it an essential tool for those looking to fine-tune their AI-generated art by experimenting with different prompt configurations.
This parameter represents the input prompt string that you want to process. It can be a multiline string, allowing you to work with complex prompts that span multiple lines. The string parameter is the core input that the node will split and manipulate based on the other parameters.
The quantity parameter determines the number of sections to either keep or remove from the prompt, depending on the quantity_mode. It has a default value of 1, with a minimum of 0 and a maximum of 100. This parameter directly influences how much of the prompt is retained or discarded, allowing you to control the extent of the trimming process.
This parameter specifies how the quantity is interpreted, with options "REMOVE" and "KEEP". In "REMOVE" mode, the node will remove the specified number of sections based on the selected mode. In "KEEP" mode, the node ensures that the final prompt contains exactly the specified number of sections, trimming the rest. The default setting is "REMOVE", and this parameter is crucial for determining the overall strategy of the prompt manipulation.
The keep_first_sections parameter allows you to protect a certain number of sections at the beginning of the prompt from being trimmed. It has a default value of 0, with a minimum of 0 and a maximum of 100. This parameter is useful for ensuring that important introductory sections of your prompt remain intact, regardless of the trimming strategy applied to the rest of the prompt.
This parameter defines the strategy used for selecting which sections to remove. Options include "RANDOM", "RANDOM_GRADUAL", "RANDOM_EXPONENTIAL", "RANDOM_SQRT", "RANDOM_MIDDLE", "TRIM_BEGINNING", and "TRIM_END". Each mode offers a different approach to section removal, from random selection to position-based trimming. The default mode is "RANDOM", and this parameter allows you to experiment with different trimming strategies to achieve the desired effect in your AI-generated art.
The delimiter parameter specifies the character or string used to split the prompt into sections. The default delimiter is a comma (,), but you can customize it to suit the structure of your prompt. This parameter is essential for correctly parsing the prompt into manageable sections for processing.
The seed parameter is an integer used for random number generation, ensuring reproducibility of results. It has a default value of 0, with a minimum of 0 and a maximum of 2,147,483,647. A seed value of 0 means a new random seed is used each run, while any other value will produce consistent results across runs. This parameter is important for achieving consistent and repeatable outcomes when using random-based trimming strategies.
The Trimmed output is a string that contains the sections of the prompt that have been retained after processing. This output represents the final version of the prompt that you can use for further AI model input or analysis. It reflects the application of the selected trimming strategy and any protected sections specified by the input parameters.
The Scraps output is a string that contains the sections of the prompt that were removed during processing. This output allows you to see which parts of the original prompt were discarded, providing insight into the effects of the trimming strategy and helping you refine your prompt manipulation techniques.
mode settings to see how they affect the final prompt. For example, use "RANDOM_MIDDLE" to focus trimming on the middle sections of your prompt.keep_first_sections parameter to protect important introductory sections of your prompt, ensuring they remain intact regardless of the trimming strategy.seed value to achieve consistent results across multiple runs, which is useful for comparing the effects of different parameter settings.delimiter. Check for any unintended whitespace or empty sections in your input prompt.quantity parameter is set to a value that exceeds the number of available sections in the prompt.quantity parameter to a value that is within the range of available sections in your prompt. Consider using the "KEEP" mode to ensure the final prompt has the desired number of sections.seed parameter is set to a value outside the allowed range.seed value is within the valid range of 0 to 2,147,483,647. Adjust the seed value accordingly to avoid this error.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.