diff --git a/ai_diffusion/text.py b/ai_diffusion/text.py index eacba1ac72..66dcd0a6bb 100644 --- a/ai_diffusion/text.py +++ b/ai_diffusion/text.py @@ -48,6 +48,7 @@ def replace(match: re.Match[str]): lora_normalized = file.name.lower() if input == lora_filename or input == lora_normalized: lora_file = file + break if not lora_file: error = _("LoRA not found") + f": {input}" @@ -64,7 +65,7 @@ def replace(match: re.Match[str]): raise Exception(error) loras.append(LoraInput(lora_file.id, lora_strength)) - return lora_file.meta("lora_triggers", "") + return "" prompt = _pattern_lora.sub(replace, prompt) return prompt.strip(), loras diff --git a/ai_diffusion/ui/autocomplete.py b/ai_diffusion/ui/autocomplete.py index e3571ef9a9..a77a01f8f7 100644 --- a/ai_diffusion/ui/autocomplete.py +++ b/ai_diffusion/ui/autocomplete.py @@ -133,9 +133,6 @@ def _blend_colors(self, from_, to, factor): class PromptAutoComplete: - _completer: QCompleter - _completion_prefix: str - _completion_suffix: str def __init__(self, widget: QLineEdit): self._widget = widget @@ -235,17 +232,20 @@ def check_completion(self): self._completer.complete(rect) def _insert_completion(self, completion): - if not self._current_text().startswith(" zap", loras) == ( - "a ship zippity zap", + "a ship zap", # triggers are inserted on auto-complete, not at extraction [LoraInput(lora.id, 0.5)], )