Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f59b3e51a5 | ||
|
|
496117e004 |
@@ -25,7 +25,7 @@ class SendToNegativeScript(scripts.Script):
|
||||
self.callbacks_added = True
|
||||
|
||||
def title(self):
|
||||
return f"{SendToNegative.NAME} v{SendToNegative.VERSION}"
|
||||
return SendToNegative.NAME
|
||||
|
||||
def show(self, is_img2img):
|
||||
return scripts.AlwaysVisible
|
||||
@@ -36,6 +36,12 @@ class SendToNegativeScript(scripts.Script):
|
||||
p.all_prompts[i], p.all_negative_prompts[i] = stn.process_prompt(
|
||||
p.all_prompts[i], p.all_negative_prompts[i]
|
||||
)
|
||||
# make it compatible with A1111 hires fix
|
||||
if hasattr(p, "all_hr_prompts") and hasattr(p, "all_hr_negative_prompts"):
|
||||
for i in range(len(p.all_hr_prompts)): # pylint: disable=consider-using-enumerate
|
||||
p.all_hr_prompts[i], p.all_hr_negative_prompts[i] = stn.process_prompt(
|
||||
p.all_hr_prompts[i], p.all_hr_negative_prompts[i]
|
||||
)
|
||||
|
||||
def __on_ui_settings(self):
|
||||
section = ("send-to-negative", SendToNegative.NAME)
|
||||
|
||||
+6
-2
@@ -6,7 +6,7 @@ import lark
|
||||
|
||||
class SendToNegative: # pylint: disable=too-few-public-methods
|
||||
NAME = "Send to Negative"
|
||||
VERSION = "2.1.3"
|
||||
VERSION = "2.1.4"
|
||||
|
||||
DEFAULT_SEPARATOR = ", "
|
||||
|
||||
@@ -163,7 +163,11 @@ class SendToNegative: # pylint: disable=too-few-public-methods
|
||||
parameters = negtagparameters.children[0].value if negtagparameters is not None else ""
|
||||
rest = []
|
||||
for x in tree.children[1::]:
|
||||
rest.append(self.__prompt[x.meta.start_pos : x.meta.end_pos] if hasattr(x, "meta") and not x.meta.empty else x.value)
|
||||
rest.append(
|
||||
self.__prompt[x.meta.start_pos : x.meta.end_pos]
|
||||
if hasattr(x, "meta") and not x.meta.empty
|
||||
else x.value
|
||||
)
|
||||
content = "".join(rest)
|
||||
self.__negtags.append(
|
||||
self.NegTag(tree.meta.start_pos, tree.meta.end_pos, content, parameters, self.__shell.copy())
|
||||
|
||||
Reference in New Issue
Block a user