Spaces:
Running
Running
import gradio as gr | |
from utils import * | |
with gr.Blocks() as gr_interface: | |
#gr.HTML(value=HTML_TEMPLATE, show_label=False) | |
with gr.Row(): | |
text_input = gr.Textbox( | |
label="Enter your prompt", | |
placeholder="Cats fighting on the road ", | |
) | |
concept_dropdown = gr.Dropdown( | |
label="Select a Concept", | |
choices=["Illustration Style", "Line Art", "Hitokomoru Style", | |
"Marc Allante", "Midjourney", "Hanfu Anime", "Birb Style"], | |
value="Illustration Style" | |
) | |
method_dropdown = gr.Dropdown( | |
label="Select Guidance Type", | |
choices=["edge", "contrast", "sharpness", "blue", "brightness"], | |
value="contrast" | |
) | |
inputs = [text_input, concept_dropdown, method_dropdown] | |
with gr.Row(): | |
outputs = gr.Gallery( | |
label="Generative Images", show_label=True, | |
columns=[2], rows=[1], object_fit="contain" | |
) | |
# with gr.Row(): | |
# gr.Examples(examples=get_examples(), inputs=inputs, outputs=outputs, fn=show_image, cache_examples=True) | |
title = "Generative Art - Stable Diffusion with Styles and Custom Loss" | |
demo = gr.Interface(fn=show_image, inputs=inputs, outputs=outputs, title=title) | |
if __name__ == "__main__": | |
demo.launch(enable_queue=True, debug=True) |