From 721c4309c26374983589bcaba2f401a4bf01e2c2 Mon Sep 17 00:00:00 2001 From: Andray Date: Thu, 21 Mar 2024 16:29:51 +0400 Subject: [PATCH] escape brackets in lora random prompt generator --- extensions-builtin/Lora/ui_edit_user_metadata.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions-builtin/Lora/ui_edit_user_metadata.py b/extensions-builtin/Lora/ui_edit_user_metadata.py index 3160aecfa..7a07a544e 100644 --- a/extensions-builtin/Lora/ui_edit_user_metadata.py +++ b/extensions-builtin/Lora/ui_edit_user_metadata.py @@ -149,6 +149,8 @@ class LoraUserMetadataEditor(ui_extra_networks_user_metadata.UserMetadataEditor) v = random.random() * max_count if count > v: + for x in "({[]})": + tag = tag.replace(x, '\\' + x) res.append(tag) return ", ".join(sorted(res))