escape brackets in lora random prompt generator

This commit is contained in:
Andray 2024-03-21 16:29:51 +04:00
parent 57727e554d
commit 721c4309c2

View File

@ -149,6 +149,8 @@ class LoraUserMetadataEditor(ui_extra_networks_user_metadata.UserMetadataEditor)
v = random.random() * max_count v = random.random() * max_count
if count > v: if count > v:
for x in "({[]})":
tag = tag.replace(x, '\\' + x)
res.append(tag) res.append(tag)
return ", ".join(sorted(res)) return ", ".join(sorted(res))