The wildcard feature is a functionality that allows random selection from multiple text files described as prompt texts using placeholders like __flower__
. It assists in choosing and using a random prompt text among the specified files.
You can find the instructions on how to use it in the YouTube video.
ImpactWildcardProcessor
is a functionality that operates at the browser level. When running the queue prompt,ImpactWildcardProcessor
generates the text.ImpactWildcardProcessor
node has two text input fields, but the input using wildcards is only valid in the upper text input box, which is the Wildcard Prompt.- In the bottom mode settings, there are two options: Populate and Fixed. When set to Populate, running the queue prompt will process the prompt with wildcards used in the upper Wildcard Prompt section and populate the generated text in the bottom Populated Prompt section.
- In the case of Populate, when running the queue prompt, the text generated by the Wildcard Prompt will be entered into the Populated Prompt, and the Populated Prompt will be in a read-only state, where user input is not possible. In the case of Fixed, the Wildcard Prompt is ignored, and the Populated Prompt becomes editable, allowing user editing.
- When using
ImpactWildcardProcessor
to generate images, the mode is set to Fixed, and the populated text is already entered when the image is saved. ImpactWildcardEncode
is similar toImpactWildcardProcessor
but offers the loading functionality of LoRAs. Populated prompts are encoded using the provided clip after all lora loading is completed. All loaded LoRAs are applied to themodel
andclip
and then returned.
-
ImpactWildcardProcessor
supports two main types of grammar: dynamic prompts using the format{a|b|c}
, and wildcards using the format__wildcard__
. -
Dynamic prompts in
ImpactWildcardProcessor
allow nesting, such as{a|{d|e|f}|c}
, where items separated by | are randomly selected, including nested options. -
If you use a dynamic prompt like
{blue apple|red {cherry|berry}|green melon}
, one option will be randomly selected from the following choices:blue apple, red cherry, red berry,
orgreen melon
. -
If there is a file named
person.txt
inside the wildcards directory, using the wildcard__person__
will randomly select one item from within that file. -
You can also use compound grammar like
1{girl is holding {blue pencil|red __safruit__|colorful __flower__}|boy is riding __vehicle__}
. -
You can set the selection probability by prefixing a number as in
{5::red|4::green|7::blue|black}
. Each item's selection probability is normalized to 100% based on the sum of all items within the {} brackets, distributing the probabilities evenly.- NOTICE: The selection weight syntax has been updated. Now you should use
{5::red|4::green|7::blue|black}
instead of the previous{5:red|4:green|7:blue|black}
syntax.
- NOTICE: The selection weight syntax has been updated. Now you should use
-
The pattern inside
__
is case-insensitive. In other words,__Jewel__
and__jewel__
are treated as identical. -
*
serves as an aggregation pattern, allowing you to group all items from the person path and its wildcard files into one collection, from which you can make selections.- Supported in V4.15.1 or above
-
Multi-select '$$': Select multiple items from the available choices.
- {n1-n2$$sel1|sel2|...} - Select between n1 and n2 items from the available choices. If the range exceeds the number of available options, the excess will be ignore d.
- {-n$$sel1|sel2|...} - Select between 1 and n items.
- {n$$sel1|sel2|...} - Select n items.
- custom seperator
{n$$ and $$sel1|sel2|...}
- Select n items using ' and ' as a separator.{n1-n2$$ or $$sel1|sel2|...}
- Select between n1 and n2 items using ' or ' as a separator.
-
Quantifying wildcard:
count#wildcards
repeats wildcards many as count{2$$, $$5#__wildcards__}
turns into{2$$, $$__wildcards__|__wildcards__|__wildcards__|__wildcards__|__wildcards__}
-
comment-out: Lines starting with
#
are treated as comments and removed. The text following a comment is considered to be separated by a single blank space from the text before the comment.input:
first {a|b|c} second # not a comment, # this is a comment trailing text newline text
populated:
first a second # not a comment, trailing text newline text
- When converting Seed to input, only
ImpactInt
andSeed (rgthree)
are allowed as input.- The wildcard feature of Impact/Inspire needs to be determined before the workflow is executed since it requires storing information populated in the workflow.
- It is not possible to receive the execution results of other nodes as input. Even if you use
ImpactInt
orSeed (rgthree)
, the current prompt only reads the superficial input provided in the prompt and does not utilize the execution results of other nodes.
<lora:loraname:model_weight:clip_weight>
: In a wildcard prompt, you can directly specify LoRA to load. If you omit theclip_weight
, it is treated the same asmodel_weight
.BREAK
: Separately encode the prompts and connect them usingConditioning (Concat)
.
-
Start the prompt by placing
[ASC]
,[DSC]
,[ASC-SIZE]
,[DSC-SIZE]
,[RND]
,[LAB]
,[CONCAT]
at the very beginning.- ASC: Ascending order (x, y)
- DSC: Descending order (x, y)
- ASC-SIZE: Ascending order (area size)
- DSC-SIZE: Descending order (area size)
- RND: Random
- LAB: label
[ASC]
,[DSC]
,[ASC-SIZE]
,[DSC-SIZE]
,[RND]
denotes the order of SEGS' bboxes. The left of the bbox takes precedence as the primary criterion, and the top is the secondary criterion.
- CONCAT: Instead of replacing the positive conditioning with the wildcard_opt, Concatenate the wildcard conditioning with the positive conditioning using the
Conditioning Concat
.
-
[SEP]
is used to separate prompts for each detection area (SEG). -
When
[SKIP]
is used in the prompt, the Detailing for that SEG is skipped. -
When
[STOP]
is used in the prompt, the Detailing is stopped, including the SEG where it appears.e.g.
[ASC] 1girl, blue eyes, smile [SEP] 1boy, brown eyes [SEP]
- Detection regions are sorted in ascending order based on x, y coordinates, and Detailing is performed sequentially from left to right using the prompts
1girl, blue eyes, smile
and1boy, brown eyes
.
e.g.
[DSC-SIZE] sun glasses[SEP] [SKIP][SEP] blue glasses[SEP] [STOP]
- Multiple faces are sorted in descending order based on the area of their detection regions. The second largest face is skipped. The largest face and the third largest face are Detailed using the prompts
sun glasses
andblue glasses
respectively. The remaining faces are not Detailed.
- Detection regions are sorted in ascending order based on x, y coordinates, and Detailing is performed sequentially from left to right using the prompts
[LAB]
is based on the application according to labels. Each label can appear only once, and[ALL]
functions as a prefix.
e.g.
[LAB]
[ALL] laugh, detailed eyes
[Female] blue eyes
[Male] brown eyes
e.g.
[CONCAT]detailed eyes, faint smile face
- If the Inspire Pack is installed, you can use Lora Block Weight in the form of
LBW=lbw spec;
. If theInspire Pack
is not installed, this spec will be ignored. - "The 'spec' within
LBW=spec
internally uses semicolons (;) as separators.". It is recommended to end the LBW spec definition with a semicolon (;). If it ends without a semicolon, specifying the weight afterward may result in a specification error. - Specs that come after
LBW=
withoutA=
orB=
are applicable for use in theInspire Pack
'sLora Loader (Block Weight)
node. Specs provided withA=
orB=
are inputted as parameters for theA
andB
parameters of theLora Loader (Block Weight)
node.- For detailed information about LBW, please refer to this link.
- EX)
<lora:chunli:1.0:1.0:LBW=B11:0,0,0,0,0,0,0,0,0,0,A,0,0,0,0,0,0;A=0.;>
<lora:chunli:1.0:1.0:LBW=0,0,0,0,0,0,0,0,0,0,A,B,0,0,0,0,0;A=0.5;B=0.2;>
<lora:chunli:1.0:1.0:LBW=SD-MIDD;>
- If you use wildcards with files, you can save frequently used prompts in a file and load them for usage. For example, if you have a line composed of
photorealistic:1.4, best quality:1.4
and save it asppos.txt
in the custom_wildcards directory, you can create prompts in a concise form like__ppos__
, beautiful nature.
- Under the ComfyUI-Impact-Pack/ directory, there are two paths: custom_wildcards and wildcards. Both paths are created to hold wildcards files, but it is recommended to avoid adding content to the wildcards file in order to prevent potential conflicts during future updates.
- The wildcard supports subfolder feature.
- For example, if there is a wildcard file named
custom_wildcards/obj/person.txt
, it should be used as__obj/person__
instead of__person__
. - NOTICE: The subfolder feature was not supported in older versions. The subfolder feature is a newly updated functionality.
- For example, if there is a wildcard file named
-
.yaml
wildcards file supports. (V4.18.4)- You can download and use Wildcard YAML files in this format.
- For example, if a YAML file is structured like the following, you can use
__astronomy/Celestial-Bodies__
and__surface-swap__
as wildcards, and one of the item inside can be chosen.
astronomy: Celestial-Bodies: - Star - Planet ... surface-swap: - swap the surfaces for - replace the surfaces with ...
-
Within the wildcard, the items to be randomly selected should be placed one per line.
-
If items are entered on a single line separated by commas, the entire line will be considered as one item.
-
Below is the content of the file flower.txt. If written as follows, using
__flower__
in the prompt text will randomly select one fromrose, orchid, iris, carnation, lily, daisy, chrysanthemum, daffodil, and dahlia
.