kbora's picture
Upload 51 files
6af7294
raw
history blame
1.28 kB
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