Sample Tags With Weight:
The PromptUtilitiesSampleTagsWithWeight node is designed to enhance your creative process by allowing you to randomly sample tags from a given list and assign them weights. This node is particularly useful for AI artists who want to introduce variability and emphasis in their prompts. By sampling tags and assigning weights, you can create more dynamic and nuanced prompts that can lead to varied and interesting outputs from AI models. The node leverages randomness to select a subset of tags and assigns each a weight, which can influence the importance of each tag in the final prompt. This functionality is beneficial for generating diverse outputs and exploring different creative directions without manually adjusting each tag's significance.
Sample Tags With Weight Input Parameters:
tags
This parameter accepts a string of tags that you want to sample from. The tags can be separated by a specified delimiter, allowing you to input multiple tags in a structured format. The default value is an empty string, and it supports multiline input, making it easy to manage a large number of tags.
tags_delimiter
The tags_delimiter parameter determines how the tags are separated in the input string. You can choose between "new line" or a comma (,). This flexibility allows you to format your tags in a way that suits your workflow, whether you prefer listing them line by line or in a single line separated by commas.
seed
The seed parameter is an integer that initializes the random number generator. By setting a specific seed, you can ensure that the sampling process is repeatable, which is useful for achieving consistent results across different runs. The default value is 0, and it can range from 0 to 18,446,744,073,709,551,615.
max_k
This integer parameter specifies the maximum number of tags to sample. It allows you to control the upper limit of how many tags can be selected from the input list. The default value is 1, with a minimum of 1 and a maximum of 18,446,744,073,709,551,615.
min_k
The min_k parameter sets the minimum number of tags to sample. It ensures that at least a certain number of tags are selected, providing a lower bound for the sampling process. The default value is 1, with a minimum of 0 and a maximum of 18,446,744,073,709,551,615.
max_w
This parameter defines the maximum weight that can be assigned to a sampled tag. It is a floating-point number, allowing for precise control over the weight range. The default value is 1.0, with a range from -100 to 100 and a step of 0.01.
min_w
The min_w parameter sets the minimum weight for a sampled tag. Like max_w, it is a floating-point number, providing flexibility in defining the weight range. The default value is 0.8, with a range from -100 to 100 and a step of 0.01.
step_w
This parameter determines the step size for the weights assigned to the sampled tags. It is a floating-point number that allows you to control the granularity of the weight values. The default value is 0.1, with a range from -100 to 100 and a step of 0.01.
Sample Tags With Weight Output Parameters:
STRING
The output is a single string that contains the sampled tags, each paired with a randomly assigned weight. The format is "(tag:weight)", and the tags are joined by commas. This output can be directly used in AI models to influence the generation process, with the weights indicating the relative importance of each tag.
Sample Tags With Weight Usage Tips:
- To ensure consistent results across different runs, use the same seed value. This will allow you to reproduce the same set of sampled tags and weights.
- Experiment with different
max_kandmin_kvalues to explore various combinations of tags. This can help you discover new creative directions by varying the number of tags included in the prompt. - Adjust the
max_w,min_w, andstep_wparameters to fine-tune the weight distribution. This can be particularly useful if you want certain tags to have more influence over the generated output.
Sample Tags With Weight Common Errors and Solutions:
AssertionError: max_k must be greater than or equal to min_k.
- Explanation: This error occurs when the
max_kvalue is set lower than themin_kvalue, which is not allowed. - Solution: Ensure that
max_kis always greater than or equal tomin_kto avoid this error.
ValueError: Invalid delimiter specified.
- Explanation: This error might occur if an unsupported delimiter is used for separating tags.
- Solution: Use only the supported delimiters, which are "new line" or a comma (
,), to separate your tags.
