Brian Watson commited on
Commit
eba0129
β€’
1 Parent(s): c81dfc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -45
app.py CHANGED
@@ -13,7 +13,7 @@ models = [
13
 
14
  current_model = models[0]
15
 
16
- text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
17
 
18
  models2 = []
19
  for model in models:
@@ -29,7 +29,7 @@ def text_it(inputs, text_gen=text_gen):
29
  def set_model(current_model_index):
30
  global current_model
31
  current_model = models[current_model_index]
32
- return gr.update(label=f"{current_model['name']}")
33
 
34
 
35
  def send_it(inputs, model_choice):
@@ -37,27 +37,9 @@ def send_it(inputs, model_choice):
37
  return proc(inputs)
38
 
39
 
40
- css = """"""
41
-
42
- with gr.Blocks(css=css) as myface:
43
  gr.HTML(
44
- """<!DOCTYPE html>
45
- <html lang="en">
46
- <head>
47
- <meta charset="utf-8" />
48
- <meta name="twitter:card" content="player"/>
49
- <meta name="twitter:site" content=""/>
50
- <meta name="twitter:player" content="https://omnibus-maximum-multiplier-places.hf.space"/>
51
- <meta name="twitter:player:stream" content="https://omnibus-maximum-multiplier-places.hf.space"/>
52
- <meta name="twitter:player:width" content="100%"/>
53
- <meta name="twitter:player:height" content="600"/>
54
- <meta property="og:title" content="Embedded Live Viewer"/>
55
- <meta property="og:description" content="Tweet Genie - A Huggingface Space"/>
56
- <meta property="og:image" content="https://cdn.glitch.global/80dbe92e-ce75-44af-84d5-74a2e21e9e55/omnicard.png?v=1676772531627"/>
57
- <!--<meta http-equiv="refresh" content="0; url=https://huggingface.co/spaces/corbt/tweet-genie">-->
58
- </head>
59
- </html>
60
- """
61
  )
62
 
63
  with gr.Row():
@@ -74,28 +56,31 @@ with gr.Blocks(css=css) as myface:
74
  with gr.Row():
75
  see_prompts = gr.Button("Generate Prompts")
76
  run = gr.Button("Generate Images", variant="primary")
77
- with gr.Tab("Main"):
78
- with gr.Row():
79
- output1 = gr.Image(label=f"{current_model['name']}")
80
- output2 = gr.Image(label=f"{current_model['name']}")
81
- output3 = gr.Image(label=f"{current_model['name']}")
82
- output4 = gr.Image(label=f"{current_model['name']}")
83
- with gr.Row():
84
- magic1 = gr.Textbox(lines=4)
85
- magic2 = gr.Textbox(lines=4)
86
- magic3 = gr.Textbox(lines=4)
87
- magic4 = gr.Textbox(lines=4)
88
-
89
- with gr.Row():
90
- output5 = gr.Image(label=f"{current_model['name']}")
91
- output6 = gr.Image(label=f"{current_model['name']}")
92
- output7 = gr.Image(label=f"{current_model['name']}")
93
- output8 = gr.Image(label=f"{current_model['name']}")
94
- with gr.Row():
95
- magic5 = gr.Textbox(lines=4)
96
- magic6 = gr.Textbox(lines=4)
97
- magic7 = gr.Textbox(lines=4)
98
- magic8 = gr.Textbox(lines=4)
 
 
 
99
 
100
  model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
101
 
@@ -118,4 +103,4 @@ with gr.Blocks(css=css) as myface:
118
  see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
119
 
120
  myface.queue(concurrency_count=200)
121
- myface.launch(inline=True, show_api=False, max_threads=400)
 
13
 
14
  current_model = models[0]
15
 
16
+ text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
17
 
18
  models2 = []
19
  for model in models:
 
29
  def set_model(current_model_index):
30
  global current_model
31
  current_model = models[current_model_index]
32
+ return gr.update(value=f"{current_model['name']}")
33
 
34
 
35
  def send_it(inputs, model_choice):
 
37
  return proc(inputs)
38
 
39
 
40
+ with gr.Blocks() as myface:
 
 
41
  gr.HTML(
42
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  )
44
 
45
  with gr.Row():
 
56
  with gr.Row():
57
  see_prompts = gr.Button("Generate Prompts")
58
  run = gr.Button("Generate Images", variant="primary")
59
+
60
+ with gr.Row():
61
+ output1 = gr.Image(label="")
62
+ output2 = gr.Image(label="")
63
+ with gr.Row():
64
+ magic1 = gr.Textbox(lines=2)
65
+ magic2 = gr.Textbox(lines=2)
66
+ with gr.Row():
67
+ output3 = gr.Image(label="")
68
+ output4 = gr.Image(label="")
69
+ with gr.Row():
70
+ magic3 = gr.Textbox(lines=2)
71
+ magic4 = gr.Textbox(lines=2)
72
+ with gr.Row():
73
+ output5 = gr.Image(label="")
74
+ output6 = gr.Image(label="")
75
+ with gr.Row():
76
+ magic5 = gr.Textbox(lines=2)
77
+ magic6 = gr.Textbox(lines=2)
78
+ with gr.Row():
79
+ output7 = gr.Image(label="")
80
+ output8 = gr.Image(label="")
81
+ with gr.Row():
82
+ magic7 = gr.Textbox(lines=2)
83
+ magic8 = gr.Textbox(lines=2)
84
 
85
  model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
86
 
 
103
  see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
104
 
105
  myface.queue(concurrency_count=200)
106
+ myface.launch(inline=True, show_api=False, max_threads=400)