Spaces:
Sleeping
Sleeping
lora.change
Browse files
app.py
CHANGED
|
@@ -100,11 +100,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 100 |
info="Adjust LoRA adapter strength"
|
| 101 |
)
|
| 102 |
|
| 103 |
-
def setup_lora(
|
| 104 |
-
if
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
| 106 |
else:
|
| 107 |
-
return gr.Dropdown(choices=["None", "pepe"], info="Choose lora", visible=False)
|
| 108 |
|
| 109 |
def setup_lora_scale(selected_option):
|
| 110 |
if selected_option == "None":
|
|
@@ -113,14 +116,20 @@ with gr.Blocks(css=css) as demo:
|
|
| 113 |
return gr.Slider(visible=True)
|
| 114 |
|
| 115 |
model_id.change(
|
| 116 |
-
fn=setup_lora,
|
| 117 |
-
inputs=model_id,
|
| 118 |
-
outputs=lora)
|
| 119 |
-
|
| 120 |
lora.change(
|
| 121 |
-
fn=
|
| 122 |
-
inputs=
|
| 123 |
-
outputs=lora_scale)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
with gr.Row():
|
| 126 |
del_back = gr.Checkbox(label="Delete background", value=False)
|
|
|
|
| 100 |
info="Adjust LoRA adapter strength"
|
| 101 |
)
|
| 102 |
|
| 103 |
+
def setup_lora(sel_model, sel_lora):
|
| 104 |
+
if sel_model == "CompVis/stable-diffusion-v1-4":
|
| 105 |
+
if sel_lora == "None":
|
| 106 |
+
return [gr.Dropdown(choices=["None", "pepe"], info="Choose lora", visible=True), gr.Slider(visible=False)]
|
| 107 |
+
else:
|
| 108 |
+
return [gr.Dropdown(choices=["None", "pepe"], info="Choose lora", visible=True), gr.Slider(visible=True)]
|
| 109 |
else:
|
| 110 |
+
return [gr.Dropdown(choices=["None", "pepe"], info="Choose lora", visible=False), gr.Slider(visible=False)]
|
| 111 |
|
| 112 |
def setup_lora_scale(selected_option):
|
| 113 |
if selected_option == "None":
|
|
|
|
| 116 |
return gr.Slider(visible=True)
|
| 117 |
|
| 118 |
model_id.change(
|
| 119 |
+
fn=setup_lora,
|
| 120 |
+
inputs=[model_id, lora]
|
| 121 |
+
outputs=[lora, lora_scale])
|
| 122 |
+
|
| 123 |
lora.change(
|
| 124 |
+
fn=setup_lora,
|
| 125 |
+
inputs=[model_id, lora]
|
| 126 |
+
outputs=[lora, lora_scale])
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
#lora.change(
|
| 130 |
+
# fn=setup_lora_scale,
|
| 131 |
+
# inputs=lora,
|
| 132 |
+
# outputs=lora_scale)
|
| 133 |
|
| 134 |
with gr.Row():
|
| 135 |
del_back = gr.Checkbox(label="Delete background", value=False)
|