Fix: remove gr.File output (triggers Gradio 5.20 API schema bug)
Browse files89 unmodified lines9091929393949597969997989910024 unmodified lines12512612713013113213313413512812913013113213314013413513613789 unmodified lines output_images = result.images
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
saved_paths = []
for i, img in enumerate(output_images):
path = os.path.join(OUTPUT_DIR, f"tryon_{timestamp}_{i}.png")
img.save(path, format="PNG")
saved_paths.append(path)
return output_images, saved_paths
return output_images
# ---------------------------------------------------------------------------
# Gradio UI24 unmodified lines try_btn = gr.Button("👗 Try On", variant="primary", size="lg")
with gr.Column():
output_gallery = gr.Gallery(label="Result", columns=1, height=380)
output_files = gr.File(
label="⬇ Download to your device",
file_count="multiple",
interactive=False,
)
gr.Markdown("*Click an image in the gallery then use its ⬇ icon to download.*")
output_gallery = gr.Gallery(label="Result", columns=1, height=420, show_download_button=True)
try_btn.click(
fn=run_tryon,
inputs=[person_input, garment_input, cloth_type, num_steps, guidance, seed_input],
outputs=[output_gallery, output_files],
outputs=[output_gallery],
)
gr.Markdown(app.py+4-10