fix formatting of prompt string

This commit is contained in:
Sj-Si 2024-04-22 15:01:30 -04:00
parent 04535c5801
commit 58eef032cd

View File

@ -44,10 +44,10 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
self.read_user_metadata(item)
activation_text = item["user_metadata"].get("activation text")
preferred_weight = item["user_metadata"].get("preferred weight", 0.0)
item["prompt"] = quote_js(f"<lora:{alias}:{str(preferred_weight) if preferred_weight else shared.opts.extra_networks_default_multiplier}>")
prompt = f"<lora:{alias}:{str(preferred_weight) if preferred_weight else shared.opts.extra_networks_default_multiplier}>"
if activation_text:
item["prompt"] += " + " + quote_js(" " + activation_text)
prompt += f" {activation_text}"
item["prompt"] = quote_js(prompt)
negative_prompt = item["user_metadata"].get("negative text")
item["negative_prompt"] = quote_js("")