Skip to content

Commit a1958db

Browse files
committed
* Improved conditions with bool operations.
* Enhance PromptPostProcessorComfyUINode to return variables. * New PromptPostProcessorSelectVariableComfyUINode for selecting variables. * Fixed detection of Flux Schnell in Forge. * Improved documentation.
1 parent ce7b76f commit a1958db

File tree

13 files changed

+582
-457
lines changed

13 files changed

+582
-457
lines changed

.markdownlint.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"default": true,
33
"MD013": false,
4-
"MD024": false
4+
"MD024": false,
5+
"MD033": false
56
}

.vscode/launch.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"name": "Python Debugger: Attach using Process Id",
9+
"type": "debugpy",
10+
"request": "attach",
11+
"processId": "${command:pickProcess}"
12+
},
713
{
814
"name": "Tests",
915
"type": "debugpy",

README.md

Lines changed: 16 additions & 386 deletions
Large diffs are not rendered by default.

__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010

1111
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
1212

13-
from .ppp_comfyui import PromptPostProcessorComfyUINode
13+
from .ppp_comfyui import PromptPostProcessorComfyUINode, PromptPostProcessorSelectVariableComfyUINode
1414

15-
NODE_CLASS_MAPPINGS = {"ACBPromptPostProcessor": PromptPostProcessorComfyUINode}
16-
NODE_DISPLAY_NAME_MAPPINGS = {"ACBPromptPostProcessor": "ACB Prompt Post Processor"}
15+
NODE_CLASS_MAPPINGS = {
16+
"ACBPromptPostProcessor": PromptPostProcessorComfyUINode,
17+
"ACBPPPSelectVariable": PromptPostProcessorSelectVariableComfyUINode,
18+
}
19+
NODE_DISPLAY_NAME_MAPPINGS = {
20+
"ACBPromptPostProcessor": "ACB Prompt Post Processor",
21+
"ACBPPPSelectVariable": "ACB PPP Select Variable",
22+
}
1723

1824
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]

docs/CONFIG.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Prompt PostProcessor configuration
2+
3+
## ComfyUI specific (ACB Prompt Post Processor node)
4+
5+
### Inputs
6+
7+
* **model**: Connect here the MODEL or a string with the model class name used by *ComfyUI*. Needed for the model kind system variables.
8+
* **modelname**: Name of the model. Needed for the model name system variables and detection of pony (this also requieres for the model to be SDXL).
9+
* **seed**: Connect here the seed used. By default it is -1 (random).
10+
* **pos_prompt**: Connect here the prompt text, or fill it as a widget.
11+
* **neg_prompt**: Connect here the negative prompt text, or fill it as a widget.
12+
13+
Other common settings (see [below](#common-settings)) also appear as inputs or widgets.
14+
15+
### Outputs
16+
17+
The outputs are the final positive and negative prompt and a variables dictionary.
18+
19+
You can use the "**ACB PPP Select Variable**" node to choose one and output its value. You can use this to send only part of the prompt to, for example, a detailer node. For example:
20+
21+
With this prompt: `__quality__, 1girl, ${head:__eyes__, __hair__, __expression__}, __body__, __clothes__, __background__, __style__` then you extract the `head` variable and send that as prompt for the head/face detailer.
22+
23+
## A1111 (and compatible UIs) panel options
24+
25+
* **Force equal seeds**: Changes the image seeds and variation seeds to be equal to the first of the batch. This allows using the same values for all the images in a batch.
26+
* **Unlink seed**: Uses the specified seed for the prompt generation instead of the one from the image. This seed is only used for wildcards and choices.
27+
* **Prompt seed**: The seed to use for the prompt generation. If -1 a random one will be used.
28+
* **Incremental seed**: When using a batch you can use this to set the rest of the prompt seeds with consecutive values.
29+
30+
## Common settings
31+
32+
### General settings
33+
34+
* **Debug level**: what to write to the console. Note: in *SD.Next* debug messages only show if you launch it with the `--debug` argument.
35+
* **Model variant definitions**: definitions for model variants to be recognized based on strings found in the full filename.
36+
37+
The format for each line is (with *kind* being one of the base model identifiers or not defined):
38+
39+
```name(kind)=comma separated list of substrings (case insensitive)```
40+
41+
The default value defines strings for *Pony* and *Illustrious* models.
42+
* **Apply in img2img**: check if you want to do the processing in img2img processes (*does not apply to the ComfyUI node*).
43+
44+
### Wildcard settings
45+
46+
* **Process wildcards**: you can choose to process them with this extension or use a different one.
47+
* **Wildcards folders**: you can enter multiple folders separated by commas. In *ComfyUI* you can leave it empty and add a `wildcards` entry in the **extra_model_paths.yaml** file.
48+
* **What to do with remaining wildcards?**: select what do you want to do with any found wildcards.
49+
* **Ignore**: do not try to detect wildcards.
50+
* **Remove**: detect wildcards and remove them.
51+
* **Add visible warning**: detect wildcards and add a warning text to the prompt, that hopefully produces a noticeable generation.
52+
* **Stop the generation**: detect wildcards and stop the generation.
53+
* **Default separator used when adding multiple choices**: what do you want to use by default to separate multiple choices when the options allow it (by default it's ", ").
54+
* **Keep the order of selected choices**: if checked, a multiple choice construct will return them in the order they are in the construct.
55+
56+
### Send to negative prompt settings
57+
58+
* **Separator used when adding to the negative prompt**: you can specify the separator used when adding to the negative prompt (by default it's ", ").
59+
* **Ignore repeated content**: it ignores repeated content to avoid repetitions in the negative prompt.
60+
61+
### Clean up settings
62+
63+
* **Remove empty constructs**: removes attention/scheduling/alternation constructs when they are invalid.
64+
* **Remove extra separators**: removes unnecessary separators. This applies to the configured separator and regular commas.
65+
* **Remove additional extra separators**: removes unnecessary separators at start or end of lines. This applies to the configured separator and regular commas.
66+
* **Clean up around BREAKs**: removes consecutive BREAKs and unnecessary commas and space around them.
67+
* **Use EOL instead of Space before BREAKs**: add a newline before BREAKs.
68+
* **Clean up around ANDs**: removes consecutive ANDs and unnecessary commas and space around them.
69+
* **Use EOL instead of Space before ANDs**: add a newline before ANDs.
70+
* **Clean up around extra network tags**: removes spaces around them.
71+
* **Merge attention modifiers (weights) when possible**: it merges attention modifiers when possible (merges into one, multiplying their values). Only merges individually nested modifiers.
72+
* **Remove extra spaces**: removes other unnecessary spaces.
73+
74+
Please note that *ComfyUI* does not natively support the `BREAK` and `AND` constructs, but the related settings are kept in that UI.
75+
76+
### Content removal settings
77+
78+
* **Remove extra network tags**: removes all extra network tags.

0 commit comments

Comments
 (0)