Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -99,11 +99,12 @@ def remove_id_and_ext(text):
|
|
99 |
return text
|
100 |
|
101 |
def place_lora(current_prompt, lorabtn):
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
107 |
|
108 |
def create_grid(image_urls):
|
109 |
# Download first image to get size
|
|
|
99 |
return text
|
100 |
|
101 |
def place_lora(current_prompt, lorabtn):
|
102 |
+
pattern = r"<lora:" + lora_name + r":.*?>"
|
103 |
+
|
104 |
+
if re.search(pattern, current_prompt):
|
105 |
+
return re.sub(pattern, "", current_prompt)
|
106 |
+
else:
|
107 |
+
return current_prompt + "<lora:" + lora_name + ":1>"
|
108 |
|
109 |
def create_grid(image_urls):
|
110 |
# Download first image to get size
|