Brian Watson commited on
Commit
592b915
1 Parent(s): 0b8fb4e

Update app.py

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