Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
956a47adbc | ||
|
|
faa55704cc |
@@ -23,7 +23,7 @@ class PromptPostProcessor: # pylint: disable=too-few-public-methods,too-many-in
|
||||
"""
|
||||
|
||||
NAME = "Prompt Post-Processor"
|
||||
VERSION = (2, 5, 0)
|
||||
VERSION = (2, 5, 2)
|
||||
|
||||
class IFWILDCARDS_CHOICES(Enum):
|
||||
ignore = "ignore"
|
||||
@@ -74,7 +74,9 @@ class PromptPostProcessor: # pylint: disable=too-few-public-methods,too-many-in
|
||||
self.wil_process_wildcards = options.get("process_wildcards", True)
|
||||
self.wil_keep_choices_order = options.get("keep_choices_order", False)
|
||||
self.wil_choice_separator = options.get("choice_separator", self.DEFAULT_CHOICE_SEPARATOR)
|
||||
self.wil_ifwildcards = self.IFWILDCARDS_CHOICES(options.get("if_wildcards", self.IFWILDCARDS_CHOICES.ignore.value))
|
||||
self.wil_ifwildcards = self.IFWILDCARDS_CHOICES(
|
||||
options.get("if_wildcards", self.IFWILDCARDS_CHOICES.ignore.value)
|
||||
)
|
||||
# Send to negative options
|
||||
self.stn_ignore_repeats = options.get("stn_ignore_repeats", True)
|
||||
self.stn_join_attention = options.get("stn_join_attention", True)
|
||||
@@ -405,6 +407,8 @@ class PromptPostProcessor: # pylint: disable=too-few-public-methods,too-many-in
|
||||
tuple: A tuple containing the processed prompt and negative prompt.
|
||||
"""
|
||||
try:
|
||||
if seed == -1:
|
||||
seed = np.random.randint(0, 2**32)
|
||||
self.rng = np.random.default_rng(seed & 0xFFFFFFFF)
|
||||
prompt = original_prompt
|
||||
negative_prompt = original_negative_prompt
|
||||
|
||||
+7
-7
@@ -45,13 +45,6 @@ class PromptPostProcessorComfyUINode:
|
||||
"forceInput": True,
|
||||
},
|
||||
),
|
||||
"seed": (
|
||||
"INT",
|
||||
{
|
||||
"default": None,
|
||||
"forceInput": False,
|
||||
},
|
||||
),
|
||||
"pos_prompt": (
|
||||
"STRING",
|
||||
{
|
||||
@@ -70,6 +63,13 @@ class PromptPostProcessorComfyUINode:
|
||||
),
|
||||
},
|
||||
"optional": {
|
||||
"seed": (
|
||||
"INT",
|
||||
{
|
||||
"default": -1,
|
||||
"forceInput": False,
|
||||
},
|
||||
),
|
||||
"debug_level": (
|
||||
[e.value for e in DEBUG_LEVEL],
|
||||
{
|
||||
|
||||
@@ -150,7 +150,7 @@ class PromptPostProcessorA1111Script(scripts.Script):
|
||||
options = {
|
||||
"debug_level": getattr(opts, "ppp_gen_debug_level", DEBUG_LEVEL.none.value),
|
||||
"pony_substrings": getattr(opts, "ppp_gen_ponysubstrings", PromptPostProcessor.DEFAULT_PONY_SUBSTRINGS),
|
||||
"process_wildcards": getattr(opts, "ppp_wil_process_wildcards", True),
|
||||
"process_wildcards": getattr(opts, "ppp_wil_processwildcards", True),
|
||||
"if_wildcards": getattr(opts, "ppp_wil_ifwildcards", PromptPostProcessor.IFWILDCARDS_CHOICES.ignore.value),
|
||||
"choice_separator": getattr(opts, "ppp_wil_choice_separator", PromptPostProcessor.DEFAULT_CHOICE_SEPARATOR),
|
||||
"keep_choices_order": getattr(opts, "ppp_wil_keep_choices_order", False),
|
||||
|
||||
Reference in New Issue
Block a user