Brian Watson commited on
Commit
270c82d
1 Parent(s): 3420192

Update app.py

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