Visit ComfyUI Online for ready-to-use ComfyUI environment
Dynamically replace wildcards in text with values from predefined files for varied AI-generated content.
The JNodes_ParseWildcards
node is designed to dynamically replace wildcard notations within a given text string with specific values sourced from predefined text files. This node is particularly useful for AI artists who want to introduce variability and randomness into their prompts or descriptions. By defining wildcard files with multiple options, you can ensure that each instance of a wildcard in your text is replaced with a value from the corresponding file, either randomly or based on a specific index. This functionality allows for the creation of diverse and unique outputs from a single template, enhancing creativity and reducing repetitive patterns in generated content.
This parameter takes a string that contains wildcard notations, such as __HairColors__
. The wildcards will be replaced with values from corresponding text files. The input should be a multiline string to accommodate complex prompts or descriptions.
This parameter specifies the absolute path to the directory where the wildcard text files are stored. Each wildcard in the input text should have a corresponding text file in this directory, named after the wildcard (e.g., HairColors.txt
for __HairColors__
). This path should be a single-line string.
This parameter determines how the values from the wildcard files are selected. It can be set to either seed
or index
. If set to seed
, a random index is generated using the provided seed value. If set to index
, the value at the specified index in the file is used. If the index is out of bounds, the node reverts to seed
behavior. The available options are seed
and index
.
This parameter is an integer used to generate a random index when the mode is set to seed
. It ensures that the same seed will produce the same random selection, allowing for reproducibility. The default value is 0
, and the maximum value is 0xffffffffffffffff
.
This boolean parameter determines whether the same seed should be used for multiple occurrences of the same wildcard within the input text. If set to True
, all instances of a wildcard will be replaced with the same value. If set to False
, each instance will be replaced independently, potentially with different values. The default value is False
.
The output is a single string with all wildcard notations replaced by the corresponding values from the text files. This processed string can then be used in further stages of your AI art generation workflow.
seed
mode with a fixed seed value for reproducible results, which is useful for debugging or creating consistent outputs.use_same_seed_for_multiple_occurrences
to False
if you want more variability in your output, especially when the same wildcard appears multiple times in the input text.<wildcard_name>
index
and the provided seed value is outside the range of available lines in the text file.seed
mode for random selection.seed
or index
.0
to 0xffffffffffffffff
.© Copyright 2024 RunComfy. All Rights Reserved.