Fix Preprocess images button in Gradio demo

This commit is contained in:
raghavaggsss
2025-03-24 10:29:35 +00:00
parent 42cf6ae756
commit e9fe3a941c
+6
View File
@@ -1147,6 +1147,12 @@ def main(server_port: int | None = None, share: bool = True):
],
)
preprocessed = gr.State()
# Enable the Preprocess Images button when images are uploaded
input_imgs.change(
lambda imgs: gr.update(interactive=bool(imgs)),
inputs=[input_imgs],
outputs=[preprocess_btn],
)
preprocess_btn.click(
lambda r, *args: r.preprocess(*args),
inputs=[renderer, input_imgs],