Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -214,34 +214,34 @@ with gr.Blocks(css=css) as demo:
|
|
214 |
value=512,
|
215 |
)
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
|
223 |
-
|
224 |
-
with gr.Row():
|
225 |
-
use_control_net = gr.Checkbox(label="Use ControlNet", value=False)
|
226 |
-
|
227 |
-
with gr.Column(visible=False) as controlnet_column:
|
228 |
with gr.Row():
|
229 |
-
|
|
|
|
|
|
|
|
|
230 |
|
231 |
-
|
232 |
-
|
233 |
|
234 |
-
|
235 |
-
|
236 |
|
237 |
-
|
238 |
|
|
|
239 |
gr.Examples(examples=examples, inputs=[prompt])
|
240 |
gr.Examples(examples=examples_negative, inputs=[negative_prompt])
|
241 |
|
242 |
run_button = gr.Button("Run", scale=1, variant="primary")
|
243 |
-
result = gr.Image(label="Result", show_label=False)
|
244 |
-
|
245 |
|
246 |
|
247 |
gr.on(
|
|
|
214 |
value=512,
|
215 |
)
|
216 |
|
217 |
+
def toggle_controlnet_options(use_control_net):
|
218 |
+
if use_control_net:
|
219 |
+
return True
|
220 |
+
else:
|
221 |
+
return False
|
222 |
|
223 |
+
with gr.Blocks(): #as demo:
|
|
|
|
|
|
|
|
|
224 |
with gr.Row():
|
225 |
+
use_control_net = gr.Checkbox(label="Use ControlNet", value=False)
|
226 |
+
|
227 |
+
with gr.Column(visible=False) as controlnet_column:
|
228 |
+
with gr.Row():
|
229 |
+
control_strength_slider = gr.Slider(minimum=0, maximum=1, step=0.01, label="Control Strength")
|
230 |
|
231 |
+
with gr.Row():
|
232 |
+
control_mode_dropdown = gr.Dropdown(['edge_detection', 'pose_estimation'], label='Control Mode')
|
233 |
|
234 |
+
with gr.Row():
|
235 |
+
control_image_input = gr.Image(type="pil", label="Upload Image for ControlNet")
|
236 |
|
237 |
+
use_control_net.change(toggle_controlnet_options, inputs=[use_control_net], outputs=[controlnet_column], show_progress=False)
|
238 |
|
239 |
+
|
240 |
gr.Examples(examples=examples, inputs=[prompt])
|
241 |
gr.Examples(examples=examples_negative, inputs=[negative_prompt])
|
242 |
|
243 |
run_button = gr.Button("Run", scale=1, variant="primary")
|
244 |
+
result = gr.Image(label="Result", show_label=False)
|
|
|
245 |
|
246 |
|
247 |
gr.on(
|