raghunc0 commited on
Commit
08e3ebb
·
1 Parent(s): 59a1ff6

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -0
app.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+
4
+
5
+ with gr.Blocks() as interface:
6
+ #gr.HTML(value=HTML_TEMPLATE, show_label=False)
7
+ with gr.Row():
8
+ text_input = gr.Textbox(
9
+ label="Enter your prompt here",
10
+ placeholder="A portrait James bond in the style of ...",
11
+ )
12
+ concept_dropdown = gr.Dropdown(
13
+ label="Select an SD Concept",
14
+ choices=["midjourney", "birb", "indian-watercolor", "Marc Allante", "herge"],
15
+ value='Dream'
16
+ )
17
+
18
+
19
+ seed_slider = gr.Slider(
20
+ label="Random Seed",
21
+ minimum=0,
22
+ maximum=10000,
23
+ step=1,
24
+ value=42
25
+ )
26
+ inputs = [text_input, concept_dropdown, method_dropdown, seed_slider]
27
+
28
+ with gr.Row():
29
+ outputs = gr.Gallery(
30
+ label="Generated Image", show_label=True,
31
+ columns=[2], rows=[1], object_fit="contain"
32
+ )
33
+
34
+ with gr.Row():
35
+ button = gr.Button("Generate")
36
+ button.click(generate_art, inputs=inputs, outputs=outputs)
37
+
38
+ with gr.Row():
39
+ gr.Examples(examples=get_examples(), inputs=inputs, outputs=outputs, fn=generate_art, cache_examples=True)
40
+
41
+
42
+ if __name__ == "__main__":
43
+ interface.launch(enable_queue=True)