Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,6 +56,7 @@ def update_selection(evt: gr.SelectData, width, height):
|
|
| 56 |
prompt = selected_lora["prompt"]
|
| 57 |
lora_repo = selected_lora["repo"]
|
| 58 |
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
|
|
|
|
| 59 |
if "aspect" in selected_lora:
|
| 60 |
if selected_lora["aspect"] == "portrait":
|
| 61 |
width = 768
|
|
@@ -73,6 +74,7 @@ def update_selection(evt: gr.SelectData, width, height):
|
|
| 73 |
evt.index,
|
| 74 |
width,
|
| 75 |
height,
|
|
|
|
| 76 |
)
|
| 77 |
|
| 78 |
@spaces.GPU(duration=70)
|
|
@@ -195,12 +197,12 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
|
| 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=3, step=0.01, value=0.95)
|
| 199 |
|
| 200 |
gallery.select(
|
| 201 |
update_selection,
|
| 202 |
inputs=[width, height],
|
| 203 |
-
outputs=[prompt, selected_info, selected_index, width, height]
|
| 204 |
)
|
| 205 |
gr.on(
|
| 206 |
triggers=[generate_button.click, prompt.submit],
|
|
|
|
| 56 |
prompt = selected_lora["prompt"]
|
| 57 |
lora_repo = selected_lora["repo"]
|
| 58 |
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
|
| 59 |
+
lora_scale = selected_lora["lora_scale"]
|
| 60 |
if "aspect" in selected_lora:
|
| 61 |
if selected_lora["aspect"] == "portrait":
|
| 62 |
width = 768
|
|
|
|
| 74 |
evt.index,
|
| 75 |
width,
|
| 76 |
height,
|
| 77 |
+
lora_scale,
|
| 78 |
)
|
| 79 |
|
| 80 |
@spaces.GPU(duration=70)
|
|
|
|
| 197 |
with gr.Row():
|
| 198 |
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
| 199 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
| 200 |
+
#lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=3, step=0.01, value=0.95)
|
| 201 |
|
| 202 |
gallery.select(
|
| 203 |
update_selection,
|
| 204 |
inputs=[width, height],
|
| 205 |
+
outputs=[prompt, selected_info, selected_index, width, height, lora_scale]
|
| 206 |
)
|
| 207 |
gr.on(
|
| 208 |
triggers=[generate_button.click, prompt.submit],
|