from text_to_image import TextToImageTool import gradio as gr tool = TextToImageTool() def fn(*args, **kwargs): return tool(*args, **kwargs) gr.Interface( fn=fn, inputs=tool.inputs, outputs=tool.outputs, title=tool.__name__, article=tool.description, ).queue(concurrency_count=5).launch()