File size: 1,277 Bytes
6af7294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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("""
        <div style="text-align: center; font-size: 12px; margin-top: 10px; color: #999;">Minerva : Only your imagination is the limit!</div>
        """) 

    app.queue(concurrency_count=2)
    return app