Spaces:
Running
on
Zero
Running
on
Zero
AlekseyCalvin
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,16 @@ def run_lora(prompt, cfg_scale, steps, selected_index, randomize_seed, seed, wid
|
|
95 |
selected_lora = loras[selected_index]
|
96 |
lora_path = selected_lora["repo"]
|
97 |
trigger_word = selected_lora["trigger_word"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
# Load LoRA weights
|
100 |
with calculateDuration(f"Loading LoRA weights for {selected_lora['title']}"):
|
|
|
95 |
selected_lora = loras[selected_index]
|
96 |
lora_path = selected_lora["repo"]
|
97 |
trigger_word = selected_lora["trigger_word"]
|
98 |
+
if(trigger_word):
|
99 |
+
if "trigger_position" in selected_lora:
|
100 |
+
if selected_lora["trigger_position"] == "prepend":
|
101 |
+
prompt_mash = f"{trigger_word} {prompt}"
|
102 |
+
else:
|
103 |
+
prompt_mash = f"{prompt} {trigger_word}"
|
104 |
+
else:
|
105 |
+
prompt_mash = f"{trigger_word} {prompt}"
|
106 |
+
else:
|
107 |
+
prompt_mash = prompt
|
108 |
|
109 |
# Load LoRA weights
|
110 |
with calculateDuration(f"Loading LoRA weights for {selected_lora['title']}"):
|