Brian Watson commited on
Commit
0fdcfc0
1 Parent(s): 562c002

Update app.py

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