Spaces:
Running
on
Zero
Running
on
Zero
AlekseyCalvin
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -77,9 +77,10 @@ class calculateDuration:
|
|
77 |
|
78 |
def update_selection(evt: gr.SelectData, width, height):
|
79 |
selected_lora = loras[evt.index]
|
80 |
-
new_placeholder = f"
|
81 |
lora_repo = selected_lora["repo"]
|
82 |
-
|
|
|
83 |
if "aspect" in selected_lora:
|
84 |
if selected_lora["aspect"] == "portrait":
|
85 |
width = 768
|
@@ -159,7 +160,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
|
159 |
|
160 |
# Info blob stating what the app is running
|
161 |
info_blob = gr.HTML(
|
162 |
-
"""<div id="info_blob">
|
163 |
)
|
164 |
selected_index = gr.State(None)
|
165 |
with gr.Row():
|
@@ -186,16 +187,16 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
|
186 |
with gr.Column():
|
187 |
with gr.Row():
|
188 |
cfg_scale = gr.Slider(label="CFG Scale", minimum=0, maximum=20, step=.1, value=1.0)
|
189 |
-
steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=
|
190 |
|
191 |
with gr.Row():
|
192 |
-
width = gr.Slider(label="Width", minimum=256, maximum=1536, step=64, value=
|
193 |
-
height = gr.Slider(label="Height", minimum=256, maximum=1536, step=64, value=
|
194 |
|
195 |
with gr.Row():
|
196 |
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
197 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
198 |
-
lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=2.5, step=0.01, value=0
|
199 |
|
200 |
gallery.select(
|
201 |
update_selection,
|
|
|
77 |
|
78 |
def update_selection(evt: gr.SelectData, width, height):
|
79 |
selected_lora = loras[evt.index]
|
80 |
+
new_placeholder = f"Prompt for {selected_lora['title']} using activator word(s): '{selected_lora["trigger_word"]}'! "
|
81 |
lora_repo = selected_lora["repo"]
|
82 |
+
lora_trigger = selected_lora["trigger_word"]
|
83 |
+
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}). Prompt using: '{lora_trigger}'!"
|
84 |
if "aspect" in selected_lora:
|
85 |
if selected_lora["aspect"] == "portrait":
|
86 |
width = 768
|
|
|
160 |
|
161 |
# Info blob stating what the app is running
|
162 |
info_blob = gr.HTML(
|
163 |
+
"""<div id="info_blob"> To reinforce/focus in selected fine-tuned LoRAs (Low-Rank Adapters), add special “trigger" words/phrases to your prompts. </div>"""
|
164 |
)
|
165 |
selected_index = gr.State(None)
|
166 |
with gr.Row():
|
|
|
187 |
with gr.Column():
|
188 |
with gr.Row():
|
189 |
cfg_scale = gr.Slider(label="CFG Scale", minimum=0, maximum=20, step=.1, value=1.0)
|
190 |
+
steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=9)
|
191 |
|
192 |
with gr.Row():
|
193 |
+
width = gr.Slider(label="Width", minimum=256, maximum=1536, step=64, value=1024)
|
194 |
+
height = gr.Slider(label="Height", minimum=256, maximum=1536, step=64, value=1024)
|
195 |
|
196 |
with gr.Row():
|
197 |
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
198 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
199 |
+
lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=2.5, step=0.01, value=1.0)
|
200 |
|
201 |
gallery.select(
|
202 |
update_selection,
|