Brian Watson commited on
Commit
dbaf37f
·
1 Parent(s): f49a776

Update app.py

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