Fix: remove gr.File output (triggers Gradio 5.20 API schema bug)
Browse files89 unmodified lines9091929394959697989910010110224 unmodified lines12712812913013113213313413513613713813914014114214389 unmodified linesoutput_images = result.imagestimestamp = 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# ---------------------------------------------------------------------------# Gradio UI24 unmodified linestry_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,)try_btn.click(fn=run_tryon,inputs=[person_input, garment_input, cloth_type, num_steps, guidance, seed_input],outputs=[output_gallery, output_files],)gr.Markdown(89 unmodified lines9091929394959697989910024 unmodified lines12512612712812913013113213313413513613789 unmodified linesoutput_images = result.imagestimestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")for i, img in enumerate(output_images):path = os.path.join(OUTPUT_DIR, f"tryon_{timestamp}_{i}.png")img.save(path, format="PNG")return output_images# ---------------------------------------------------------------------------# Gradio UI24 unmodified linestry_btn = gr.Button("👗 Try On", variant="primary", size="lg")with gr.Column():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],)gr.Markdown(
app.py+4-10