From baf20cb0cfcfa2a73b65a59c0ff22c47b1640265 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Fri, 30 Jun 2023 15:43:54 +0200 Subject: [PATCH] Update build_dynamic_prompt.py Storing LoRA's first and then putting them back AFTER we clean up the prompt, so they remain the same --- build_dynamic_prompt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index fc82160..a56d458 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -1647,13 +1647,12 @@ def cleanup(completeprompt): # first, move LoRA's to the back dynamically # Find all occurrences of text between < and > using regex - matches = re.findall(r"<[^>]+>", completeprompt) + allLoRA = re.findall(r"<[^>]+>", completeprompt) # Remove the extracted matches from completeprompt completeprompt = re.sub(r"<[^>]+>", "", completeprompt) - # Move the extracted matches to the end of completeprompt - completeprompt += " " + " ".join(matches) + # sometimes if there are not enough artist, we get left we things formed as (:1.2) completeprompt = re.sub('\(\:\d+\.\d+\)', '', completeprompt) @@ -1695,7 +1694,8 @@ def cleanup(completeprompt): completeprompt = re.sub('(?