Prompt Palette:
The PromptPalette node is designed to streamline and enhance the process of text manipulation within the ComfyUI environment. Its primary function is to process and format text inputs by applying specific rules and transformations, making it an invaluable tool for AI artists who need to prepare text prompts for various creative applications. By allowing you to define delimiters, manage line breaks, and optionally add prefixes, the node provides a flexible and efficient way to customize text outputs. This capability is particularly beneficial when dealing with large volumes of text or when precise formatting is required to achieve the desired artistic effect. The node's ability to filter out unnecessary lines and comments ensures that only relevant content is processed, thereby optimizing the workflow and reducing manual editing efforts.
Prompt Palette Input Parameters:
text
The text parameter is a multiline string input that serves as the primary content to be processed by the node. It allows you to input any text that you wish to format or manipulate. The node will process each line of this text according to the specified rules, such as removing comments or adding delimiters. This parameter is crucial as it forms the basis of the node's operation, and its content directly influences the final output. There are no minimum or maximum values, but the default is an empty string.
delimiter
The delimiter parameter determines how each line of text will be separated or ended. You can choose from three options: "comma", "space", or "none". Selecting "comma" will append a comma to each line, "space" will add a space, and "none" will leave the lines unchanged. This parameter is essential for controlling the flow and readability of the output text, especially when preparing prompts that require specific formatting. The default value is "comma".
line_break
The line_break parameter is a boolean that specifies whether the processed lines should be joined with line breaks. If set to true, each line will be separated by a newline character in the output, preserving the original line structure. If false, the lines will be concatenated into a single continuous string. This parameter is important for maintaining the intended structure of the text, particularly when line breaks are significant for the prompt's interpretation. The default value is true.
prefix
The prefix parameter is an optional string that, if provided, will be prepended to the entire processed text. This allows you to add a consistent starting phrase or keyword to your output, which can be useful for thematic or stylistic purposes. The prefix is only added if the resulting text is not empty, ensuring that it does not appear unnecessarily. There are no default values, but the parameter is forced to be input if used.
Prompt Palette Output Parameters:
STRING
The output parameter is a single string that represents the fully processed and formatted text based on the input parameters. This output is the culmination of all transformations applied to the input text, including the removal of comments, addition of delimiters, and any specified prefix. The resulting string is ready for use in subsequent nodes or applications, providing a clean and tailored text prompt that meets your specific requirements.
Prompt Palette Usage Tips:
- To ensure that your text prompts are clean and free of unnecessary comments, make sure to use the node's ability to filter out lines starting with "//" or containing inline comments.
- Experiment with different delimiter settings to see how they affect the readability and flow of your text prompts, especially when preparing them for different AI models or creative tasks.
- Use the prefix option to add thematic or contextual information to your prompts, which can help guide the AI's interpretation and output.
Prompt Palette Common Errors and Solutions:
Empty Output
- Explanation: This error occurs when the input text is entirely composed of empty lines or comments, resulting in no content to process.
- Solution: Ensure that your input text contains meaningful content and is not solely made up of comments or blank lines.
Invalid Delimiter Option
- Explanation: This error happens if an unsupported delimiter option is selected.
- Solution: Verify that the delimiter parameter is set to one of the valid options: "comma", "space", or "none".
