Update app.py
Browse files
app.py
CHANGED
@@ -78,6 +78,13 @@ css = """
|
|
78 |
}
|
79 |
"""
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
with gr.Blocks(css=css) as demo:
|
82 |
with gr.Column(elem_id="col-container"):
|
83 |
gr.Markdown(" # UM235 DIFFUSION Space")
|
@@ -232,6 +239,21 @@ with gr.Blocks(css=css) as demo:
|
|
232 |
],
|
233 |
outputs=[result, seed],
|
234 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
if __name__ == "__main__":
|
237 |
demo.launch()
|
|
|
78 |
}
|
79 |
"""
|
80 |
|
81 |
+
def update_controlnet_visibility(controlnet_enabled):
|
82 |
+
return {"visible": controlnet_enabled}
|
83 |
+
|
84 |
+
def update_ip_adapter_visibility(ip_adapter_enabled):
|
85 |
+
return {"visible": ip_adapter_enabled}
|
86 |
+
|
87 |
+
|
88 |
with gr.Blocks(css=css) as demo:
|
89 |
with gr.Column(elem_id="col-container"):
|
90 |
gr.Markdown(" # UM235 DIFFUSION Space")
|
|
|
239 |
],
|
240 |
outputs=[result, seed],
|
241 |
)
|
242 |
+
gr.on(
|
243 |
+
triggers=[controlnet_enabled],
|
244 |
+
fn=update_controlnet_visibility,
|
245 |
+
inputs=[controlnet_enabled],
|
246 |
+
outputs=[control_strength, control_mode, control_image],
|
247 |
+
)
|
248 |
+
|
249 |
+
# Updates visibility when the checkbox for IP-Adapter is toggled
|
250 |
+
gr.on(
|
251 |
+
triggers=[ip_adapter_enabled],
|
252 |
+
fn=update_ip_adapter_visibility,
|
253 |
+
inputs=[ip_adapter_enabled],
|
254 |
+
outputs=[ip_adapter_scale, ip_adapter_image],
|
255 |
+
)
|
256 |
+
|
257 |
|
258 |
if __name__ == "__main__":
|
259 |
demo.launch()
|