๐ง้ๆบๆ็คบ่ฏ่กๆๅ@็ฎ่ๅธ็ๅฐ่ฏพๅ :
The DapaoRandomPromptLineExtractNode is a versatile tool designed to extract random lines from a given multiline text input. This node is particularly useful for AI artists who work with large sets of prompt lines and need to randomly select a subset for creative purposes. The node allows you to specify the number of lines to extract and provides options for preprocessing the text, such as converting to uppercase, removing punctuation, or extracting only numeric characters. By leveraging a random seed, the node ensures reproducibility of results, making it a reliable component in workflows that require consistent outputs. Its primary goal is to streamline the process of handling and manipulating text data, offering a range of preprocessing options to tailor the output to specific needs.
๐ง้ๆบๆ็คบ่ฏ่กๆๅ@็ฎ่ๅธ็ๅฐ่ฏพๅ Input Parameters:
๐ ๅค่กๆๆฌ
This parameter accepts a multiline string input where each line represents a candidate prompt. It serves as the source from which random lines will be extracted. The default value is an empty string, and it supports multiline input to accommodate extensive prompt lists.
๐งฐ ๅญ็ฌฆไธฒ้ขๅค็
This parameter allows you to specify how the text should be preprocessed before extraction. Options include "ไธๆนๅ" (no change), "ๅๆฐๅญ" (extract numbers), "ๅๅญๆฏ" (extract letters), "่ฝฌๅคงๅ" (convert to uppercase), "่ฝฌๅฐๅ" (convert to lowercase), "ๅไธญๆ" (extract Chinese characters), "ๅปๆ ็น" (remove punctuation), "ๅปๆข่ก" (remove newlines), "ๅป็ฉบ่ก" (remove empty lines), "ๅป็ฉบๆ ผ" (remove spaces), "ๅปๆ ผๅผ" (normalize formatting), and "็ป่ฎกๅญๆฐ" (count characters). The default option is "ไธๆนๅ".
๐ข ๆๅ่กๆฐ
This integer parameter determines the number of lines to extract from the input text. It ranges from 1 to 9999, with a default value of 1. This allows you to control the volume of extracted data based on your specific requirements.
๐ฒ ้ๆบ็งๅญ
The random seed parameter is an integer that influences the randomness of line selection. It ranges from 0 to 0x7FFFFFFF, with a default value of 0. Setting a specific seed ensures that the same lines are extracted in repeated runs, providing consistency in outputs.
๐ง้ๆบๆ็คบ่ฏ่กๆๅ@็ฎ่ๅธ็ๅฐ่ฏพๅ Output Parameters:
๐ ๆๅ็ปๆ
This output provides the extracted lines as a list of strings. The lines are selected based on the specified number of lines to extract and any preprocessing options applied. This output is crucial for generating varied and creative prompts from a larger dataset.
๐ข ๅญๆฐ
This integer output represents the total number of non-space characters in the extracted lines. It is particularly useful when the "็ป่ฎกๅญๆฐ" preprocessing option is selected, providing a quick count of characters for further analysis or constraints.
๐ง้ๆบๆ็คบ่ฏ่กๆๅ@็ฎ่ๅธ็ๅฐ่ฏพๅ Usage Tips:
- To ensure consistent results across different runs, set a specific value for the random seed parameter.
- Use the preprocessing options to tailor the extracted text to your needs, such as removing punctuation for cleaner outputs or converting text to uppercase for emphasis.
- When working with large datasets, consider extracting a smaller number of lines to maintain focus and manageability.
๐ง้ๆบๆ็คบ่ฏ่กๆๅ@็ฎ่ๅธ็ๅฐ่ฏพๅ Common Errors and Solutions:
Empty Input Text
- Explanation: This error occurs when the input text is empty or contains only whitespace.
- Solution: Ensure that the input text parameter contains valid lines of text before running the node.
Invalid Pick Count
- Explanation: This error arises when the specified number of lines to extract exceeds the number of available lines in the input.
- Solution: Adjust the pick count to be less than or equal to the number of lines in the input text.
Unsupported Preprocessing Option
- Explanation: This error happens if an invalid preprocessing option is selected.
- Solution: Verify that the preprocessing option is one of the supported choices listed in the input parameters.
