import gradio as gr from .download import CSS from .inpainting import StableDiffusionInpaintGenerator from .text2img import StableDiffusionText2ImageGenerator from .img2img import StableDiffusionImage2ImageGenerator def main_box(username : str = "admin"): """ Implement the main interface for the app which will be served to the frontend. """ # customize the share_js button by letting username app = gr.Blocks(css = CSS) with app: with gr.Row(): with gr.Column(): with gr.Tab("Text-to-Image", id = 'text-to-image', elem_id='text-to-image-tab'): StableDiffusionText2ImageGenerator.app() with gr.Tab("Image-to-Image", id = 'image-to-image', elem_id='image-to-image-tab'): StableDiffusionImage2ImageGenerator.app() with gr.Tab("Inpainting", id = 'inpainting', elem_id = 'inpainting-tab'): StableDiffusionInpaintGenerator.app() # Add a footer that will be displayed at the bottom of the app gr.HTML("""