Spaces:
Runtime error
Runtime error
clean apis for gradio 6.x
Browse files426 unmodified lines4274284294304314324331 unmodified line4354364374384394404411 unmodified line4434444454464474484491 unmodified line4514524534544554564571 unmodified line4594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115122 unmodified lines515516517518519520521426 unmodified linesfn=use_output_as_input,inputs=[result],outputs=[input_image],show_api=False)target_ratio.change(1 unmodified lineinputs=[target_ratio, width_slider, height_slider],outputs=[width_slider, height_slider, settings_panel],queue=False,show_api=False)width_slider.change(1 unmodified lineinputs=[width_slider, height_slider],outputs=[target_ratio],queue=False,show_api=False)height_slider.change(1 unmodified lineinputs=[width_slider, height_slider],outputs=[target_ratio],queue=False,show_api=False)resize_option.change(1 unmodified lineinputs=[resize_option],outputs=[custom_resize_percentage],queue=False,show_api=False)run_button.click( # Clear the resultfn=clear_result,inputs=None,outputs=result,show_api=False).then( # Generate the new imagefn=infer,inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,overlap_left, overlap_right, overlap_top, overlap_bottom],outputs=result,).then( # Show the "Use as Input Image" buttonfn=lambda: gr.update(visible=True),inputs=None,outputs=use_as_input_button,show_api=False).then( # Update the history galleryfn=lambda x, history: update_history(x[1], history),inputs=[result, history_gallery],outputs=history_gallery,show_api=False)prompt_input.submit( # Clear the resultfn=clear_result,inputs=None,outputs=result,show_api=False).then( # Generate the new imagefn=infer,inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,overlap_left, overlap_right, overlap_top, overlap_bottom],outputs=result,show_api=False).then( # Update the history galleryfn=lambda x, history: update_history(x[1], history),inputs=[result, history_gallery],outputs=history_gallery,show_api=False).then( # Show the "Use as Input Image" buttonfn=lambda: gr.update(visible=True),inputs=None,outputs=use_as_input_button,show_api=False)preview_button.click(2 unmodified linesoverlap_left, overlap_right, overlap_top, overlap_bottom],outputs=preview_image,queue=False,show_api=False)demo.queue(max_size=12).launch(share=False, show_error=True, mcp_server=True)426 unmodified lines4274284294304314324331 unmodified line4354364374384394404411 unmodified line4434444454464474484491 unmodified line4514524534544554564571 unmodified line4594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125132 unmodified lines516517518519520521522426 unmodified linesfn=use_output_as_input,inputs=[result],outputs=[input_image],api_visibility="private",)target_ratio.change(1 unmodified lineinputs=[target_ratio, width_slider, height_slider],outputs=[width_slider, height_slider, settings_panel],queue=False,api_visibility="private",)width_slider.change(1 unmodified lineinputs=[width_slider, height_slider],outputs=[target_ratio],queue=False,api_visibility="private",)height_slider.change(1 unmodified lineinputs=[width_slider, height_slider],outputs=[target_ratio],queue=False,api_visibility="private",)resize_option.change(1 unmodified lineinputs=[resize_option],outputs=[custom_resize_percentage],queue=False,api_visibility="private",)run_button.click( # Clear the resultfn=clear_result,inputs=None,outputs=result,api_visibility="private",).then( # Generate the new imagefn=infer,inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,overlap_left, overlap_right, overlap_top, overlap_bottom],outputs=result,api_visibility="public",).then( # Show the "Use as Input Image" buttonfn=lambda: gr.update(visible=True),inputs=None,outputs=use_as_input_button,api_visibility="private",).then( # Update the history galleryfn=lambda x, history: update_history(x[1], history),inputs=[result, history_gallery],outputs=history_gallery,api_visibility="private",)prompt_input.submit( # Clear the resultfn=clear_result,inputs=None,outputs=result,api_visibility="private",).then( # Generate the new imagefn=infer,inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,overlap_left, overlap_right, overlap_top, overlap_bottom],outputs=result,api_visibility="private",).then( # Update the history galleryfn=lambda x, history: update_history(x[1], history),inputs=[result, history_gallery],outputs=history_gallery,api_visibility="private",).then( # Show the "Use as Input Image" buttonfn=lambda: gr.update(visible=True),inputs=None,outputs=use_as_input_button,api_visibility="private",)preview_button.click(2 unmodified linesoverlap_left, overlap_right, overlap_top, overlap_bottom],outputs=preview_image,queue=False,api_visibility="private",)demo.queue(max_size=12).launch(share=False, show_error=True, mcp_server=True)
app.py+14-13